Author: ianb
Date: 2005-05-04 22:05:31 +0000 (Wed, 04 May 2005)
New Revision: 765
Modified:
trunk/SQLObject/sqlobject/manager/command.py
Log:
Since config file can have sys_path, load it up more aggressively; also use default config
Modified: trunk/SQLObject/sqlobject/manager/command.py
===================================================================
--- trunk/SQLObject/sqlobject/manager/command.py 2005-05-04 02:50:08 UTC (rev 764)
+++ trunk/SQLObject/sqlobject/manager/command.py 2005-05-04 22:05:31 UTC (rev 765)
@@ -5,6 +5,7 @@
import sys
try:
from paste import pyconfig
+ from paste import CONFIG
except ImportError:
pyconfig = None
@@ -69,11 +70,11 @@
help="The database connection URI",
metavar='URI',
dest='connection_uri')
- if pyconfig:
- parser.add_option('-f', '--config-file',
- help="The Paste config file that contains the database URI (in the database key)",
- metavar="FILE",
- dest="config_file")
+ if pyconfig:
+ parser.add_option('-f', '--config-file',
+ help="The Paste config file that contains the database URI (in the database key)",
+ metavar="FILE",
+ dest="config_file")
if find_modules:
parser.add_option('-m', '--module',
help="Module in which to find SQLObject classes",
@@ -221,8 +222,9 @@
if getattr(self.options, 'config_file', None):
assert pyconfig, (
"The --config-file option should not be available without paste.pyconfig installed")
- config = pyconfig.Config()
+ config = pyconfig.Config(with_default=True)
config.load(self.options.config_file)
+ CONFIG.push_process_config(config)
return config
else:
return None
|