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', |