~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Jonathan Riddell
  • Date: 2011-09-16 11:13:47 UTC
  • mto: This revision was merged to the branch mainline in revision 6144.
  • Revision ID: jriddell@canonical.com-20110916111347-fyjk426bkl0jrbfu
gettext() show_warning usage

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"""
198
202
    from distutils.command.build_ext import build_ext
199
203
else:
200
204
    have_pyrex = True
201
 
    pyrex_version_info = tuple(map(int, pyrex_version.split('.')))
 
205
    import re
 
206
    _version = re.match("^[0-9.]+", pyrex_version).group(0)
 
207
    pyrex_version_info = tuple(map(int, _version.split('.')))
202
208
 
203
209
 
204
210
class build_ext_if_possible(build_ext):
513
519
 
514
520
    ARGS.update(META_INFO)
515
521
    ARGS.update(BZRLIB)
 
522
    PKG_DATA['package_data']['bzrlib'].append('locale/*/LC_MESSAGES/*.mo')
516
523
    ARGS.update(PKG_DATA)
517
524
 
518
525
    setup(**ARGS)
519
526
 
520
527
elif 'py2exe' in sys.argv:
521
 
    import glob
522
528
    # py2exe setup
523
529
    import py2exe
524
530
 
668
674
                       'tools/win32/bzr_postinstall.py',
669
675
                       ]
670
676
    gui_targets = [gui_target]
671
 
    data_files = topics_files + plugins_files
 
677
    data_files = topics_files + plugins_files + I18N_FILES
672
678
 
673
679
    if 'qbzr' in plugins:
674
680
        get_qbzr_py2exe_info(includes, excludes, packages, data_files)
752
758
        # easy_install one
753
759
        DATA_FILES = [('man/man1', ['bzr.1'])]
754
760
 
 
761
    DATA_FILES = DATA_FILES + I18N_FILES
755
762
    # std setup
756
763
    ARGS = {'scripts': ['bzr'],
757
764
            'data_files': DATA_FILES,