Posts categorized under: programming

Integrating PEP8 & PyLint Tests with Nose & Xunit

Motivation

Most continuous integration platforms support the xunit/junit formats for test results. They allow a greater granularity of test management above a simple pass/fail. Nose supports xunit reports by default, but PEP8 and PyLint do not. By integrating PEP8 & PyLint into nose tests, we can include their results ...

Automatically create django User Profiles as needed.

Ran across a very nice, brief run down of creating user profiles for django on Turnkey Linux.

I was particularly pleased of this "ism" that creates user profiles on the fly on an as needed basis. As a bonus, it provides access to the profiles through a user.profile property ...

Nose Unit Testing Quick Start

This is just a quick "get up and running fast" walk through on using the Nose Unit Testing framework. The reference documentation for Nose is great, but their site seems a little light on the quick start side. I assume you have python installed. If you're unsure how to ...

enum masks idiom in python

We've all seen this:

class Foo {
public:
  enum FooType
  {
    FooTypeOne    = 0x1,
    FooTypeTwo   = 0x1 << 1,
    FooTypeThree = 0x1 << 2,
    FLAGS = ONE | TWO | THREE | FOUR
  };
}

I needed to implement something similar in python. Before doing so, I check to see what the canonical way of doing so is (e.g. 'switch' vs ...

Customized Qt4 Generated Xcode Projects

One of the very nice features of Qt's qmake is the ability to generate platform specific IDE projects. However, unless I've missed something in the Qt docs customizing the build settings for generated projects is very limited. Since often run qmake to update other generated files (ui_, moc_ ...

Compiling a 4-way universal perl binary on osx

If you don't like having all of your perl modules overwritten by cavalier osx server updates, then you're either going with a macports install or rolling your own. And if you don't want to give up mod_auth_apple, you're probably rolling your own.

If you're using ...

30 Days with TextMate

I've been a vim user for years, but since moving to OSX I've been hearing a lot about TextMate. Since I always encourage others to keep an open mind and learn new things, I decided to give this editor a solid shot. For the next 30 days, I ...

Showing tabs in Vim

Now that the lab has decided to use Python, I occasionally run into the dreaded "indentation error" that is darn near impossible to find by eye. This is often due to differences in text editor settings, diff'ing two files, etc.

I've looked for some easy solution on this ...

Agile Project Setup for Python

This is a quick summarization of the screen casts found at ShowMeDo.. It's a good quick reference for getting a project up and going with nosetests, easy_install, virtualenv, pastescript, and sphinx for documentation.

This is not intendedto be a zero to go walk through or a cut/paste example ...