module loghelper.history_helper
¶
Short summary¶
module pyquickhelper.loghelper.history_helper
@helper Build history for a module.
Classes¶
class |
truncated documentation |
---|---|
Opens a stream or a filename. It works with keyword |
Functions¶
function |
truncated documentation |
---|---|
Returns an history of a module. |
|
Compile history and produces a rst file. |
|
Enumerates github issues for a repo and an owner since a given date. |
|
Extracts issues from exsiting history stored in |
Methods¶
method |
truncated documentation |
---|---|
Opens the stream or the file. |
|
Leaves the stream or the filename. |
|
Reads some bytes. |
|
Basic implementation. |
|
Basic implementation. |
Documentation¶
@helper Build history for a module.
- pyquickhelper.loghelper.history_helper.build_history(owner, repo, name=None, since=None, issues=None, url=None, max_issue=None, releases=None, unpublished=False, existing_history=None, skip_issues=None, fLOG=None)[source]¶
Returns an history of a module.
- Parameters:
owner – repo owner
repo – repository
name – None if
name == repo
since – not older than that date, if None, do not go beyond a year
issues – see
call_github_api
(unit test)url – see
call_github_api
(unit test)max_issue – see
call_github_api
(unit test)releases – bypass pypi (unit test)
unpublished – keep unpublished released
existing_history – existing history, retrieves existing issues stored in that file
skip_issues – skip a given list of issues when building the history
fLOG – logging function
- Returns:
iterator on issues
(number, date, title)
- pyquickhelper.loghelper.history_helper.compile_history(releases, template=None)[source]¶
Compile history and produces a rst file.
- Parameters:
releases – output of
build_history
template – jinja2 template (None means default one)
- Returns:
output
- pyquickhelper.loghelper.history_helper.enumerate_closed_issues(owner, repo, since=None, issues=None, url=None, max_issue=None)[source]¶
Enumerates github issues for a repo and an owner since a given date.
- Parameters:
owner – repo owner
repo – repository
since – not older than that date, if None, do not go beyond a year
issues – to bypass
call_github_api
url – if available, something like
https://api.github.com/repos/sdpython/pyquickhelper/issues/{0}
max_issue – max number of issues
- Returns:
iterator on issues
(number, date, title)
- pyquickhelper.loghelper.history_helper.extract_issue_from_history(filename_or_stream)[source]¶
Extracts issues from exsiting history stored in
HISTORY.rst
. The pattern must extract from the following lines:* `133`: add a collapsible container, adapt it for runpython (2018-04-22)
or
#133: add a collapsible container, adapt it for runpython (2018-04-22)
- Parameters:
filename – stream or filename
- Returns:
ancient history, dictionary {issue: (date, description)}
- class pyquickhelper.loghelper.history_helper.open_stream_file(name, mode='r', encoding='utf-8')[source]¶
Bases:
object
Opens a stream or a filename. It works with keyword
with
.<<<
from pyquickhelper.loghelper.history_helper import open_stream_file from io import StringIO st = StringIO("a\nb") with open_stream_file(st) as f: for line in f.readlines(): print(line)
>>>
a b
- Parameters:
name – stream or filename
mode – open mode, works only if filename
encoding – encoding, works only if filename
- __init__(name, mode='r', encoding='utf-8')[source]¶
- Parameters:
name – stream or filename
mode – open mode, works only if filename
encoding – encoding, works only if filename
- read(size=None)[source]¶
Reads some bytes.
- Parameters:
size – number of bytes or characters to read
- Returns:
content