diff options
| author | Zubin Mithra <zubin.mithra@gmail.com> | 2010-07-04 02:44:25 +0530 |
|---|---|---|
| committer | Zubin Mithra <zubin.mithra@gmail.com> | 2010-07-04 02:44:25 +0530 |
| commit | efc61559758a900d7c9a3a7ef7eae6ff26a8f705 (patch) | |
| tree | cf986f4dce74be6509ac0c9c2571775e41bc768c | |
| parent | f61fd745e1bd5a86c7ab2a7717fd1d9cc568c6bd (diff) | |
| download | disutils2-efc61559758a900d7c9a3a7ef7eae6ff26a8f705.tar.gz | |
[mq]: core.py, dist.py modified to include use_2to3, convert_2to3_doctests
| -rw-r--r-- | src/distutils2/core.py | 3 | ||||
| -rw-r--r-- | src/distutils2/dist.py | 22 |
2 files changed, 14 insertions, 11 deletions
diff --git a/src/distutils2/core.py b/src/distutils2/core.py index 7efa524..a81780b 100644 --- a/src/distutils2/core.py +++ b/src/distutils2/core.py @@ -49,7 +49,8 @@ setup_keywords = ('distclass', 'script_name', 'script_args', 'options', 'maintainer', 'maintainer_email', 'url', 'license', 'description', 'long_description', 'keywords', 'platforms', 'classifiers', 'download_url', - 'requires', 'provides', 'obsoletes', + 'requires', 'provides', 'obsoletes', 'use_2to3', + 'convert_2to3_doctests', ) # Legal keyword arguments for the Extension constructor diff --git a/src/distutils2/dist.py b/src/distutils2/dist.py index 16b1edc..cfeafe4 100644 --- a/src/distutils2/dist.py +++ b/src/distutils2/dist.py @@ -112,7 +112,11 @@ Common commands: (see '--help-commands' for more) ('requires', None, "print the list of packages/modules required"), ('obsoletes', None, - "print the list of packages/modules made obsolete") + "print the list of packages/modules made obsolete"), + ('use-2to3', None, + "use 2to3 to make source python 3.x compatible"), + ('convert-2to3-doctests', None, + "use 2to3 to convert doctests in seperate text files"), ] display_option_names = map(lambda x: translate_longopt(x[0]), display_options) @@ -206,6 +210,8 @@ Common commands: (see '--help-commands' for more) self.scripts = None self.data_files = None self.password = '' + self.use_2to3 = False + self.convert_2to3_doctests = [] # And now initialize bookkeeping stuff that can't be supplied by # the caller at all. 'command_obj' maps command names to @@ -581,15 +587,11 @@ Common commands: (see '--help-commands' for more) instance, analogous to the .finalize_options() method of Command objects. """ - - # XXX conversion -- removed - #for attr in ('keywords', 'platforms'): - # value = self.metadata.get_field(attr) - # if value is None: - # continue - # if isinstance(value, str): - # value = [elm.strip() for elm in value.split(',')] - # setattr(self.metadata, attr, value) + if getattr(self, 'convert_2to3_doctests', None): + self.convert_2to3_doctests = [os.path.join(p) + for p in self.convert_2to3_doctests] + else: + self.convert_2to3_doctests = [] def _show_help(self, parser, global_options=1, display_options=1, commands=[]): |
