Hello community, here is the log from the commit of package python-cliff for openSUSE:Factory checked in at 2013-04-26 07:43:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-cliff (Old) and /work/SRC/openSUSE:Factory/.python-cliff.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-cliff", Maintainer is "[email protected]" Changes: -------- --- /work/SRC/openSUSE:Factory/python-cliff/python-cliff.changes 2013-03-21 22:11:39.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python-cliff.new/python-cliff.changes 2013-04-26 07:43:42.000000000 +0200 @@ -1,0 +2,17 @@ +Thu Apr 25 09:06:44 UTC 2013 - [email protected] + +- update to 1.3.2: + - Add ``convert_underscores`` parameter to ``CommandManager`` ``__init__`` + method to allow underscores to be used in command names. This optional + argument is defaulted to True to maintain current behavior. + (contributed by Joe Server) + - Use flake8_ for style checking. + - Relax version requirement for PrettyTable dependency to allow + point releases of 0.7. + +------------------------------------------------------------------- +Wed Apr 24 15:04:28 UTC 2013 - [email protected] + +- buildrequire the right mock version + +------------------------------------------------------------------- Old: ---- cliff-1.3.1.tar.gz prettytable-0.7x.diff New: ---- cliff-1.3.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-cliff.spec ++++++ --- /var/tmp/diff_new_pack.ZQwQMi/_old 2013-04-26 07:43:50.000000000 +0200 +++ /var/tmp/diff_new_pack.ZQwQMi/_new 2013-04-26 07:43:50.000000000 +0200 @@ -17,14 +17,13 @@ Name: python-cliff -Version: 1.3.1 +Version: 1.3.2 Release: 0 Url: https://github.com/dreamhost/cliff Summary: Command Line Interface Formulation Framework License: Apache-2.0 Group: Development/Languages/Python Source: http://pypi.python.org/packages/source/c/cliff/cliff-%{version}.tar.gz -Patch0: prettytable-0.7x.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: python-argparse BuildRequires: python-devel @@ -33,7 +32,7 @@ # Test requirements: BuildRequires: python-cmd2 BuildRequires: python-coverage -BuildRequires: python-mock +BuildRequires: python-mock >= 1.0.1 BuildRequires: python-nose BuildRequires: python-pep8 BuildRequires: python-prettytable @@ -65,7 +64,6 @@ %prep %setup -q -n cliff-%{version} -%patch0 %build python setup.py build ++++++ cliff-1.3.1.tar.gz -> cliff-1.3.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-1.3.1/PKG-INFO new/cliff-1.3.2/PKG-INFO --- old/cliff-1.3.1/PKG-INFO 2013-02-27 13:53:05.000000000 +0100 +++ new/cliff-1.3.2/PKG-INFO 2013-04-02 21:57:22.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: cliff -Version: 1.3.1 +Version: 1.3.2 Summary: Command Line Interface Formulation Framework Home-page: https://github.com/dreamhost/cliff Author: Doug Hellmann diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-1.3.1/announce.rst new/cliff-1.3.2/announce.rst --- old/cliff-1.3.1/announce.rst 2013-02-27 13:45:44.000000000 +0100 +++ new/cliff-1.3.2/announce.rst 2013-04-02 21:55:37.000000000 +0200 @@ -1,5 +1,5 @@ ======================================================================== - cliff -- Command Line Interface Formulation Framework -- version 1.3.1 + cliff -- Command Line Interface Formulation Framework -- version 1.3.2 ======================================================================== .. tags:: python cliff release DreamHost @@ -11,11 +11,15 @@ What's New In This Release? =========================== -- Sort list of commands in interactive help mode. (contributed by Ilya - Shakhat) -- Fix a dependency issue with PyParsing until the cmd2 package can - release an update setting the version of its dependency based on the - Python version. +- Add ``convert_underscores`` parameter to ``CommandManager`` + ``__init__`` method to allow underscores to be used in command + names. This optional argument is defaulted to True to maintain + current behavior. (contributed by Joe Server) +- Use flake8_ for style checking. +- Relax version requirement for PrettyTable dependency to allow point + releases of 0.7. + +.. _flake8: https://pypi.python.org/pypi/flake8 Documentation ============= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-1.3.1/cliff/app.py new/cliff-1.3.2/cliff/app.py --- old/cliff-1.3.1/cliff/app.py 2012-10-21 21:45:28.000000000 +0200 +++ new/cliff-1.3.2/cliff/app.py 2013-03-16 18:57:02.000000000 +0100 @@ -94,45 +94,45 @@ description=description, add_help=False, **argparse_kwargs - ) + ) parser.add_argument( '--version', action='version', version='%(prog)s {0}'.format(version), - ) + ) parser.add_argument( '-v', '--verbose', action='count', dest='verbose_level', default=self.DEFAULT_VERBOSE_LEVEL, help='Increase verbosity of output. Can be repeated.', - ) + ) parser.add_argument( '--log-file', action='store', default=None, help='Specify a file to log output. Disabled by default.', - ) + ) parser.add_argument( '-q', '--quiet', action='store_const', dest='verbose_level', const=0, help='suppress output except warnings and errors', - ) + ) parser.add_argument( '-h', '--help', action=HelpAction, nargs=0, default=self, # tricky help="show this help message and exit", - ) + ) parser.add_argument( '--debug', default=False, action='store_true', help='show tracebacks on errors', - ) + ) return parser def configure_logging(self): @@ -145,7 +145,7 @@ if self.options.log_file: file_handler = logging.FileHandler( filename=self.options.log_file, - ) + ) formatter = logging.Formatter(self.LOG_FILE_MESSAGE_FORMAT) file_handler.setFormatter(formatter) root_logger.addHandler(file_handler) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-1.3.1/cliff/command.py new/cliff-1.3.2/cliff/command.py --- old/cliff-1.3.1/cliff/command.py 2012-06-20 23:21:53.000000000 +0200 +++ new/cliff-1.3.2/cliff/command.py 2013-03-16 18:57:13.000000000 +0100 @@ -28,7 +28,7 @@ parser = argparse.ArgumentParser( description=self.get_description(), prog=prog_name, - ) + ) return parser @abc.abstractmethod diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-1.3.1/cliff/commandmanager.py new/cliff-1.3.2/cliff/commandmanager.py --- old/cliff-1.3.1/cliff/commandmanager.py 2012-04-29 01:38:25.000000000 +0200 +++ new/cliff-1.3.2/cliff/commandmanager.py 2013-03-16 18:57:34.000000000 +0100 @@ -27,16 +27,22 @@ :param namespace: String containing the setuptools entrypoint namespace for the plugins to be loaded. For example, ``'cliff.formatter.list'``. + :param convert_underscores: Whether cliff should convert underscores to + to spaces in entry_point commands. """ - def __init__(self, namespace): + def __init__(self, namespace, convert_underscores=True): self.commands = {} self.namespace = namespace + self.convert_underscores = convert_underscores self._load_commands() def _load_commands(self): for ep in pkg_resources.iter_entry_points(self.namespace): LOG.debug('found command %r', ep.name) - self.commands[ep.name.replace('_', ' ')] = ep + cmd_name = (ep.name.replace('_', ' ') + if self.convert_underscores + else ep.name) + self.commands[cmd_name] = ep return def __iter__(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-1.3.1/cliff/display.py new/cliff-1.3.2/cliff/display.py --- old/cliff-1.3.1/cliff/display.py 2012-06-20 22:48:27.000000000 +0200 +++ new/cliff-1.3.2/cliff/display.py 2013-03-16 18:58:00.000000000 +0100 @@ -44,7 +44,7 @@ formatter_group = parser.add_argument_group( title='output formatters', description='output formatter options', - ) + ) formatter_choices = sorted(self.formatters.keys()) formatter_default = self.formatter_default if formatter_default not in formatter_choices: @@ -56,7 +56,7 @@ choices=formatter_choices, default=formatter_default, help='the output format, defaults to %s' % formatter_default, - ) + ) formatter_group.add_argument( '-c', '--column', action='append', @@ -64,7 +64,7 @@ dest='columns', metavar='COLUMN', help='specify the column(s) to include, can be repeated', - ) + ) for name, formatter in sorted(self.formatters.items()): formatter.add_argument_group(parser) return parser diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-1.3.1/cliff/formatters/commaseparated.py new/cliff-1.3.2/cliff/formatters/commaseparated.py --- old/cliff-1.3.1/cliff/formatters/commaseparated.py 2012-08-05 00:00:38.000000000 +0200 +++ new/cliff-1.3.2/cliff/formatters/commaseparated.py 2013-03-16 18:58:56.000000000 +0100 @@ -13,7 +13,7 @@ 'minimal': csv.QUOTE_MINIMAL, 'nonnumeric': csv.QUOTE_NONNUMERIC, 'none': csv.QUOTE_NONE, - } + } def add_argument_group(self, parser): group = parser.add_argument_group('CSV Formatter') @@ -23,7 +23,7 @@ dest='quote_mode', default='nonnumeric', help='when to include quotes, defaults to nonnumeric', - ) + ) def emit_list(self, column_names, data, stdout, parsed_args): writer = csv.writer(stdout, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-1.3.1/cliff/formatters/shell.py new/cliff-1.3.2/cliff/formatters/shell.py --- old/cliff-1.3.1/cliff/formatters/shell.py 2012-06-20 22:48:27.000000000 +0200 +++ new/cliff-1.3.2/cliff/formatters/shell.py 2013-03-16 18:59:05.000000000 +0100 @@ -10,7 +10,7 @@ group = parser.add_argument_group( title='shell formatter', description='a format a UNIX shell can parse (variable="value")', - ) + ) group.add_argument( '--variable', action='append', @@ -18,14 +18,14 @@ dest='variables', metavar='VARIABLE', help='specify the variable(s) to include, can be repeated', - ) + ) group.add_argument( '--prefix', action='store', default='', dest='prefix', help='add a prefix to all variable names', - ) + ) def emit_one(self, column_names, data, stdout, parsed_args): variable_names = [c.lower().replace(' ', '_') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-1.3.1/cliff/formatters/table.py new/cliff-1.3.2/cliff/formatters/table.py --- old/cliff-1.3.1/cliff/formatters/table.py 2012-05-07 03:51:38.000000000 +0200 +++ new/cliff-1.3.2/cliff/formatters/table.py 2013-03-16 18:59:43.000000000 +0100 @@ -12,7 +12,7 @@ int: 'r', str: 'l', float: 'r', - } + } try: ALIGNMENTS[unicode] = 'l' except NameError: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-1.3.1/cliff/help.py new/cliff-1.3.2/cliff/help.py --- old/cliff-1.3.1/cliff/help.py 2012-08-31 13:25:33.000000000 +0200 +++ new/cliff-1.3.2/cliff/help.py 2013-03-16 18:58:07.000000000 +0100 @@ -49,7 +49,7 @@ try: the_cmd = self.app.command_manager.find_command( parsed_args.cmd, - ) + ) cmd_factory, cmd_name, search_args = the_cmd except ValueError: # Did not find an exact match diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-1.3.1/cliff/interactive.py new/cliff-1.3.2/cliff/interactive.py --- old/cliff-1.3.1/cliff/interactive.py 2012-11-09 16:52:31.000000000 +0100 +++ new/cliff-1.3.2/cliff/interactive.py 2013-03-16 18:58:44.000000000 +0100 @@ -72,8 +72,8 @@ ['do'], itertools.takewhile(lambda x: not x.startswith('-'), arg_parts) - ) ) + ) # Have the command manager version of the help # command produce the help text since cmd and # cmd2 do not provide help for "help" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-1.3.1/cliff.egg-info/PKG-INFO new/cliff-1.3.2/cliff.egg-info/PKG-INFO --- old/cliff-1.3.1/cliff.egg-info/PKG-INFO 2013-02-27 13:53:02.000000000 +0100 +++ new/cliff-1.3.2/cliff.egg-info/PKG-INFO 2013-04-02 21:57:22.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: cliff -Version: 1.3.1 +Version: 1.3.2 Summary: Command Line Interface Formulation Framework Home-page: https://github.com/dreamhost/cliff Author: Doug Hellmann diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-1.3.1/cliff.egg-info/requires.txt new/cliff-1.3.2/cliff.egg-info/requires.txt --- old/cliff-1.3.1/cliff.egg-info/requires.txt 2013-02-27 13:53:02.000000000 +0100 +++ new/cliff-1.3.2/cliff.egg-info/requires.txt 2013-04-02 21:57:22.000000000 +0200 @@ -1,4 +1,4 @@ distribute -PrettyTable>=0.6,<0.7 +PrettyTable>=0.6,<0.8 cmd2==0.6.4 pyparsing==1.5.7 \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-1.3.1/docs/source/conf.py new/cliff-1.3.2/docs/source/conf.py --- old/cliff-1.3.1/docs/source/conf.py 2012-08-01 19:14:14.000000000 +0200 +++ new/cliff-1.3.2/docs/source/conf.py 2013-03-16 19:03:13.000000000 +0100 @@ -3,7 +3,8 @@ # cliff documentation build configuration file, created by # sphinx-quickstart on Wed Apr 25 11:14:29 2012. # -# This file is execfile()d with the current directory set to its containing dir. +# This file is execfile()d with the current directory set to its +# containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. @@ -11,20 +12,22 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys, os +import datetime +import subprocess # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) -# -- General configuration ----------------------------------------------------- +# -- General configuration --------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' -# Add any Sphinx extension module names here, as strings. They can be extensions -# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo'] # Add any paths that contain templates here, relative to this directory. @@ -41,14 +44,18 @@ # General information about the project. project = u'cliff' -copyright = u'2012, Doug Hellmann' +copyright = u'2012-%s, Doug Hellmann' % datetime.datetime.today().year # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = '1.1' +version = subprocess.check_output([ + 'sh', '-c', + 'cd ../..; python setup.py --version', +]) +version = version.strip() # The full version, including alpha/beta/rc tags. release = version @@ -66,7 +73,8 @@ # directories to ignore when looking for source files. exclude_patterns = [] -# The reST default role (used for this markup: `text`) to use for all documents. +# The reST default role (used for this markup: `text`) to use for all +# documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. @@ -87,7 +95,7 @@ #modindex_common_prefix = [] -# -- Options for HTML output --------------------------------------------------- +# -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. @@ -167,24 +175,25 @@ htmlhelp_basename = 'cliffdoc' -# -- Options for LaTeX output -------------------------------------------------- +# -- Options for LaTeX output ------------------------------------------------ latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -#'papersize': 'letterpaper', + # The paper size ('letterpaper' or 'a4paper'). + #'papersize': 'letterpaper', -# The font size ('10pt', '11pt' or '12pt'). -#'pointsize': '10pt', + # The font size ('10pt', '11pt' or '12pt'). + #'pointsize': '10pt', -# Additional stuff for the LaTeX preamble. -#'preamble': '', + # Additional stuff for the LaTeX preamble. + #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, documentclass [howto/manual]). +# (source start file, target name, title, author, +# documentclass [howto/manual]). latex_documents = [ - ('index', 'cliff.tex', u'cliff Documentation', - u'Doug Hellmann', 'manual'), + ('index', 'cliff.tex', u'cliff Documentation', + u'Doug Hellmann', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -208,7 +217,7 @@ #latex_domain_indices = True -# -- Options for manual page output -------------------------------------------- +# -- Options for manual page output ------------------------------------------ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). @@ -221,15 +230,15 @@ #man_show_urls = False -# -- Options for Texinfo output ------------------------------------------------ +# -- Options for Texinfo output ---------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'cliff', u'cliff Documentation', - u'Doug Hellmann', 'cliff', 'One line description of project.', - 'Miscellaneous'), + ('index', 'cliff', u'cliff Documentation', + u'Doug Hellmann', 'cliff', 'One line description of project.', + 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-1.3.1/docs/source/history.rst new/cliff-1.3.2/docs/source/history.rst --- old/cliff-1.3.1/docs/source/history.rst 2013-02-27 13:47:20.000000000 +0100 +++ new/cliff-1.3.2/docs/source/history.rst 2013-04-02 21:55:06.000000000 +0200 @@ -2,6 +2,18 @@ Release History ================= +1.3.2 + + - Add ``convert_underscores`` parameter to ``CommandManager`` ``__init__`` + method to allow underscores to be used in command names. This optional + argument is defaulted to True to maintain current behavior. + (contributed by Joe Server) + - Use flake8_ for style checking. + - Relax version requirement for PrettyTable dependency to allow + point releases of 0.7. + +.. _flake8: https://pypi.python.org/pypi/flake8 + 1.3.1 - Sort list of commands in interactive help mode. (contributed by diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-1.3.1/setup.py new/cliff-1.3.2/setup.py --- old/cliff-1.3.1/setup.py 2013-02-27 13:47:14.000000000 +0100 +++ new/cliff-1.3.2/setup.py 2013-04-02 21:48:35.000000000 +0200 @@ -3,7 +3,7 @@ PROJECT = 'cliff' # Change docs/source/conf.py too! -VERSION = '1.3.1' +VERSION = '1.3.2' # Bootstrap installation of Distribute import distribute_setup @@ -23,7 +23,7 @@ install_requires = [ 'distribute', - 'PrettyTable>=0.6,<0.7', + 'PrettyTable>=0.6,<0.8', 'cmd2==0.6.4', ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-1.3.1/tests/test_app.py new/cliff-1.3.2/tests/test_app.py --- old/cliff-1.3.1/tests/test_app.py 2012-09-12 20:51:52.000000000 +0200 +++ new/cliff-1.3.2/tests/test_app.py 2013-03-16 21:35:54.000000000 +0100 @@ -20,7 +20,9 @@ # Register a command that fails err_command = mock.Mock(name='err_command', spec=Command) err_command_inst = mock.Mock(spec=Command) - err_command_inst.run = mock.Mock(side_effect=RuntimeError('test exception')) + err_command_inst.run = mock.Mock( + side_effect=RuntimeError('test exception') + ) err_command.return_value = err_command_inst cmd_mgr.add_command('error', err_command) @@ -41,7 +43,9 @@ def test_interactive_mode_cmdloop(): app, command = make_app() - app.interactive_app_factory = mock.MagicMock(name='interactive_app_factory') + app.interactive_app_factory = mock.MagicMock( + name='interactive_app_factory' + ) app.run([]) app.interactive_app_factory.return_value.cmdloop.assert_called_once_with() @@ -106,7 +110,7 @@ app.clean_up = mock.MagicMock( name='clean_up', side_effect=RuntimeError('within clean_up'), - ) + ) app.run(['error']) app.clean_up.assert_called_once() @@ -123,7 +127,7 @@ app.clean_up = mock.MagicMock( name='clean_up', side_effect=RuntimeError('within clean_up'), - ) + ) try: app.run(['--debug', 'error']) except RuntimeError as err: @@ -150,7 +154,7 @@ app.clean_up = mock.MagicMock( name='clean_up', side_effect=RuntimeError('within clean_up'), - ) + ) app.run(['mock']) app.clean_up.assert_called_once() @@ -164,13 +168,14 @@ app.clean_up = mock.MagicMock( name='clean_up', side_effect=RuntimeError('within clean_up'), - ) + ) app.run(['--debug', 'mock']) app.clean_up.assert_called_once() call_args = app.clean_up.call_args_list[0] assert call_args == mock.call(mock.ANY, 0, None) + def test_build_option_parser_conflicting_option_should_throw(): class MyApp(App): def __init__(self): @@ -182,12 +187,12 @@ def build_option_parser(self, description, version): parser = super(MyApp, self).build_option_parser(description, - version) + version) parser.add_argument( '-h', '--help', default=self, # tricky help="show this help message and exit", - ) + ) # TODO: tests should really use unittest2. try: @@ -197,7 +202,8 @@ else: raise Exception('Exception was not thrown') -def test_build_option_parser_conflicting_option_custom_arguments_should_not_throw(): + +def test_option_parser_conflicting_option_custom_arguments_should_not_throw(): class MyApp(App): def __init__(self): super(MyApp, self).__init__( @@ -208,13 +214,14 @@ def build_option_parser(self, description, version): argparse_kwargs = {'conflict_handler': 'resolve'} - parser = super(MyApp, self).build_option_parser(description, - version, - argparse_kwargs=argparse_kwargs) + parser = super(MyApp, self).build_option_parser( + description, + version, + argparse_kwargs=argparse_kwargs) parser.add_argument( '-h', '--help', default=self, # tricky help="show this help message and exit", - ) + ) MyApp() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-1.3.1/tests/test_commandmanager.py new/cliff-1.3.2/tests/test_commandmanager.py --- old/cliff-1.3.1/tests/test_commandmanager.py 2012-04-29 23:27:06.000000000 +0200 +++ new/cliff-1.3.2/tests/test_commandmanager.py 2013-03-16 21:34:49.000000000 +0100 @@ -19,7 +19,7 @@ 'one': TestCommand, 'two words': TestCommand, 'three word command': TestCommand, - } + } def test_lookup_and_find(): @@ -53,6 +53,7 @@ def test_find_invalid_command(): mgr = TestCommandManager('test') + def check_one(argv): try: mgr.find_command(argv) @@ -88,8 +89,33 @@ testcmd = mock.Mock(name='testcmd') testcmd.name.replace.return_value = 'test' mock_pkg_resources = mock.Mock(return_value=[testcmd]) - with mock.patch('pkg_resources.iter_entry_points', mock_pkg_resources) as iter_entry_points: + with mock.patch('pkg_resources.iter_entry_points', + mock_pkg_resources) as iter_entry_points: mgr = CommandManager('test') assert iter_entry_points.called_once_with('test') names = [n for n, v in mgr] assert names == ['test'] + + +def test_load_commands_keep_underscores(): + testcmd = mock.Mock() + testcmd.name = 'test_cmd' + mock_pkg_resources = mock.Mock(return_value=[testcmd]) + with mock.patch('pkg_resources.iter_entry_points', + mock_pkg_resources) as iter_entry_points: + mgr = CommandManager('test', convert_underscores=False) + assert iter_entry_points.called_once_with('test') + names = [n for n, v in mgr] + assert names == ['test_cmd'] + + +def test_load_commands_replace_underscores(): + testcmd = mock.Mock() + testcmd.name = 'test_cmd' + mock_pkg_resources = mock.Mock(return_value=[testcmd]) + with mock.patch('pkg_resources.iter_entry_points', + mock_pkg_resources) as iter_entry_points: + mgr = CommandManager('test', convert_underscores=True) + assert iter_entry_points.called_once_with('test') + names = [n for n, v in mgr] + assert names == ['test cmd'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-1.3.1/tests/test_help.py new/cliff-1.3.2/tests/test_help.py --- old/cliff-1.3.1/tests/test_help.py 2012-06-20 22:48:27.000000000 +0200 +++ new/cliff-1.3.2/tests/test_help.py 2013-03-16 21:37:00.000000000 +0100 @@ -38,7 +38,7 @@ 'one': TestCommand, 'two words': TestCommand, 'three word command': TestCommand, - } + } def test_show_help_for_command(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-1.3.1/tests/test_lister.py new/cliff-1.3.2/tests/test_lister.py --- old/cliff-1.3.1/tests/test_lister.py 2012-08-31 13:08:05.000000000 +0200 +++ new/cliff-1.3.2/tests/test_lister.py 2013-03-16 21:36:50.000000000 +0100 @@ -1,8 +1,5 @@ #!/usr/bin/env python -from cliff.command import Command -from cliff.commandmanager import CommandManager -from cliff.formatters.base import ListFormatter from cliff.lister import Lister import mock @@ -16,19 +13,20 @@ def emit_list(self, columns, data, stdout, args): self.args.append((columns, data)) + class ExerciseLister(Lister): - def load_formatter_plugins(self): - self.formatters = { - 'test': FauxFormatter(), - } - return - - def take_action(self, parsed_args): - return ( - parsed_args.columns, - [('a', 'A'), ('b', 'B')], - ) + def load_formatter_plugins(self): + self.formatters = { + 'test': FauxFormatter(), + } + return + + def take_action(self, parsed_args): + return ( + parsed_args.columns, + [('a', 'A'), ('b', 'B')], + ) # def run(self, parsed_args): @@ -52,4 +50,3 @@ assert args[0] == list(parsed_args.columns) data = list(args[1]) assert data == [['a', 'A'], ['b', 'B']] - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cliff-1.3.1/tox.ini new/cliff-1.3.2/tox.ini --- old/cliff-1.3.1/tox.ini 2012-08-31 13:28:32.000000000 +0200 +++ new/cliff-1.3.2/tox.ini 2013-03-26 21:49:03.000000000 +0100 @@ -1,5 +1,5 @@ [tox] -envlist = py26,py27,py32,pep8 +envlist = py26,py27,py32,py33,style [testenv] commands = nosetests -d --with-coverage --cover-inclusive --cover-package cliff [] @@ -8,6 +8,6 @@ mock coverage -[testenv:pep8] -deps = pep8 -commands = pep8 --repeat --ignore=E501 --ignore=E123 --show-source cliff +[testenv:style] +deps = flake8 +commands = flake8 cliff docs/source/conf.py tests -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
