~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Jonathan Riddell
  • Date: 2011-08-24 11:44:21 UTC
  • mto: This revision was merged to the branch mainline in revision 6103.
  • Revision ID: jriddell@canonical.com-20110824114421-qegz6nomsgnwkxj0
install .mo translation files

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
    lang = filepath[len("bzrlib/locale/"):]
 
79
    targetpath = os.path.dirname(os.path.join("share/locale",lang))
 
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"""
505
509
    # python's distutils-based win32 installer
506
510
    ARGS = {'scripts': ['bzr', 'tools/win32/bzr-win32-bdist-postinstall.py'],
507
511
            'ext_modules': ext_modules,
508
 
            # help pages
509
 
            'data_files': find_docs(),
 
512
            # help pages and translations
 
513
            'data_files': find_docs() + I18N_FILES,
510
514
            # for building pyrex extensions
511
515
            'cmdclass': command_classes,
512
516
           }
518
522
    setup(**ARGS)
519
523
 
520
524
elif 'py2exe' in sys.argv:
521
 
    import glob
522
525
    # py2exe setup
523
526
    import py2exe
524
527
 
668
671
                       'tools/win32/bzr_postinstall.py',
669
672
                       ]
670
673
    gui_targets = [gui_target]
671
 
    data_files = topics_files + plugins_files
 
674
    data_files = topics_files + plugins_files + I18N_FILES
672
675
 
673
676
    if 'qbzr' in plugins:
674
677
        get_qbzr_py2exe_info(includes, excludes, packages, data_files)
752
755
        # easy_install one
753
756
        DATA_FILES = [('man/man1', ['bzr.1'])]
754
757
 
 
758
    DATA_FILES = DATA_FILES + I18N_FILES
755
759
    # std setup
756
760
    ARGS = {'scripts': ['bzr'],
757
761
            'data_files': DATA_FILES,