mirror of
https://github.com/djohnlewis/stackdump
synced 2025-12-06 16:03:27 +00:00
Initial commit. Still building up the env and some parsing code.
This commit is contained in:
35
python/packages/EGG-INFO/scripts/sqlobject-admin
Executable file
35
python/packages/EGG-INFO/scripts/sqlobject-admin
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/python2.5
|
||||
import sys
|
||||
import os
|
||||
|
||||
try:
|
||||
import pkg_resources
|
||||
pkg_resources.require('SQLObject>0.6.1')
|
||||
except (ImportError, pkg_resources.DistributionNotFound):
|
||||
# Oh well, we tried...
|
||||
pass
|
||||
|
||||
try:
|
||||
import sqlobject.manager
|
||||
except ImportError:
|
||||
try:
|
||||
here = __file__
|
||||
except NameError:
|
||||
here = sys.argv[0]
|
||||
updir = os.path.join(
|
||||
os.path.dirname(os.path.dirname(os.path.abspath(here))),
|
||||
'sqlobject')
|
||||
if os.path.exists(updir):
|
||||
sys.path.insert(0, os.path.dirname(updir))
|
||||
else:
|
||||
print 'I cannot find the sqlobject module'
|
||||
print 'If SQLObject is installed, you may need to set $PYTHONPATH'
|
||||
sys.exit(3)
|
||||
# Now we have to get rid of possibly stale modules from that import
|
||||
# up there
|
||||
for name, value in sys.modules.items():
|
||||
if name.startswith('sqlobject'):
|
||||
del sys.modules[name]
|
||||
|
||||
from sqlobject.manager import command
|
||||
command.the_runner.run(sys.argv)
|
||||
Reference in New Issue
Block a user