File: sqlobject-admin

package info (click to toggle)
sqlobject 3.10.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,660 kB
  • sloc: python: 17,348; makefile: 162; sh: 95
file content (36 lines) | stat: -rwxr-xr-x 1,017 bytes parent folder | download | duplicates (5)
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)