summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 32f6c3d)
raw | patch | inline | side by side (parent: 32f6c3d)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sat, 28 Jul 2001 07:59:53 +0000 (07:59 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sat, 28 Jul 2001 07:59:53 +0000 (07:59 +0000) |
De-tabbed templatebuilder.py
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@119 57a73879-2fb5-44c3-a270-3262357dd7e2
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@119 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/htmltemplate.py | patch | blob | history | |
roundup/init.py | patch | blob | history | |
roundup/templatebuilder.py | patch | blob | history |
index cdbdc3fb7d4993af0e8b686e60a7ff5607b4cfb3..4f819a33f0785972b0e61914db0a8d69dbc233b7 100644 (file)
--- a/roundup/htmltemplate.py
+++ b/roundup/htmltemplate.py
-# $Id: htmltemplate.py,v 1.3 2001-07-25 03:39:47 richard Exp $
+# $Id: htmltemplate.py,v 1.4 2001-07-28 07:59:53 richard Exp $
-import os, re, StringIO, urllib, cgi
+import os, re, StringIO, urllib, cgi, errno
import hyperdb, date
template = open(os.path.join(templates, classname+'.filter')).read()
all_filters = col_re.findall(template)
except IOError, error:
- if error.errno != 2: raise
+ if error.errno != errno.ENOENT: raise
template = None
all_filters = []
if template and filter:
#
# $Log: not supported by cvs2svn $
+# Revision 1.3 2001/07/25 03:39:47 richard
+# Hrm - displaying links to classes that don't specify a key property. I've
+# got it defaulting to 'name', then 'title' and then a "random" property (first
+# one returned by getprops().keys().
+# Needs to be moved onto the Class I think...
+#
# Revision 1.2 2001/07/22 12:09:32 richard
# Final commit of Grande Splite
#
diff --git a/roundup/init.py b/roundup/init.py
index 946d93c5b83f2257b79e5add85c7c6cddf290a4a..2667cd9ecc3d2ef9d089f1344b923cdf72d0eedb 100644 (file)
--- a/roundup/init.py
+++ b/roundup/init.py
-# $Id: init.py,v 1.6 2001-07-24 11:18:25 anthonybaxter Exp $
+# $Id: init.py,v 1.7 2001-07-28 07:59:53 richard Exp $
-import os, shutil, sys
+import os, shutil, sys, errno
def copytree(src, dst, symlinks=0):
"""Recursively copy a directory tree using copy2().
try:
os.mkdir(dst)
except OSError, error:
- if error.errno != 17: raise
+ if error.errno != errno.EEXIST: raise
for name in names:
srcname = os.path.join(src, name)
dstname = os.path.join(dst, name)
#
# $Log: not supported by cvs2svn $
+# Revision 1.6 2001/07/24 11:18:25 anthonybaxter
+# oops. left a print in
+#
# Revision 1.5 2001/07/24 10:54:11 anthonybaxter
# oops. Html.
#
index 9f96673b9cf0367acefe3fcf7ef3ab32815a4cbf..4dedd14903fb661e6f64c5ac1516c32f25d6d7e5 100644 (file)
+import errno
+
preamble = """
# Do Not Edit (Unless You Want To)
# This file automagically generated by roundup.htmldata.makeHtmlBase
fd = open(os.path.join(templateDir, 'htmlbase.py'), 'w')
fd.write(preamble)
for file in filelist:
- mangled_name = os.path.basename(re.sub(r'\.', 'DOT', file))
- fd.write('%s = """'%mangled_name)
- fd.write(open(file).read())
- fd.write('"""\n\n')
+ mangled_name = os.path.basename(re.sub(r'\.', 'DOT', file))
+ fd.write('%s = """'%mangled_name)
+ fd.write(open(file).read())
+ fd.write('"""\n\n')
fd.close()
def installHtmlBase(template, installDir):
tdir = __import__('roundup.templates.%s.htmlbase'%template).templates
if hasattr(tdir, template):
- tmod = getattr(tdir, template)
+ tmod = getattr(tdir, template)
else:
- raise "TemplateError", \
- "couldn't find roundup.template.%s.htmlbase"%template
+ raise "TemplateError", "couldn't find roundup.template.%s.htmlbase"%template
htmlbase = tmod.htmlbase
installDir = os.path.join(installDir, 'html')
- os.makedirs(installDir)
+ try:
+ os.makedirs(installDir)
+ except IOError, error:
+ if error.errno != errno.EEXIST: raise
print "installing from", htmlbase.__file__, "into", installDir
modulecontents = dir(htmlbase)
for mangledfile in modulecontents:
- if mangledfile[0] == "_":
- continue
- filename = re.sub('DOT', '.', mangledfile)
- outfile = os.path.join(installDir, filename)
- outfd = open(outfile, 'w')
- data = getattr(htmlbase, mangledfile)
- outfd.write(data)
+ if mangledfile[0] == "_":
+ continue
+ filename = re.sub('DOT', '.', mangledfile)
+ outfile = os.path.join(installDir, filename)
+ outfd = open(outfile, 'w')
+ data = getattr(htmlbase, mangledfile)
+ outfd.write(data)
if __name__ == "__main__":
import sys
if len(sys.argv) == 2:
- makeHtmlBase(sys.argv[1])
+ makeHtmlBase(sys.argv[1])
elif len(sys.argv) == 3:
- installHtmlBase(sys.argv[1], sys.argv[2])
+ installHtmlBase(sys.argv[1], sys.argv[2])
else:
- raise "what you talkin about willis?"
+ raise "what you talkin about willis?"
+