Docpie

Latest version: v0.4.2

Safety actively analyzes 685525 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 6

1441214390.257887

* [fix] `Docpie` will try to push all options ahead. It fixed
`test.test_docpie.DocpieRunDefaultTest.test_option_unit_stack`

1441188808.780277

* [change] now Docpie.option_text will be exactly the same as the
"Option" section (contains "Option" title).
* [change] now Docpie.usage_text will be exactly the same as the
"Usage" section (contains "Usage" title).
* [change] Change the data storage to `Docpie` instance, now you can
initialize several `Docpie` instances in one program with different configurations.
* [change] Allow `pickle` the `Docpie` instance directly.
Deprecate `need_pickle` & `restore_pickle`

0.4.2

* [fix] when no `options` section presented, fix the bug that `python` style
can not print properly when no match for `argv`:

e.g. for doc string:


Usage:
test v1
test v2


with no argument given, before 0.4.2 gives:


Usage:
test v1
test v2


after this fix, it will give correctly:


Usage:
test v1
test v2

0.4.1

* [fix] [11](https://github.com/TylerTemp/docpie/issues/11) error handler.
Now ``docpie`` will print an extra `\n` when error occurs,
and leave two linebreakers between usage and option section

python
"""
`SCRIPT` DESCRIPTION

Usage:
SCRIPT [options]

Options:
-h, --help show help

"""

import docpie

arguments = docpie.docpie(__doc__, argv=['prog', '--no-such'])
// now
Unknown option: --no-such.

Usage:
SCRIPT [options]
// always has one linebreaker here
Options:
-h, --help show help
// only one linebreaker, as many programs do

// before
Unknown option: --no-such.

Usage:
SCRIPT [options]
Options: // missing linebreaker
-h, --help show help

// more than one linebreakers

0.4.0

* [fix] [10](https://github.com/TylerTemp/docpie/issues/10),
[11](https://github.com/TylerTemp/docpie/issues/11) short help(`-h`) print
full doc
* [new] **breaking change**. [PEP-257](https://www.python.org/dev/peps/pep-0257/)
help message supported. add `helpstyle` for people how need to print
raw docsting as help message (the old way)

that means, when there is extra returning line, extra indent, they will be
trimly. This feature makes `docpie` work as most python doc tool.

This is very useful when your doc needs to be written as:


class Test(object):

def some_fun(self):
"""
Usage: prog hello
"""

and also in this way:

docpie.docpie("\n \n Usage: prog [-h]\n\n\n", ["prog", "-h"])
will give `Usage: prog [-h]\n` instead of `\n \n Usage: prog [-h]\n\n\n\n`

supported value for `helpstyle`: `"python"`(default), `"dedent"`, `"raw"`

0.3.8

* [fix] [12](https://github.com/TylerTemp/docpie/issues/12), wrong way to
reset repeated Options

Page 1 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.