-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathsqlobject-admin
More file actions
executable file
·36 lines (33 loc) · 1017 Bytes
/
sqlobject-admin
File metadata and controls
executable file
·36 lines (33 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env python
from __future__ import print_function
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)