diff roundup-admin @ 190:996eaf90c01e

Instance import now imports the instance using imp.load_module... ...so that we can have instance homes of "roundup" or other existing python package names.
author Richard Jones <richard@users.sourceforge.net>
date Fri, 03 Aug 2001 00:59:34 +0000
parents a49c8a2ddd26
children 241a0323aacb
line wrap: on
line diff
--- a/roundup-admin	Thu Aug 02 10:26:26 2001 +0000
+++ b/roundup-admin	Fri Aug 03 00:59:34 2001 +0000
@@ -1,12 +1,12 @@
 #! /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=''):
@@ -381,12 +381,7 @@
             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)
 
@@ -409,6 +404,9 @@
 
 #
 # $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
 #

Roundup Issue Tracker: http://roundup-tracker.org/