summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f9c5451)
raw | patch | inline | side by side (parent: f9c5451)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 16 Aug 2002 04:25:03 +0000 (04:25 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 16 Aug 2002 04:25:03 +0000 (04:25 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@953 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/init.py | patch | blob | history | |
roundup/templatebuilder.py | [deleted file] | patch | blob | history |
roundup/templates/builder.py | [new file with mode: 0644] | patch | blob |
roundup/templates/cpp_template | [deleted file] | patch | blob | history |
roundup/templates/header_template | [deleted file] | patch | blob | history |
setup.py | patch | blob | history |
diff --git a/roundup/init.py b/roundup/init.py
index 9214fb614d9984c62bff26049993b85ea881e7e3..7723aba1088499ded89fef1d7c99ca8a4b4fe0c0 100644 (file)
--- a/roundup/init.py
+++ b/roundup/init.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: init.py,v 1.20 2002-07-14 02:05:53 richard Exp $
+# $Id: init.py,v 1.21 2002-08-16 04:25:03 richard Exp $
__doc__ = """
Init (create) a roundup instance.
the template.
'''
# first, copy the template dir over
- import roundup.templatebuilder
+ from roundup.templates import builder
template_dir = os.path.split(__file__)[0]
template_name = template
template = os.path.join(template_dir, 'templates', template)
copytree(template, instance_home)
- roundup.templatebuilder.installHtmlBase(template_name, instance_home)
+ builder.installHtmlBase(template_name, instance_home)
# now select database
db = '''# WARNING: DO NOT EDIT THIS FILE!!!
#
# $Log: not supported by cvs2svn $
+# Revision 1.20 2002/07/14 02:05:53 richard
+# . all storage-specific code (ie. backend) is now implemented by the backends
+#
# Revision 1.19 2002/05/23 01:14:20 richard
# . split instance initialisation into two steps, allowing config changes
# before the database is initialised.
diff --git a/roundup/templatebuilder.py b/roundup/templatebuilder.py
+++ /dev/null
@@ -1,119 +0,0 @@
-#
-# Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/)
-# This module is free software, and you may redistribute it and/or modify
-# under the same terms as Python, so long as this copyright message and
-# disclaimer are retained in their original form.
-#
-# IN NO EVENT SHALL BIZAR SOFTWARE PTY LTD BE LIABLE TO ANY PARTY FOR
-# DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
-# OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-# BIZAR SOFTWARE PTY LTD SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
-# BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-# FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
-# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
-# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-#
-# $Id: templatebuilder.py,v 1.14 2002-02-05 09:59:05 grubert Exp $
-import errno, re
-
-__doc__ = """
-Collect template parts and create instance template files.
-"""
-
-preamble = """
-# Do Not Edit (Unless You Want To)
-# This file automagically generated by roundup.templatebuilder.makeHtmlBase
-#
-"""
-
-def makeHtmlBase(templateDir):
- """ make a htmlbase.py file in the given templateDir, from the
- contents of templateDir/html """
- import os, glob, re
- print "packing up templates in", templateDir
- filelist = glob.glob(os.path.join(templateDir, 'html', '*'))
- filelist = filter(os.path.isfile, filelist) # only want files
- filelist.sort()
- fd = open(os.path.join(templateDir, 'htmlbase.py'), 'w')
- fd.write(preamble)
- for file in filelist:
- # skip the backup files created by richard's vim
- if file[-1] == '~': continue
- mangled_name = os.path.basename(file).replace('.','DOT')
- fd.write('%s = """'%mangled_name)
- fd.write(re.sub(r'\$((Id|File|Log).*?)\$', r'dollar\1dollar',
- open(file).read(), re.I))
- fd.write('"""\n\n')
- fd.close()
-
-def installHtmlBase(template, installDir):
- """ passed a template package and an installDir, unpacks the html files into
- the installdir """
- import os,sys,re
-
- tdir = __import__('roundup.templates.%s.htmlbase'%template).templates
- if hasattr(tdir, template):
- tmod = getattr(tdir, template)
- else:
- raise "TemplateError", "couldn't find roundup.template.%s.htmlbase"%template
- htmlbase = tmod.htmlbase
- installDir = os.path.join(installDir, 'html')
- try:
- os.makedirs(installDir)
- except OSError, 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 __name__ == "__main__":
- import sys
- if len(sys.argv) == 2:
- makeHtmlBase(sys.argv[1])
- elif len(sys.argv) == 3:
- installHtmlBase(sys.argv[1], sys.argv[2])
- else:
- print "Usage: %s <template directory>"%sys.argv[0]
-
-#
-# $Log: not supported by cvs2svn $
-# Revision 1.13 2001/11/22 15:46:42 jhermann
-# Added module docstrings to all modules.
-#
-# Revision 1.12 2001/11/14 21:35:21 richard
-# . users may attach files to issues (and support in ext) through the web now
-#
-# Revision 1.11 2001/08/07 00:24:42 richard
-# stupid typo
-#
-# Revision 1.10 2001/08/07 00:15:51 richard
-# Added the copyright/license notice to (nearly) all files at request of
-# Bizar Software.
-#
-# Revision 1.9 2001/08/01 05:06:10 richard
-# htmlbase doesn't have extraneous $Foo$ in it any more
-#
-# Revision 1.8 2001/07/30 08:12:17 richard
-# Added time logging and file uploading to the templates.
-#
-# Revision 1.7 2001/07/30 00:06:52 richard
-# Hrm - had IOError instead of OSError. Not sure why there's two. Ho hum.
-#
-# Revision 1.6 2001/07/29 07:01:39 richard
-# Added vim command to all source so that we don't get no steenkin' tabs :)
-#
-#
-#
-# vim: set filetype=python ts=4 sw=4 et si
diff --git a/roundup/templates/builder.py b/roundup/templates/builder.py
--- /dev/null
@@ -0,0 +1,122 @@
+#
+# Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/)
+# This module is free software, and you may redistribute it and/or modify
+# under the same terms as Python, so long as this copyright message and
+# disclaimer are retained in their original form.
+#
+# IN NO EVENT SHALL BIZAR SOFTWARE PTY LTD BE LIABLE TO ANY PARTY FOR
+# DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
+# OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+# BIZAR SOFTWARE PTY LTD SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
+# BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
+# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
+# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+#
+# $Id: builder.py,v 1.1 2002-08-16 04:25:03 richard Exp $
+import errno, re
+
+__doc__ = """
+Collect template parts and create instance template files.
+"""
+
+preamble = """
+# Do Not Edit (Unless You Want To)
+# This file automagically generated by roundup.templatebuilder.makeHtmlBase
+#
+"""
+
+def makeHtmlBase(templateDir):
+ """ make a htmlbase.py file in the given templateDir, from the
+ contents of templateDir/html """
+ import os, glob, re
+ print "packing up templates in", templateDir
+ filelist = glob.glob(os.path.join(templateDir, 'html', '*'))
+ filelist = filter(os.path.isfile, filelist) # only want files
+ filelist.sort()
+ fd = open(os.path.join(templateDir, 'htmlbase.py'), 'w')
+ fd.write(preamble)
+ for file in filelist:
+ # skip the backup files created by richard's vim
+ if file[-1] == '~': continue
+ mangled_name = os.path.basename(file).replace('.','DOT')
+ fd.write('%s = """'%mangled_name)
+ fd.write(re.sub(r'\$((Id|File|Log).*?)\$', r'dollar\1dollar',
+ open(file).read(), re.I))
+ fd.write('"""\n\n')
+ fd.close()
+
+def installHtmlBase(template, installDir):
+ """ passed a template package and an installDir, unpacks the html files into
+ the installdir """
+ import os,sys,re
+
+ tdir = __import__('roundup.templates.%s.htmlbase'%template).templates
+ if hasattr(tdir, template):
+ tmod = getattr(tdir, template)
+ else:
+ raise "TemplateError", "couldn't find roundup.template.%s.htmlbase"%template
+ htmlbase = tmod.htmlbase
+ installDir = os.path.join(installDir, 'html')
+ try:
+ os.makedirs(installDir)
+ except OSError, 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 __name__ == "__main__":
+ import sys
+ if len(sys.argv) == 2:
+ makeHtmlBase(sys.argv[1])
+ elif len(sys.argv) == 3:
+ installHtmlBase(sys.argv[1], sys.argv[2])
+ else:
+ print "Usage: %s <template directory>"%sys.argv[0]
+
+#
+# $Log: not supported by cvs2svn $
+# Revision 1.14 2002/02/05 09:59:05 grubert
+# . makeHtmlBase: re.sub under python 2.2 did not replace '.', string.replace does it.
+#
+# Revision 1.13 2001/11/22 15:46:42 jhermann
+# Added module docstrings to all modules.
+#
+# Revision 1.12 2001/11/14 21:35:21 richard
+# . users may attach files to issues (and support in ext) through the web now
+#
+# Revision 1.11 2001/08/07 00:24:42 richard
+# stupid typo
+#
+# Revision 1.10 2001/08/07 00:15:51 richard
+# Added the copyright/license notice to (nearly) all files at request of
+# Bizar Software.
+#
+# Revision 1.9 2001/08/01 05:06:10 richard
+# htmlbase doesn't have extraneous $Foo$ in it any more
+#
+# Revision 1.8 2001/07/30 08:12:17 richard
+# Added time logging and file uploading to the templates.
+#
+# Revision 1.7 2001/07/30 00:06:52 richard
+# Hrm - had IOError instead of OSError. Not sure why there's two. Ho hum.
+#
+# Revision 1.6 2001/07/29 07:01:39 richard
+# Added vim command to all source so that we don't get no steenkin' tabs :)
+#
+#
+#
+# vim: set filetype=python ts=4 sw=4 et si
diff --git a/roundup/templates/cpp_template b/roundup/templates/cpp_template
+++ /dev/null
@@ -1,16 +0,0 @@
-/***************************************************************************
- |FILENAME| - description
- -------------------
- begin : |DATE|
- copyright : (C) |YEAR| by |AUTHOR|
- email : |EMAIL|
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
diff --git a/roundup/templates/header_template b/roundup/templates/header_template
+++ /dev/null
@@ -1,16 +0,0 @@
-/***************************************************************************
- |FILENAME| - description
- -------------------
- begin : |DATE|
- copyright : (C) |YEAR| by |AUTHOR|
- email : |EMAIL|
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
diff --git a/setup.py b/setup.py
index e21a2ac4b939d2c78911723d7ceb465473125645..cf3e2e22a9afcc13502b3ec8cdbd11c5e4d6f877 100644 (file)
--- a/setup.py
+++ b/setup.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: setup.py,v 1.35 2002-06-17 23:14:44 richard Exp $
+# $Id: setup.py,v 1.36 2002-08-16 04:25:01 richard Exp $
from distutils.core import setup, Extension
from distutils.util import get_platform
import sys, os, string
from glob import glob
-from roundup.templatebuilder import makeHtmlBase
+from roundup.templates.builder import makeHtmlBase
#############################################################################
#
# $Log: not supported by cvs2svn $
+# Revision 1.35 2002/06/17 23:14:44 richard
+# . #569415 ] {version}
+#
# Revision 1.34 2002/05/29 01:16:16 richard
# Sorry about this huge checkin! It's fixing a lot of related stuff in one go
# though.