Changeset 4272

Show
Ignore:
Timestamp:
03/04/09 23:20:04 (4 years ago)
Author:
gpolo
Message:

Moved common paths between the installers to install_scripts/common.py

Location:
trunk
Files:
1 added
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/install_scripts/macosx/py2app_setup.py

    r4271 r4272  
    2424from setuptools import setup 
    2525 
    26 BIN_DIRNAME = 'bin' 
     26from install_scripts.common import BIN_DIRNAME 
    2727 
    2828py2app_options = dict( 
  • trunk/install_scripts/windows/py2exe_setup.py

    r4271 r4272  
    2626from py2exe.build_exe import py2exe as build_exe 
    2727 
    28 BIN_DIRNAME = 'bin' 
     28from install_scripts.common import BIN_DIRNAME, ICONS_DIR 
    2929 
    3030# Add the bin dir to the sys.path so we can indicate that the umit_scheduler 
     
    6767        windows = [{ 
    6868            "script": os.path.join(BIN_DIRNAME, "umit"), 
    69             "icon_resources": [(1, os.path.join(icons_dir, "umit_48.ico"))] 
     69            "icon_resources": [(1, os.path.join(ICONS_DIR, "umit_48.ico"))] 
    7070            }], 
    7171        options = {"py2exe": { 
  • trunk/setup.py

    r4271 r4272  
    3434from umit.core.Version import VERSION 
    3535from utils import msgfmt 
     36 
     37from install_scripts.common import BIN_DIRNAME, PIXMAPS_DIR, ICONS_DIR, \ 
     38        DOCS_DIR, LOCALE_DIR, CONFIG_DIR, MISC_DIR, SQL_DIR 
    3639 
    3740py2exe_cmdclass = py2exe_options = py2app_options = None 
     
    4245    from install_scripts.macosx.py2app_setup import py2app_options 
    4346 
    44  
    45 BIN_DIRNAME = 'bin' 
    46  
    47 # Directories for POSIX operating systems 
    48 # These are created after a "install" or "py2exe" command 
    49 # These directories are relative to the installation or dist directory 
    50 # Ex: python setup.py install --prefix=/tmp/umit 
    51 # Will create the directory /tmp/umit with the following directories 
    52 pixmaps_dir = os.path.join('share', 'pixmaps', 'umit') 
    53 icons_dir = os.path.join('share', 'icons', 'umit') 
    54 locale_dir = os.path.join('share', 'locale') 
    55 config_dir = os.path.join('share', 'umit', 'config') 
    56 docs_dir = os.path.join('share', 'doc', 'umit') 
    57 misc_dir = os.path.join('share', 'umit', 'misc') 
    58 sql_dir = os.path.join('share', 'umit', 'sql') 
    5947 
    6048def extension_find(result, dirname, fnames, suffix): 
     
    8876svg = glob(os.path.join('share', 'pixmaps', '*.svg')) 
    8977data_files = [ 
    90         (pixmaps_dir, 
    91             glob(os.path.join(pixmaps_dir, '*.svg')) + 
    92             glob(os.path.join(pixmaps_dir, '*.png')) + 
    93             glob(os.path.join(pixmaps_dir, '*.xpm')) + 
    94             glob(os.path.join(pixmaps_dir, 'umit.o*'))), 
    95  
    96         (config_dir, 
    97             [os.path.join(config_dir, 'umit.conf')] + 
    98             [os.path.join(config_dir, 'scan_profile.usp')] + 
    99             [os.path.join(config_dir, 'umit_version')] + 
    100             [os.path.join(config_dir, 'umitng.db')] + 
    101             [os.path.join(config_dir, 'timeline-settings.conf')] + 
    102             [os.path.join(config_dir, 'tl_colors_evt_std.conf')] + 
    103             [os.path.join(config_dir, 'scheduler-schemas.conf')] + 
    104             [os.path.join(config_dir, 'scheduler-profiles.conf')] + 
    105             [os.path.join(config_dir, 'scheduler.log')] + 
    106             [os.path.join(config_dir, 'smtp-schemas.conf')] + 
    107             glob(os.path.join(config_dir, '*.xml'))+ 
    108             glob(os.path.join(config_dir, '*.txt'))), 
     78        (PIXMAPS_DIR, 
     79            glob(os.path.join(PIXMAPS_DIR, '*.svg')) + 
     80            glob(os.path.join(PIXMAPS_DIR, '*.png')) + 
     81            glob(os.path.join(PIXMAPS_DIR, '*.xpm')) + 
     82            glob(os.path.join(PIXMAPS_DIR, 'umit.o*'))), 
     83 
     84        (CONFIG_DIR, 
     85            [os.path.join(CONFIG_DIR, 'umit.conf')] + 
     86            [os.path.join(CONFIG_DIR, 'scan_profile.usp')] + 
     87            [os.path.join(CONFIG_DIR, 'umit_version')] + 
     88            [os.path.join(CONFIG_DIR, 'umitng.db')] + 
     89            [os.path.join(CONFIG_DIR, 'timeline-settings.conf')] + 
     90            [os.path.join(CONFIG_DIR, 'tl_colors_evt_std.conf')] + 
     91            [os.path.join(CONFIG_DIR, 'scheduler-schemas.conf')] + 
     92            [os.path.join(CONFIG_DIR, 'scheduler-profiles.conf')] + 
     93            [os.path.join(CONFIG_DIR, 'scheduler.log')] + 
     94            [os.path.join(CONFIG_DIR, 'smtp-schemas.conf')] + 
     95            glob(os.path.join(CONFIG_DIR, '*.xml'))+ 
     96            glob(os.path.join(CONFIG_DIR, '*.txt'))), 
    10997 
    11098        # umit.db SQL 
    111         (sql_dir, glob(os.path.join(sql_dir, '*.sql'))), 
    112  
    113         (misc_dir, glob(os.path.join(misc_dir, '*.dmp'))), 
     99        (SQL_DIR, glob(os.path.join(SQL_DIR, '*.sql'))), 
     100 
     101        (MISC_DIR, glob(os.path.join(MISC_DIR, '*.dmp'))), 
    114102 
    115103        # Radialnet 
    116         (os.path.join(pixmaps_dir, 'radialnet', 'application'), 
    117             glob(os.path.join(pixmaps_dir, 'radialnet', 'application', 
     104        (os.path.join(PIXMAPS_DIR, 'radialnet', 'application'), 
     105            glob(os.path.join(PIXMAPS_DIR, 'radialnet', 'application', 
    118106                '*.png'))), 
    119         (os.path.join(pixmaps_dir, 'radialnet', 'icons'), 
    120             glob(os.path.join(pixmaps_dir, 'radialnet', 'icons','*.png'))), 
     107        (os.path.join(PIXMAPS_DIR, 'radialnet', 'icons'), 
     108            glob(os.path.join(PIXMAPS_DIR, 'radialnet', 'icons','*.png'))), 
    121109 
    122110        # Network Inventory 
    123         (os.path.join(pixmaps_dir, 'networkinventory'), 
    124             glob(os.path.join(pixmaps_dir, 'networkinventory', '*.png'))), 
     111        (os.path.join(PIXMAPS_DIR, 'networkinventory'), 
     112            glob(os.path.join(PIXMAPS_DIR, 'networkinventory', '*.png'))), 
    125113 
    126114        # InterfaceEditor 
    127         (os.path.join(pixmaps_dir, 'uie'), 
    128             glob(os.path.join(pixmaps_dir, 'uie', '*.png'))), 
    129  
    130         (icons_dir, 
     115        (os.path.join(PIXMAPS_DIR, 'uie'), 
     116            glob(os.path.join(PIXMAPS_DIR, 'uie', '*.png'))), 
     117 
     118        (ICONS_DIR, 
    131119            glob(os.path.join('share', 'icons', 'umit', '*.ico')) + 
    132120            glob(os.path.join('share', 'icons', 'umit', '*.png'))), 
    133121 
    134         (docs_dir, 
    135             glob(os.path.join(docs_dir, '*.html')) + 
    136             glob(os.path.join(docs_dir, 'comparing_results', '*.xml')) + 
    137             glob(os.path.join(docs_dir, 'profile_editor', '*.xml')) + 
    138             glob(os.path.join(docs_dir, 'scanning', '*.xml')) + 
    139             glob(os.path.join(docs_dir, 'searching', '*.xml')) + 
    140             glob(os.path.join(docs_dir, 'wizard', '*.xml')) + 
    141             glob(os.path.join(docs_dir, 'scheduler', '*.xml')) + 
    142             glob(os.path.join(docs_dir, 'smtpsetup', '*.xml')) + 
    143             glob(os.path.join(docs_dir, 'screenshots', '*.png')))] 
     122        (DOCS_DIR, 
     123            glob(os.path.join(DOCS_DIR, '*.html')) + 
     124            glob(os.path.join(DOCS_DIR, 'comparing_results', '*.xml')) + 
     125            glob(os.path.join(DOCS_DIR, 'profile_editor', '*.xml')) + 
     126            glob(os.path.join(DOCS_DIR, 'scanning', '*.xml')) + 
     127            glob(os.path.join(DOCS_DIR, 'searching', '*.xml')) + 
     128            glob(os.path.join(DOCS_DIR, 'wizard', '*.xml')) + 
     129            glob(os.path.join(DOCS_DIR, 'scheduler', '*.xml')) + 
     130            glob(os.path.join(DOCS_DIR, 'smtpsetup', '*.xml')) + 
     131            glob(os.path.join(DOCS_DIR, 'screenshots', '*.png')))] 
    144132 
    145133# Add i18n files to data_files list 
    146 os.path.walk(locale_dir, mo_find, data_files) 
     134os.path.walk(LOCALE_DIR, mo_find, data_files) 
    147135 
    148136 
     
    155143        """ Remove *.mo files """ 
    156144        tmp = [] 
    157         os.path.walk(locale_dir, mo_find, tmp) 
     145        os.path.walk(LOCALE_DIR, mo_find, tmp) 
    158146        for (path, t) in tmp: 
    159147            os.remove(t[0]) 
     
    162150        """Build mo files from po and put it into LC_MESSAGES """ 
    163151        tmp = [] 
    164         os.path.walk(locale_dir, po_find, tmp) 
     152        os.path.walk(LOCALE_DIR, po_find, tmp) 
    165153        for (path, t) in tmp: 
    166154            full_path = os.path.join(path , "LC_MESSAGES", "umit.mo") 
     
    169157            msgfmt.make(t[0], full_path, False) 
    170158        # like guess 
    171         os.path.walk(locale_dir, mo_find, data_files) 
     159        os.path.walk(LOCALE_DIR, mo_find, data_files) 
    172160 
    173161    def run(self): 
     
    181169    def run(self): 
    182170        # Add i18n files to data_files list 
    183         os.path.walk(locale_dir, mo_find, data_files) 
     171        os.path.walk(LOCALE_DIR, mo_find, data_files) 
    184172        install.run(self) 
    185173 
     
    267255 
    268256    def fix_paths(self): 
    269         interesting_paths = {"CONFIG_DIR":config_dir, 
    270                              "DOCS_DIR":docs_dir, 
    271                              "LOCALE_DIR":locale_dir, 
    272                              "MISC_DIR":misc_dir, 
    273                              "PIXMAPS_DIR":pixmaps_dir, 
    274                              "ICONS_DIR":icons_dir} 
     257        interesting_paths = {"CONFIG_DIR": CONFIG_DIR, 
     258                             "DOCS_DIR": DOCS_DIR, 
     259                             "LOCALE_DIR": LOCALE_DIR, 
     260                             "MISC_DIR": MISC_DIR, 
     261                             "PIXMAPS_DIR": PIXMAPS_DIR, 
     262                             "ICONS_DIR": ICONS_DIR} 
    275263 
    276264        pcontent = ""