Skip to content
Back to top
View this page

# DirectoryChanGo

class chango.concrete.DirectoryChanGo(change_note_type, version_note_type, version_history_type, scanner, directory_format='{uid}_{date}')

  Bases: `ChanGo`[`DirectoryVersionScanner`, `VHT`, `VNT`, `CNT`], `Generic`

  Implementation of the `ChanGo` interface that works with `DirectoryVersionScanner` and assumes that change notes are stored in subdirectories named after the version identifier.

  Parameters:

    - change_note_type (`type`) – The type of change notes to load. Must be a subclass of `ChangeNote`.

    - version_note_type (`type`) – The type of version notes to load. Must be a subclass of `VersionNote`.

    - version_history_type (`type`) – The type of version histories to load. Must be a subclass of `VersionHistory`.

    - scanner (`DirectoryVersionScanner`) – The version scanner to use.

    - directory_format (`str`, optional) – Reverse of `DirectoryVersionScannerdirectory_pattern`. Must be a string that can be used with `str.format()` and contain at least one named field `uid` for the version identifier and optionally a second named field `date` for the date of the version release in ISO format. The default value is compatible with the default value of `DirectoryVersionScannerdirectory_pattern`.

  directory_format

    The format string used to create version directories.

    Type:

      `str`

  build_github_event_change_note(event, data=None)

    Implementation of `build_github_event_change_note()`.

    Important

    By default, this will always call `chango.abc.ChangeNote.build_from_github_event()` and does not check if a new change note is necessary. The only exception is when `change_note_type` is a subclass of `SectionChangeNote`:

    - If there already is a change note for the current pull request, it is updated with the new information. If nothing changed, returns `None`.

    - If the `data` parameter is an instance of `ChanGoActionData` with a parent pull request, then this method will try to find an existing unreleased change note for the parent pull request and append the new information to it.

  build_version_note(version)

    Implementation of `build_version_note()`. Includes special handling for `SectionVersionNote`, which has the required argument `section_change_note_type`.