File: sqlobject-convertOldURI

package info (click to toggle)
sqlobject 3.1.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 9,280 kB
  • ctags: 17,912
  • sloc: python: 16,713; sh: 18; makefile: 13
file content (19 lines) | stat: -rwxr-xr-x 417 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
#!/usr/bin/env python
from __future__ import print_function

import sys

try:
    uri = sys.argv[1]
except IndexError:
    sys.exit("Usage: %s old-style-URI" % sys.argv[0])

try:
    import pkg_resources
    pkg_resources.require('SQLObject>=1.0.0')
except (ImportError, pkg_resources.DistributionNotFound):
    pass

from sqlobject import connectionForURI
conn = connectionForURI(uri, oldUri=True)
print(conn.uri())