Hello community, here is the log from the commit of package python-click-man for openSUSE:Leap:15.2 checked in at 2020-02-22 18:48:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2/python-click-man (Old) and /work/SRC/openSUSE:Leap:15.2/.python-click-man.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-click-man" Sat Feb 22 18:48:59 2020 rev:1 rq:775451 version:0.3.0 Changes: -------- New Changes file: --- /dev/null 2019-12-19 10:12:34.003146842 +0100 +++ /work/SRC/openSUSE:Leap:15.2/.python-click-man.new.26092/python-click-man.changes 2020-02-22 18:49:00.296310628 +0100 @@ -0,0 +1,14 @@ +------------------------------------------------------------------- +Thu Dec 5 11:03:35 UTC 2019 - Tomáš Chvátal <[email protected]> + +- Switch to github archive as the tests are not present on pypi + version + +------------------------------------------------------------------- +Mon Nov 25 20:45:00 UTC 2019 - Sean Marlow <[email protected]> + +- Initial release. v0.3.0 +- get-short-help.patch adds get_short_help_str function and + supports older versions of python-click. get_short_help_str was + added to Click in version >= 7.0.0. +- Use pytest instead of nose for unit tests. New: ---- get-short-help.patch python-click-man.changes python-click-man.spec v0.3.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-click-man.spec ++++++ # # spec file for package python-click-man # # Copyright (c) 2019 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-click-man Version: 0.3.0 Release: 0 Summary: Automate generation of man pages for python click applications License: MIT URL: https://github.com/click-contrib/click-man Source: https://github.com/click-contrib/click-man/archive/v%{version}.tar.gz Patch1: get-short-help.patch BuildRequires: %{python_module click} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module sure} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-click BuildArch: noarch %python_subpackages %description Automate generation of man pages for Python Click applications. %prep %setup -q -n click-man-%{version} %patch1 -p1 %build export LANG=en_US.UTF-8 %python_build %install export LANG=en_US.UTF-8 %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %python_clone -a %{buildroot}%{_bindir}/click-man %check export LANG=en_US.UTF-8 %pytest %post %python_install_alternative click-man %postun %python_uninstall_alternative click-man %files %{python_files} %license LICENSE %doc CHANGELOG.md README.md %python_alternative %{_bindir}/click-man %{python_sitelib}/* %changelog ++++++ get-short-help.patch ++++++ Index: click-man-0.3.0/click_man/core.py =================================================================== --- click-man-0.3.0.orig/click_man/core.py +++ click-man-0.3.0/click_man/core.py @@ -17,6 +17,14 @@ from .man import ManPage CLICK_VERSION = tuple(int(x) for x in click.__version__.split('.')) + +def get_short_help_str(command, limit=45): + """ + Gets short help for the command or makes it by shortening the long help string. + """ + return command.short_help or command.help and click.utils.make_default_short_help(command.help, limit) or '' + + def generate_man_page(ctx, version=None): """ Generate documentation for the given command. @@ -30,14 +38,14 @@ def generate_man_page(ctx, version=None) # Create man page with the details from the given context man_page = ManPage(ctx.command_path) man_page.version = version - man_page.short_help = ctx.command.get_short_help_str() + man_page.short_help = get_short_help_str(ctx.command) man_page.description = ctx.command.help man_page.synopsis = ' '.join(ctx.command.collect_usage_pieces(ctx)) man_page.options = [x.get_help_record(None) for x in ctx.command.params if isinstance(x, click.Option)] commands = getattr(ctx.command, 'commands', None) if commands: man_page.commands = [ - (k, v.get_short_help_str()) for k, v in commands.items() + (k, get_short_help_str(v)) for k, v in commands.items() ] return str(man_page)
