/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-08-26 00:50:59 UTC
  • mfrom: (6093.3.4 i18n-install)
  • Revision ID: pqm@pqm.ubuntu.com-20110826005059-8nw3lheuht9xt8z7
(jr) Install translation .mo files
 (Jonathan Riddell)

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
import os.path
11
11
import sys
12
12
import copy
 
13
import glob
13
14
 
14
15
if sys.version_info < (2, 6):
15
16
    sys.stderr.write("[ERROR] Not a supported Python version. Need 2.6+\n")
70
71
                                        'tests/ssl_certs/server_without_pass.key',
71
72
                                        'tests/ssl_certs/server_with_pass.key',
72
73
                                        'tests/ssl_certs/server.crt',
73
 
                                        'locale/*/LC_MESSAGES/*.mo',
74
74
                                       ]},
75
75
           }
76
 
 
 
76
I18N_FILES = []
 
77
for filepath in glob.glob("bzrlib/locale/*/LC_MESSAGES/*.mo"):
 
78
    langfile = filepath[len("bzrlib/locale/"):]
 
79
    targetpath = os.path.dirname(os.path.join("share/locale", langfile))
 
80
    I18N_FILES.append((targetpath, [filepath]))
77
81
 
78
82
def get_bzrlib_packages():
79
83
    """Recurse through the bzrlib directory, and extract the package names"""
513
517
 
514
518
    ARGS.update(META_INFO)
515
519
    ARGS.update(BZRLIB)
 
520
    PKG_DATA['package_data']['bzrlib'].append('locale/*/LC_MESSAGES/*.mo')
516
521
    ARGS.update(PKG_DATA)
517
522
 
518
523
    setup(**ARGS)
519
524
 
520
525
elif 'py2exe' in sys.argv:
521
 
    import glob
522
526
    # py2exe setup
523
527
    import py2exe
524
528
 
668
672
                       'tools/win32/bzr_postinstall.py',
669
673
                       ]
670
674
    gui_targets = [gui_target]
671
 
    data_files = topics_files + plugins_files
 
675
    data_files = topics_files + plugins_files + I18N_FILES
672
676
 
673
677
    if 'qbzr' in plugins:
674
678
        get_qbzr_py2exe_info(includes, excludes, packages, data_files)
752
756
        # easy_install one
753
757
        DATA_FILES = [('man/man1', ['bzr.1'])]
754
758
 
 
759
    DATA_FILES = DATA_FILES + I18N_FILES
755
760
    # std setup
756
761
    ARGS = {'scripts': ['bzr'],
757
762
            'data_files': DATA_FILES,