cubicweb/__pkginfo__.py
changeset 12295 e08d8e171238
parent 12294 038ff1a7259f
parent 12292 f7067be5f69c
child 12327 58f05ffafeca
equal deleted inserted replaced
12294:038ff1a7259f 12295:e08d8e171238
    17 # You should have received a copy of the GNU Lesser General Public License along
    17 # You should have received a copy of the GNU Lesser General Public License along
    18 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    18 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    19 """cubicweb global packaging information for the cubicweb knowledge management
    19 """cubicweb global packaging information for the cubicweb knowledge management
    20 software
    20 software
    21 """
    21 """
    22 import sys
       
    23 from os import listdir
       
    24 from os.path import join, isdir
       
    25 import glob
       
    26 
       
    27 
    22 
    28 modname = distname = "cubicweb"
    23 modname = distname = "cubicweb"
    29 
    24 
    30 numversion = (3, 27, 0)
    25 numversion = (3, 27, 0)
    31 version = '.'.join(str(num) for num in numversion) + '.dev0'
    26 version = '.'.join(str(num) for num in numversion) + '.dev0'
    41     'Framework :: CubicWeb',
    36     'Framework :: CubicWeb',
    42     'Programming Language :: Python',
    37     'Programming Language :: Python',
    43     'Programming Language :: JavaScript',
    38     'Programming Language :: JavaScript',
    44 ]
    39 ]
    45 
    40 
    46 _server_migration_dir = join(modname, 'misc', 'migration')
       
    47 _data_dir = join(modname, 'web', 'data')
       
    48 _wdoc_dir = join(modname, 'web', 'wdoc')
       
    49 _wdocimages_dir = join(_wdoc_dir, 'images')
       
    50 _views_dir = join(modname, 'web', 'views')
       
    51 _i18n_dir = join(modname, 'i18n')
       
    52 
       
    53 _pyversion = '.'.join(str(num) for num in sys.version_info[0:2])
       
    54 if '--home' in sys.argv:
       
    55     # --home install
       
    56     pydir = 'python' + _pyversion
       
    57 else:
       
    58     pydir = join('python' + _pyversion, 'site-packages')
       
    59 
       
    60 # data files that shall be copied into the main package directory
    41 # data files that shall be copied into the main package directory
    61 package_data = {
    42 package_data = {
    62     'cubicweb.web.views': ['*.pt'],
    43     'cubicweb.web.views': ['*.pt'],
    63     'cubicweb.pyramid': ['development.ini.tmpl'],
    44     'cubicweb.pyramid': ['development.ini.tmpl'],
    64 }
    45 }
    65 
       
    66 try:
       
    67     # data files that shall be copied outside the main package directory
       
    68     data_files = [
       
    69         # server data
       
    70         [join('share', 'cubicweb', 'migration'),
       
    71          [join(_server_migration_dir, filename)
       
    72           for filename in listdir(_server_migration_dir)]],
       
    73         # web data
       
    74         [join('share', 'cubicweb', 'cubes', 'shared', 'data'),
       
    75          [join(_data_dir, fname) for fname in listdir(_data_dir)
       
    76           if not isdir(join(_data_dir, fname))]],
       
    77         [join('share', 'cubicweb', 'cubes', 'shared', 'data', 'images'),
       
    78          [join(_data_dir, 'images', fname) for fname in listdir(join(_data_dir, 'images'))]],
       
    79         [join('share', 'cubicweb', 'cubes', 'shared', 'data', 'jquery-treeview'),
       
    80          [join(_data_dir, 'jquery-treeview', fname) for fname in listdir(join(_data_dir, 'jquery-treeview'))
       
    81           if not isdir(join(_data_dir, 'jquery-treeview', fname))]],
       
    82         [join('share', 'cubicweb', 'cubes', 'shared', 'data', 'jquery-treeview', 'images'),
       
    83          [join(_data_dir, 'jquery-treeview', 'images', fname)
       
    84           for fname in listdir(join(_data_dir, 'jquery-treeview', 'images'))]],
       
    85         [join('share', 'cubicweb', 'cubes', 'shared', 'wdoc'),
       
    86          [join(_wdoc_dir, fname) for fname in listdir(_wdoc_dir)
       
    87           if not isdir(join(_wdoc_dir, fname))]],
       
    88         [join('share', 'cubicweb', 'cubes', 'shared', 'wdoc', 'images'),
       
    89          [join(_wdocimages_dir, fname) for fname in listdir(_wdocimages_dir)]],
       
    90         [join('share', 'cubicweb', 'cubes', 'shared', 'i18n'),
       
    91          glob.glob(join(_i18n_dir, '*.po'))],
       
    92         # skeleton
       
    93         ]
       
    94 except OSError:
       
    95     # we are in an installed directory, don't care about this
       
    96     pass