summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fe7446c)
raw | patch | inline | side by side (parent: fe7446c)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 3 Aug 2001 00:59:34 +0000 (00:59 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 3 Aug 2001 00:59:34 +0000 (00:59 +0000) |
we can have instance homes of "roundup" or other existing python package
names.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@196 57a73879-2fb5-44c3-a270-3262357dd7e2
names.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@196 57a73879-2fb5-44c3-a270-3262357dd7e2
cgi-bin/roundup.cgi | patch | blob | history | |
roundup-admin | patch | blob | history | |
roundup-mailgw | patch | blob | history | |
roundup-server | patch | blob | history | |
roundup/init.py | patch | blob | history |
diff --git a/cgi-bin/roundup.cgi b/cgi-bin/roundup.cgi
index e55dfbcd44143ce0e645e13d08f950dd5144c816..c1c0c0d86c026c696cf870cfaa16f0d732cc1ec0 100755 (executable)
--- a/cgi-bin/roundup.cgi
+++ b/cgi-bin/roundup.cgi
#!/usr/bin/env python
-# $Id: roundup.cgi,v 1.5 2001-07-29 07:01:39 richard Exp $
+# $Id: roundup.cgi,v 1.6 2001-08-03 00:59:34 richard Exp $
# python version check
import sys
out, err = sys.stdout, sys.stderr
try:
sys.stdout = sys.stderr = LOG
- import os, string
+ import os, string, imp
path = string.split(os.environ['PATH_INFO'], '/')
instance = path[1]
os.environ['PATH_INFO'] = string.join(path[2:], '/')
if ROUNDUP_INSTANCE_HOMES.has_key(instance):
instance_home = ROUNDUP_INSTANCE_HOMES[instance]
- module_path, instance = os.path.split(instance_home)
- sys.path.insert(0, module_path)
- try:
- instance = __import__(instance)
- finally:
- del sys.path[0]
+ instance = imp.load_module('instance', None, instance_home,
+ ('', '', 5))
else:
raise ValueError, 'No such instance "%s"'%instance
main(instance, out)
#
# $Log: not supported by cvs2svn $
+# Revision 1.5 2001/07/29 07:01:39 richard
+# Added vim command to all source so that we don't get no steenkin' tabs :)
+#
# Revision 1.4 2001/07/23 04:47:27 anthonybaxter
# renamed ROUNDUPS to ROUNDUP_INSTANCE_HOMES
# sys.exit(0) if python version wrong.
diff --git a/roundup-admin b/roundup-admin
index 9a39bc66c7f75f77c86b390b347e12a67ba77277..fbf6cac5fef12ca7e245256ea22333473e19fce2 100755 (executable)
--- a/roundup-admin
+++ b/roundup-admin
#! /usr/bin/python
-# $Id: roundup-admin,v 1.10 2001-07-30 08:12:17 richard Exp $
+# $Id: roundup-admin,v 1.11 2001-08-03 00:59:34 richard Exp $
import sys
if int(sys.version[0]) < 2:
print 'Roundup requires python 2.0 or later.'
sys.exit(1)
-import string, os, getpass, getopt, re
+import string, os, getpass, getopt, re, imp
from roundup import date, roundupdb, init
def usage(message=''):
password = getpass.getpass(' password: ')
# get the instance
- path, instance = os.path.split(instance_home)
- sys.path.insert(0, path)
- try:
- instance = __import__(instance)
- finally:
- del sys.path[0]
+ instance = imp.load_module('instance', None, instance_home, ('', '', 5))
function = figureCommands().get(command, None)
#
# $Log: not supported by cvs2svn $
+# Revision 1.10 2001/07/30 08:12:17 richard
+# Added time logging and file uploading to the templates.
+#
# Revision 1.9 2001/07/30 03:52:55 richard
# init help now lists templates and backends
#
diff --git a/roundup-mailgw b/roundup-mailgw
index 639dfe545300b4bb24c056824eb0c0d8069e91b7..94a1d38ca7d36690fa984815e1b8ea9a5a44646f 100755 (executable)
--- a/roundup-mailgw
+++ b/roundup-mailgw
#! /usr/bin/python
-# $Id: roundup-mailgw,v 1.2 2001-07-29 07:01:39 richard Exp $
+# $Id: roundup-mailgw,v 1.3 2001-08-03 00:59:34 richard Exp $
import sys
if int(sys.version[0]) < 2:
sys.exit(1)
# get the instance
-path, instance = os.path.split(instance_home)
-sys.path.insert(0, path)
-instance = __import__(instance)
-sys.path[0]
+import imp
+instance = imp.load_module('instance', None, instance_home, ('', '', 5))
# invokde the mail handler
db = instance.open('admin')
#
# $Log: not supported by cvs2svn $
+# Revision 1.2 2001/07/29 07:01:39 richard
+# Added vim command to all source so that we don't get no steenkin' tabs :)
+#
# Revision 1.1 2001/07/23 03:46:48 richard
# moving the bin files to facilitate out-of-the-boxness
#
diff --git a/roundup-server b/roundup-server
index 9bebf8e5aaa1a62d7ca08f695cf17d9cb2d4d757..52f977f4a4bb331b7a3f6358880f95bb21fc601c 100755 (executable)
--- a/roundup-server
+++ b/roundup-server
Stolen from CGIHTTPServer
-$Id: roundup-server,v 1.6 2001-07-29 07:01:39 richard Exp $
+$Id: roundup-server,v 1.7 2001-08-03 00:59:34 richard Exp $
"""
import sys
__all__ = ["RoundupRequestHandler"]
-import os, urllib, StringIO, traceback, cgi, binascii, string, getopt
+import os, urllib, StringIO, traceback, cgi, binascii, string, getopt, imp
import BaseHTTPServer
import SimpleHTTPServer
instance = urllib.unquote(l_path[1])
if self.ROUNDUP_INSTANCE_HOMES.has_key(instance):
instance_home = self.ROUNDUP_INSTANCE_HOMES[instance]
- module_path, instance = os.path.split(instance_home)
- sys.path.insert(0, module_path)
- try:
- instance = __import__(instance)
- finally:
- del sys.path[0]
+ instance = imp.load_module('instance', None, instance_home,
+ ('', '', 5))
else:
raise ValueError, 'No such instance "%s"'%instance
#
# $Log: not supported by cvs2svn $
+# 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 :)
+#
# Revision 1.5 2001/07/24 01:07:59 richard
# Added command-line arg handling to roundup-server so it's more useful
# out-of-the-box.
diff --git a/roundup/init.py b/roundup/init.py
index b2300c8bb68a5c9c3f403bbbb00c243407e5cc0d..11b69baad8ec6295b1ce7ecfdfda428dd039c17d 100644 (file)
--- a/roundup/init.py
+++ b/roundup/init.py
-# $Id: init.py,v 1.8 2001-07-29 07:01:39 richard Exp $
+# $Id: init.py,v 1.9 2001-08-03 00:59:34 richard Exp $
-import os, shutil, sys, errno
+import os, shutil, sys, errno, imp
def copytree(src, dst, symlinks=0):
"""Recursively copy a directory tree using copy2().
else:
shutil.copy2(srcname, dstname)
-def init(instance, template, backend, adminpw):
+def init(instance_home, template, backend, adminpw):
''' initialise an instance using the named template
'''
# first, copy the template dir over
template_dir = os.path.split(__file__)[0]
template_name = template
template = os.path.join(template_dir, 'templates', template)
- copytree(template, instance)
+ copytree(template, instance_home)
- roundup.templatebuilder.installHtmlBase(template_name, instance)
+ roundup.templatebuilder.installHtmlBase(template_name, instance_home)
# now select database
db = '''# WARNING: DO NOT EDIT THIS FILE!!!
from roundup.backends.back_%s import Database'''%backend
- open(os.path.join(instance, 'select_db.py'), 'w').write(db)
+ open(os.path.join(instance_home, 'select_db.py'), 'w').write(db)
# now import the instance and call its init
- path, instance = os.path.split(instance)
- sys.path.insert(0, path)
- instance = __import__(instance)
+ instance = imp.load_module('instance', None, instance_home, ('', '', 5))
instance.init(adminpw)
#
# $Log: not supported by cvs2svn $
+# Revision 1.8 2001/07/29 07:01:39 richard
+# Added vim command to all source so that we don't get no steenkin' tabs :)
+#
# Revision 1.7 2001/07/28 07:59:53 richard
# Replaced errno integers with their module values.
# De-tabbed templatebuilder.py