cwctl.py
changeset 10321 a4af502191d5
parent 10235 684215aca046
child 10474 1dcc52f5e340
equal deleted inserted replaced
10320:facbb38c4c1a 10321:a4af502191d5
    23 
    23 
    24 # *ctl module should limit the number of import to be imported as quickly as
    24 # *ctl module should limit the number of import to be imported as quickly as
    25 # possible (for cubicweb-ctl reactivity, necessary for instance for usable bash
    25 # possible (for cubicweb-ctl reactivity, necessary for instance for usable bash
    26 # completion). So import locally in command helpers.
    26 # completion). So import locally in command helpers.
    27 import sys
    27 import sys
    28 from warnings import warn
    28 from warnings import warn, filterwarnings
    29 from os import remove, listdir, system, pathsep
    29 from os import remove, listdir, system, pathsep
    30 from os.path import exists, join, isfile, isdir, dirname, abspath
    30 from os.path import exists, join, isfile, isdir, dirname, abspath
    31 from urlparse import urlparse
    31 from urlparse import urlparse
    32 
    32 
    33 try:
    33 try:
  1131 def run(args):
  1131 def run(args):
  1132     """command line tool"""
  1132     """command line tool"""
  1133     import os
  1133     import os
  1134     sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
  1134     sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
  1135     sys.stderr = os.fdopen(sys.stderr.fileno(), 'w', 0)
  1135     sys.stderr = os.fdopen(sys.stderr.fileno(), 'w', 0)
       
  1136     filterwarnings('default', category=DeprecationWarning)
  1136     cwcfg.load_cwctl_plugins()
  1137     cwcfg.load_cwctl_plugins()
  1137     try:
  1138     try:
  1138         CWCTL.run(args)
  1139         CWCTL.run(args)
  1139     except ConfigurationError as err:
  1140     except ConfigurationError as err:
  1140         print 'ERROR: ', err
  1141         print 'ERROR: ', err