Warning:
Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.
Ticket #1382: setup_with_locale.patch
| File setup_with_locale.patch,
4.0 KB
(added by chrisz, 5 years ago) |
|
Adds locales directory to setup.py and improve get_package_name in util.py
|
-
|
|
|
|
| 4 | 4 | import os |
| 5 | 5 | execfile(os.path.join("${package}", "release.py")) |
| 6 | 6 | |
| | 7 | packages=find_packages() |
| | 8 | package_data = find_package_data(where='${package}', |
| | 9 | package='${package}') |
| | 10 | if os.path.isdir('locales'): |
| | 11 | packages.append('locales') |
| | 12 | package_data.update(find_package_data(where='locales', |
| | 13 | exclude=('*.po',), only_in_packages=False)) |
| | 14 | |
| 7 | 15 | setup( |
| 8 | 16 | name="${project}", |
| 9 | 17 | version=version, |
| 10 | | |
| | 18 | |
| 11 | 19 | # uncomment the following lines if you fill them out in release.py |
| 12 | 20 | #description=description, |
| 13 | 21 | #author=author, |
| … |
… |
|
| 15 | 23 | #url=url, |
| 16 | 24 | #download_url=download_url, |
| 17 | 25 | #license=license, |
| 18 | | |
| 19 | | install_requires = [ |
| | 26 | |
| | 27 | install_requires=[ |
| 20 | 28 | "TurboGears >= ${turbogearsversion}", |
| 21 | | #if $identity == "sqlalchemy" |
| 22 | | "SQLAlchemy", |
| 23 | | #end if |
| | 29 | #if $identity == "sqlalchemy" |
| | 30 | "SQLAlchemy", |
| | 31 | #end if |
| 24 | 32 | ], |
| 25 | | scripts = ["start-${package}.py"], |
| | 33 | scripts=["start-${package}.py"], |
| 26 | 34 | zip_safe=False, |
| 27 | | packages=find_packages(), |
| 28 | | package_data = find_package_data(where='${package}', |
| 29 | | package='${package}'), |
| 30 | | keywords = [ |
| | 35 | packages=packages, |
| | 36 | package_data=package_data, |
| | 37 | keywords=[ |
| 31 | 38 | # Use keywords if you'll be adding your package to the |
| 32 | 39 | # Python Cheeseshop |
| 33 | | |
| | 40 | |
| 34 | 41 | # if this has widgets, uncomment the next line |
| 35 | 42 | # 'turbogears.widgets', |
| 36 | | |
| | 43 | |
| 37 | 44 | # if this has a tg-admin command, uncomment the next line |
| 38 | 45 | # 'turbogears.command', |
| 39 | | |
| | 46 | |
| 40 | 47 | # if this has identity providers, uncomment the next line |
| 41 | 48 | # 'turbogears.identity.provider', |
| 42 | | |
| | 49 | |
| 43 | 50 | # If this is a template plugin, uncomment the next line |
| 44 | 51 | # 'python.templating.engines', |
| 45 | | |
| | 52 | |
| 46 | 53 | # If this is a full application, uncomment the next line |
| 47 | 54 | # 'turbogears.app', |
| 48 | 55 | ], |
| 49 | | classifiers = [ |
| | 56 | classifiers=[ |
| 50 | 57 | 'Development Status :: 3 - Alpha', |
| 51 | 58 | 'Operating System :: OS Independent', |
| 52 | 59 | 'Programming Language :: Python', |
| … |
… |
|
| 55 | 62 | # if this is an application that you'll distribute through |
| 56 | 63 | # the Cheeseshop, uncomment the next line |
| 57 | 64 | # 'Framework :: TurboGears :: Applications', |
| 58 | | |
| | 65 | |
| 59 | 66 | # if this is a package that includes widgets that you'll distribute |
| 60 | 67 | # through the Cheeseshop, uncomment the next line |
| 61 | 68 | # 'Framework :: TurboGears :: Widgets', |
| 62 | 69 | ], |
| 63 | | test_suite = 'nose.collector', |
| | 70 | test_suite='nose.collector', |
| 64 | 71 | ) |
| 65 | | |
| | 72 | |
-
|
|
|
|
| 101 | 101 | if "--egg" in sys.argv: |
| 102 | 102 | projectname = sys.argv[sys.argv.index("--egg")+1] |
| 103 | 103 | egg = pkg_resources.get_distribution(projectname) |
| 104 | | package = list(egg._get_metadata("top_level.txt"))[0] |
| 105 | | return package |
| 106 | | fname = get_project_meta('top_level.txt') |
| 107 | | if fname: |
| 108 | | return open(fname).readline()[:-1] |
| | 104 | top_level = egg._get_metadata("top_level.txt") |
| | 105 | else: |
| | 106 | fname = get_project_meta('top_level.txt') |
| | 107 | top_level = fname and open(fname) or [] |
| | 108 | for package in top_level: |
| | 109 | package = package.rstrip() |
| | 110 | if package and package != 'locales': |
| | 111 | return package |
| 109 | 112 | |
| 110 | 113 | def get_project_name(): |
| 111 | 114 | pkg_info = get_project_meta('PKG-INFO') |
| … |
… |
|
| 426 | 429 | "arg_index", "inject_arg", "inject_args", "bind_args", |
| 427 | 430 | "recursive_update", "combine_contexts", "request_available", |
| 428 | 431 | "flatten_sequence", "load_class", "Bunch", |
| 429 | | "parse_http_accept_header", |
| | 432 | "parse_http_accept_header", |
| 430 | 433 | "to_unicode", "to_utf8", "get_template_encoding_default", |
| 431 | 434 | "find_precision", "copy_if_mutable"] |
Download in other formats: