goa/goactl.py
changeset 3293 69c0ba095536
parent 2819 b864288fd316
parent 3273 ca78d07aaffe
child 4021 280c910c8710
equal deleted inserted replaced
3230:1d25e928c299 3293:69c0ba095536
     6 :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
     6 :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
     7 """
     7 """
     8 __docformat__ = "restructuredtext en"
     8 __docformat__ = "restructuredtext en"
     9 
     9 
    10 from os.path import exists, join, split, basename, normpath, abspath
    10 from os.path import exists, join, split, basename, normpath, abspath
    11 
       
    12 from logilab.common.clcommands import register_commands
    11 from logilab.common.clcommands import register_commands
    13 
    12 
    14 from cubicweb import CW_SOFTWARE_ROOT, BadCommandUsage
    13 from cubicweb import CW_SOFTWARE_ROOT, BadCommandUsage
    15 from cubicweb.toolsutils import (Command, copy_skeleton, create_symlink,
    14 from cubicweb.toolsutils import (Command, copy_skeleton, create_symlink,
    16                                  create_dir)
    15                                  create_dir)
    17 from cubicweb.cwconfig import CubicWebConfiguration
    16 from cubicweb.cwconfig import CubicWebConfiguration
    18 
    17 
    19 from logilab import common as lgc
    18 from logilab import common as lgc
    20 from logilab import constraint as lgcstr
    19 from logilab import constraint as lgcstr
    21 from logilab import mtconverter as lgmtc
    20 from logilab import mtconverter as lgmtc
    22 import rql, yams, yapps, simplejson, dateutil, vobject, docutils, roman
    21 import rql, yams, yapps, simplejson, docutils, roman
    23 
    22 
    24 SLINK_DIRECTORIES = (
    23 SLINK_DIRECTORIES = [
    25     (lgc.__path__[0], 'logilab/common'),
    24     (lgc.__path__[0], 'logilab/common'),
    26     (lgmtc.__path__[0], 'logilab/mtconverter'),
    25     (lgmtc.__path__[0], 'logilab/mtconverter'),
    27     (lgcstr.__path__[0], 'logilab/constraint'),
    26     (lgcstr.__path__[0], 'logilab/constraint'),
    28     (rql.__path__[0], 'rql'),
    27     (rql.__path__[0], 'rql'),
    29     (simplejson.__path__[0], 'simplejson'),
    28     (simplejson.__path__[0], 'simplejson'),
    30     (yams.__path__[0], 'yams'),
    29     (yams.__path__[0], 'yams'),
    31     (yapps.__path__[0], 'yapps'),
    30     (yapps.__path__[0], 'yapps'),
    32     (dateutil.__path__[0], 'dateutil'),
       
    33     (vobject.__path__[0], 'vobject'),
       
    34     (docutils.__path__[0], 'docutils'),
    31     (docutils.__path__[0], 'docutils'),
    35     (roman.__file__.replace('.pyc', '.py'), 'roman.py'),
    32     (roman.__file__.replace('.pyc', '.py'), 'roman.py'),
    36 
    33 
    37     (join(CW_SOFTWARE_ROOT, 'embedded', 'mx'), 'mx'),
    34     (join(CW_SOFTWARE_ROOT, 'embedded', 'mx'), 'mx'),
    38     ('/usr/share/fckeditor/', 'fckeditor'),
    35     ('/usr/share/fckeditor/', 'fckeditor'),
    40     (join(CW_SOFTWARE_ROOT, 'web', 'data'), join('cubes', 'shared', 'data')),
    37     (join(CW_SOFTWARE_ROOT, 'web', 'data'), join('cubes', 'shared', 'data')),
    41     (join(CW_SOFTWARE_ROOT, 'web', 'wdoc'), join('cubes', 'shared', 'wdoc')),
    38     (join(CW_SOFTWARE_ROOT, 'web', 'wdoc'), join('cubes', 'shared', 'wdoc')),
    42     (join(CW_SOFTWARE_ROOT, 'i18n'), join('cubes', 'shared', 'i18n')),
    39     (join(CW_SOFTWARE_ROOT, 'i18n'), join('cubes', 'shared', 'i18n')),
    43     (join(CW_SOFTWARE_ROOT, 'goa', 'tools'), 'tools'),
    40     (join(CW_SOFTWARE_ROOT, 'goa', 'tools'), 'tools'),
    44     (join(CW_SOFTWARE_ROOT, 'goa', 'bin'), 'bin'),
    41     (join(CW_SOFTWARE_ROOT, 'goa', 'bin'), 'bin'),
    45     )
    42     ]
       
    43 
       
    44 try:
       
    45     import dateutil
       
    46     import vobject
       
    47     SLINK_DIRECTORIES.extend([ (dateutil.__path__[0], 'dateutil'),
       
    48                                (vobject.__path__[0], 'vobject') ] )
       
    49 except ImportError:
       
    50     pass
    46 
    51 
    47 COPY_CW_FILES = (
    52 COPY_CW_FILES = (
    48     '__init__.py',
    53     '__init__.py',
    49     '__pkginfo__.py',
    54     '__pkginfo__.py',
    50     '_exceptions.py',
    55     '_exceptions.py',
    52     'dbapi.py',
    57     'dbapi.py',
    53     'cwvreg.py',
    58     'cwvreg.py',
    54     'cwconfig.py',
    59     'cwconfig.py',
    55     'entity.py',
    60     'entity.py',
    56     'interfaces.py',
    61     'interfaces.py',
       
    62     'rqlrewrite.py',
    57     'rset.py',
    63     'rset.py',
    58     'schema.py',
    64     'schema.py',
    59     'schemaviewer.py',
    65     'schemaviewer.py',
    60     'selectors.py',
    66     'selectors.py',
    61     'utils.py',
    67     'utils.py',
    76     'server/hooks.py',
    82     'server/hooks.py',
    77     'server/migractions.py',
    83     'server/migractions.py',
    78     'server/pool.py',
    84     'server/pool.py',
    79     'server/querier.py',
    85     'server/querier.py',
    80     'server/repository.py',
    86     'server/repository.py',
    81     'server/rqlrewrite.py',
       
    82     'server/securityhooks.py',
    87     'server/securityhooks.py',
    83     'server/session.py',
    88     'server/session.py',
    84     'server/serverconfig.py',
    89     'server/serverconfig.py',
    85     'server/ssplanner.py',
    90     'server/ssplanner.py',
    86     'server/utils.py',
    91     'server/utils.py',