# HG changeset patch # User Jeff Hammel # Date 1368280240 25200 # Node ID ee3c1b65d6d144c659808f528fe3d932315d3d77 # Parent e2564dd513349ca4f56874ab2f5a1351b56f424a random fixes diff -r e2564dd51334 -r ee3c1b65d6d1 .bashrc --- a/.bashrc Sat May 11 04:16:56 2013 -0700 +++ b/.bashrc Sat May 11 06:50:40 2013 -0700 @@ -264,6 +264,33 @@ done } +recreate-venv() { + # recreate a virtualenv + VIRTUALENV="virtualenv.py" + for i in $@ + do + ${VIRTUALENV} --clear "${i}" + + SRCDIR="${i}"/src + if [ -d "${SRCDIR}" ] + then + . "${i}/bin/activate" + OLDPWD=${PWD} + cd "${SRCDIR}" + for j in * + do + if [ -e "${j}"/setup.py ] + then + cd "${j}" + python setup.py develop + cd .. + fi + done + cd "${OLDPWD}" + fi + done +} + ### functions for version control systems svndance(){ diff -r e2564dd51334 -r ee3c1b65d6d1 python/html2flux.py --- a/python/html2flux.py Sat May 11 04:16:56 2013 -0700 +++ b/python/html2flux.py Sat May 11 06:50:40 2013 -0700 @@ -25,6 +25,8 @@ executables = set([i.rsplit('/', 1)[-1] for i in lsex() ]) def readmenu(dl, output, top=True): + """read menu from an
tag""" + # TODO: probably don't really need lxml menu_items = [] name = None # menu name @@ -57,8 +59,13 @@ """ - output: file-like object for writing """ + + # print [submenu] tag for this menu name = name or '' - print >> output, '[submenu] (%s)' % name + if not top: + print >> output, '[submenu] (%s)' % name + + # print menu items for name, item in menu: if isinstance(item, basestring): # command @@ -66,6 +73,8 @@ else: # submenu printflux(name, item, output, top=False) + + # print end of this submenu if not top: print >> output, '[end]'