Mercurial > hg > config
changeset 296:ee3c1b65d6d1
random fixes
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Sat, 11 May 2013 06:50:40 -0700 |
parents | e2564dd51334 |
children | 618db1b1f34b |
files | .bashrc python/html2flux.py |
diffstat | 2 files changed, 37 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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(){
--- 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 <dl> 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]'