diff python/venvit.py @ 358:0e270a448610

more partial work
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 01 Jul 2013 21:41:23 -0700
parents 915f88af9624
children
line wrap: on
line diff
--- 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 <svn-or-hg-location>"
+    print "Usage: %prog <repo-location>"
 
 
 # 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##*/}