Revision: 2222
Author: pekka.klarck
Date: Sat Aug 15 15:35:54 2009
Log: handle / in paths in os neutral way (and fix a potential bug)
http://code.google.com/p/robotframework/source/detail?r=2222

Modified:
 /trunk/doc/userguide/ug2html.py

=======================================
--- /trunk/doc/userguide/ug2html.py     Sun Dec  7 15:13:26 2008
+++ /trunk/doc/userguide/ug2html.py     Sat Aug 15 15:35:54 2009
@@ -104,8 +104,10 @@
     formatter = options and VARIANTS[options.keys()[0]] or DEFAULT
     # possibility to read the content from an external file
     filtered = [ line for line in content if line.strip() ]
-    if len(filtered) == 1 and os.path.isfile(filtered[0]):
-        content = open(content[0]).read().splitlines()
+    if len(filtered) == 1:
+        path = filtered[0].replace('/', os.sep)
+        if os.path.isfile(path):
+            content = open(path).read().splitlines()
     parsed = highlight(u'\n'.join(content), lexer, formatter)
     return [nodes.raw('', parsed, format='html')]

Reply via email to