[Checkins] SVN: gocept.selenium/branches/gotcha-generator/src/gocept/selenium/scripts/converthtmltests.py use and report absolute paths

Godefroid Chapelle gotcha at bubblenet.be
Tue Jan 4 06:40:49 EST 2011


Log message for revision 119338:
  use and report absolute paths

Changed:
  U   gocept.selenium/branches/gotcha-generator/src/gocept/selenium/scripts/converthtmltests.py

-=-
Modified: gocept.selenium/branches/gotcha-generator/src/gocept/selenium/scripts/converthtmltests.py
===================================================================
--- gocept.selenium/branches/gotcha-generator/src/gocept/selenium/scripts/converthtmltests.py	2011-01-04 11:34:32 UTC (rev 119337)
+++ gocept.selenium/branches/gotcha-generator/src/gocept/selenium/scripts/converthtmltests.py	2011-01-04 11:40:48 UTC (rev 119338)
@@ -77,7 +77,9 @@
         parser.error('layer is required')
     if len(options.layer.split('.')) <= 1:
         parser.error('layer option should include the module')
-    directory = args[0]
+    directory = os.path.abspath(args[0])
+    if not os.path.exists(directory):
+        parser.error('directory [%s] does not exist')
     return options, directory
 
 
@@ -86,8 +88,9 @@
     tests = []
     pattern = os.path.join(directory, '*.html')
     for filename in glob.glob(pattern):
+        filename = os.path.abspath(filename)
         if options.verbose:
-            print "Parsing %s" % filename
+            print "Parsing [%s]" % filename
         tree = HTMLTreeBuilder.parse(filename)
         root = tree.getroot()
 
@@ -105,9 +108,10 @@
             commands='\n'.join(commands)))
         tests.append(method_body)
 
+    target = os.path.abspath(options.target)
     if options.verbose:
-        print "Generating %s" % options.target
-    f = open(options.target, 'wb')
+        print "Generating [%s]" % target
+    f = open(target, 'wb')
     layer = options.layer
     layer_module = ".".join(layer.split('.')[:-1])
     f.write(module_template.substitute(dict(



More information about the checkins mailing list