[Checkins] SVN: grok/trunk/doc/grok2html.py Fixed handling of
relative paths and directory creation.
Uli Fouquet
uli at gnufix.de
Wed Jul 18 22:41:07 EDT 2007
Log message for revision 78131:
Fixed handling of relative paths and directory creation.
Changed:
U grok/trunk/doc/grok2html.py
-=-
Modified: grok/trunk/doc/grok2html.py
===================================================================
--- grok/trunk/doc/grok2html.py 2007-07-18 21:57:33 UTC (rev 78130)
+++ grok/trunk/doc/grok2html.py 2007-07-19 02:41:05 UTC (rev 78131)
@@ -69,6 +69,10 @@
settings["context"] = Context(self.url, self.title, self.content)
content = page.pt_render(namespace=settings)
#fp = open(self.target, 'w')
+ targetdir = os.path.dirname(self.target)
+ if not os.path.isdir(targetdir):
+ print 'Creating dir: ', targetdir
+ os.mkdir(targetdir)
fp = codecs.open(self.target,"w",'utf8')
fp.write(content)
fp.close()
@@ -122,8 +126,13 @@
sys.exit(1)
source_dir = os.path.dirname(__file__)
+ www_dir = os.path.abspath(argv[0])
+
+ if not os.path.isdir(www_dir):
+ print "OUTDIR '%s' does not exist." % (www_dir,)
+ sys.exit(1)
+
os.chdir(source_dir)
- www_dir = argv[0]
rest_files = []
rest_files.append(RestFile('index',
More information about the Checkins
mailing list