module loghelper.history_helper

Inheritance diagram of pyquickhelper.loghelper.history_helper

Short summary

module pyquickhelper.loghelper.history_helper

@helper Build history for a module.

Classes

class

truncated documentation

open_stream_file

Opens a stream or a filename. It works with keyword with.

Functions

function

truncated documentation

build_history

Returns an history of a module.

compile_history

Compile history and produces a rst file.

enumerate_closed_issues

Enumerates github issues for a repo and an owner since a given date.

extract_issue_from_history

Extracts issues from exsiting history stored in HISTORY.rst. The pattern must extract from the following lines: …

Methods

method

truncated documentation

__enter__

Opens the stream or the file.

__exit__

Leaves the stream or the filename.

__init__

read

Reads some bytes.

readline

Basic implementation.

readlines

Basic implementation.

Documentation

@helper Build history for a module.

New in version 1.7.

source on GitHub

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, fLOG=None)[source][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

  • fLOG – logging function

Returns

iterator on issues (number, date, title)

source on GitHub

pyquickhelper.loghelper.history_helper.compile_history(releases, template=None)[source][source]

Compile history and produces a rst file.

Parameters
Returns

output

source on GitHub

pyquickhelper.loghelper.history_helper.enumerate_closed_issues(owner, repo, since=None, issues=None, url=None, max_issue=None)[source][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)

source on GitHub

pyquickhelper.loghelper.history_helper.extract_issue_from_history(filename_or_stream)[source][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)
Parameters

filename – stream or filename

Returns

ancient history, dictionary {issue: (date, description)}

source on GitHub

class pyquickhelper.loghelper.history_helper.open_stream_file(name, mode='r', encoding='utf-8')[source][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

source on GitHub

Parameters
  • name – stream or filename

  • mode – open mode, works only if filename

  • encoding – encoding, works only if filename

source on GitHub

__enter__()[source][source]

Opens the stream or the file.

source on GitHub

__exit__(exception_type, exception_value, traceback)[source][source]

Leaves the stream or the filename.

source on GitHub

__init__(name, mode='r', encoding='utf-8')[source][source]
Parameters
  • name – stream or filename

  • mode – open mode, works only if filename

  • encoding – encoding, works only if filename

source on GitHub

read(size=None)[source][source]

Reads some bytes.

Parameters

size – number of bytes or characters to read

Returns

content

source on GitHub

readline()[source][source]

Basic implementation.

Returns

next line

source on GitHub

readlines()[source][source]

Basic implementation.

Returns

all text lines

source on GitHub