|
a/Allura/allura/command/script.py |
|
b/Allura/allura/command/script.py |
|
... |
|
... |
4 |
import warnings
|
4 |
import warnings
|
5 |
|
5 |
|
6 |
from pylons import c
|
6 |
from pylons import c
|
7 |
import pylons
|
7 |
import pylons
|
8 |
import webob
|
8 |
import webob
|
9 |
from sqlalchemy import exc
|
|
|
10 |
|
9 |
|
11 |
from ming.orm import session
|
10 |
from ming.orm import session
|
12 |
from allura.lib import helpers as h
|
11 |
from allura.lib import helpers as h
|
13 |
from allura.lib import utils
|
12 |
from allura.lib import utils
|
14 |
from . import base
|
13 |
from . import base
|
|
... |
|
... |
24 |
parser.add_option('--pdb', action='store_true', dest='pdb',
|
23 |
parser.add_option('--pdb', action='store_true', dest='pdb',
|
25 |
help='Drop to a debugger on error')
|
24 |
help='Drop to a debugger on error')
|
26 |
|
25 |
|
27 |
def command(self):
|
26 |
def command(self):
|
28 |
with warnings.catch_warnings():
|
27 |
with warnings.catch_warnings():
|
|
|
28 |
try:
|
|
|
29 |
from sqlalchemy import exc
|
|
|
30 |
except ImportError:
|
|
|
31 |
pass
|
|
|
32 |
else:
|
29 |
warnings.simplefilter("ignore", category=exc.SAWarning)
|
33 |
warnings.simplefilter("ignore", category=exc.SAWarning)
|
30 |
self.basic_setup()
|
34 |
self.basic_setup()
|
31 |
request = webob.Request.blank('--script--', environ={
|
35 |
request = webob.Request.blank('--script--', environ={
|
32 |
'paste.registry':self.registry})
|
36 |
'paste.registry':self.registry})
|
33 |
self.registry.register(pylons.request, request)
|
37 |
self.registry.register(pylons.request, request)
|
34 |
if self.options.pdb:
|
38 |
if self.options.pdb:
|