Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am derega on github.
  • I am derega (https://keybase.io/derega) on keybase.
  • I have a public key whose fingerprint is 321F 4699 8863 8357 079A B7E0 3C7E 46D8 C856 3839

To claim this, I am signing this object:

@derega
derega / fabfile.py
Created December 6, 2009 20:12
Managing Django projects
from __future__ import with_statement
from fabric.api import *
def _read_config(conf_file=None):
import ConfigParser
CACHE_FILE = 'config.cache'
c = ConfigParser.ConfigParser()
if not conf_file:
# to initialize the mq patch queue. Done only once.
hg qinit
# converts the tip changeset to patch
# refreshes the patch with work area content
# converts the patch back to changeset
hg qimport -r tip && hg qrefresh && hg qfinish -a
from subprocess import PIPE, Popen
import time
import codecs
import re
CLASS_RE = re.compile(r'WM_CLASS\(STRING\) = "([^"]+)", "([^"]+)"')
TITLE_RE = re.compile(r'WM_NAME\([A-Z_]+\) = "([^"]+)"')