# HG changeset patch # User Jeff Hammel # Date 1372740083 25200 # Node ID 0e270a448610403c72db7039e074314f00d7871e # Parent b4e679b5a9c38bbab4a26044c23c0fb6816b6077 more partial work diff -r b4e679b5a9c3 -r 0e270a448610 python/venvit.py --- a/python/venvit.py Fri Jun 28 10:32:30 2013 -0700 +++ b/python/venvit.py Mon Jul 01 21:41:23 2013 -0700 @@ -19,6 +19,7 @@ to console, maybe falling back to the README """ +import optparse import sys # class for VCS @@ -28,15 +29,15 @@ args = sys.argv[1:] if len(args) != 1: - print "Usage: %prog " + print "Usage: %prog " # determine name of the package -NAME= -for i in /trunk /branches /tag -do - NAME=${NAME%%$i*} -done +name = args[0] +for i in ('/trunk', '/branches', '/tag'): + if name.endswith(i): + name = name[:-len(i)] + NAME=${NAME%%/} # remove trailing slash NAME=${NAME##*/}