changeset 358:0e270a448610

more partial work
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 01 Jul 2013 21:41:23 -0700
parents b4e679b5a9c3
children 07d01606da84
files python/venvit.py
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
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##*/}