cots.makemkv – MakeMKV’s Product Handler

This module is the product handler of MakeMKV from GuinpinSoft inc. The MakeMKV section gives more information about the installation process and the update mechanism.

Public Classes

This module has several public class listed below in alphabetical order.

MakeMKVHandler

ReleaseNotesParser

Objects reference

This section details the objects defined in this module.

class cots.makemkv.MakeMKVHandler

Bases: cots.core.BaseProduct

MakeMKV product handler.

This concrete class implements the tracking mechanism for the MakeMKV product. So most of information are in the core and more particularly in the BaseProduct class documentation. The information below focuses on the added value of this class.

Overridden Methods

This class is a concrete class, so the overridden methods are listed below in alphabetical order.

get_origin

is_update

_get_change_summary(version=None)

Extract the release note’s URL from the PAD File.

Parameters

version (str) – The version of the reference product (i.e. the deployed product). It’a string following the editor versioning rules.

Returns

True if the download of the change log file went well. In case of failure, the members are not modified and an error log is written.

Return type

bool

Raises

TypeError – Parameters type mismatch.

_get_field(path)

Get the value from a field in a PAD File.

Parameters

path (str) – The field’s path in the PAD file.

Returns

Contain the value of the field

Return type

str

_get_published()

Extract the date of the installer’s publication from the PAD file.

get_origin()

Get product information from the remote repository.

Returns

True if the download of the file went well. In case of failure, the members are not modified and an error log is written.

Return type

bool

Raises

TypeError – Parameters type mismatch.

is_update(product)

Return if this instance is an update of product.

This method compare the version of the two product, and return the comparison result. The version numbers used by the editor are compliant with the semantic versioning specification 2.0.0 (see support.semver module)

Parameters

product (BaseProduct) – The reference product (i.e. the deployed one)

Returns

True if this instance is an update of the product specified by the product parameter.

Return type

bool

Raises

TypeError – Parameters type mismatch.

class cots.makemkv.ReleaseNotesParser(version=None)

Bases: html.parser.HTMLParser

MakeMKV release notes parser.

This concrete class parses release notes and extracts notes since the deployed version.

Parameters

version (str) – The version of the deployed product. It’s a string following the editor versioning rules.

changelog

The changelog of the product since the deployed product (see version argument). It is a list of 3-tuple containing, in this order, the version (as a string using the editor versioning rules), the date of the installer’s publication (as a string using the ISO 8601 format) and the release note (as a string) using a simple HTML syntax (nested unordered list) as shown below.

<ul>
<li>Added support for AACS v60</li>
<li>Small miscellaneous improvements and bugfixes</li>
</ul>
Type

list

Using ReleaseNotesParser…

The main purpose of this class is to parse the revision history and fulfills the changelog attribute. So the using is limited to create class instance and call the feed() method with the content of the revision history file.

Examples
from cots.makemkv import ReleaseNotesParser
parser = ReleaseNotesParser("1.9.8")
with open(r".\history.html") as file:
    parser.feed(file.read())
print(parser.changelog)
Inside ReleaseNotesParser…

This class is a derived class from html.parser.HTMLParser by adding a scheduler to parse the HTML content. The figure below is the parser’s state graph.

digraph parsing { node [fontsize="10", fontname="Bell MT", margin="0.038,0.019", height="0.13"]; edge [fontsize="10", fontname="Bell MT"]; NULL -> CONTENT [label = <div id=content>]; CONTENT -> RELEASES_LIST [label = _is_releases_list_beginning]; CONTENT -> NULL [label = _is_content_ending]; RELEASES_LIST -> CONTENT [label = _is_releases_list_ending]; RELEASES_LIST -> RELEASE_ID [label = _is_release_id_beginning]; RELEASE_ID -> RELEASE_NOTES [label = _is_new_release]; RELEASE_ID -> IGNORE [label = _is_old_or_unknown_release]; RELEASE_NOTES -> FETCHING [label = _is_release_notes_beginning]; FETCHING -> RELEASES_LIST [label = _is_release_notes_ending]; IGNORE -> IGNORE [label = _is_release_notes_beginning]; IGNORE -> RELEASES_LIST [label = _is_release_notes_ending]; }

parser’s state graph

_is_content_beginning(event, data, attributes)
Parameters
  • event (int) – The event identifier

  • data (str) – The tag identifier (i.e. ul) or the text.

  • attributes – The attributes of the tag.

Returns

True if the transition is verified.

Return type

bool

_is_content_ending(event, data, attributes)
Parameters
  • event (int) – The event identifier

  • data (str) – The tag identifier (i.e. ul) or the text.

  • attributes – The attributes of the tag.

Returns

True if the transition is verified.

Return type

bool

_is_new_release(event, data, attributes)
Parameters
  • event (int) – The event identifier

  • data (str) – The tag identifier (i.e. ul) or the text.

  • attributes – The attributes of the tag.

Returns

True if the transition is verified.

Return type

bool

_is_old_or_unknown_release(event, data, attributes)
Parameters
  • event (int) – The event identifier

  • data (str) – The tag identifier (i.e. ul) or the text.

  • attributes – The attributes of the tag.

Returns

True if the transition is verified.

Return type

bool

_is_release_id_beginning(event, data, attributes)
Parameters
  • event (int) – The event identifier

  • data (str) – The tag identifier (i.e. ul) or the text.

  • attributes – The attributes of the tag.

Returns

True if the transition is verified.

Return type

bool

_is_release_notes_beginning(event, data, attributes)
Parameters
  • event (int) – The event identifier

  • data (str) – The tag identifier (i.e. ul) or the text.

  • attributes – The attributes of the tag.

Returns

True if the transition is verified.

Return type

bool

_is_release_notes_ending(event, data, attributes)
Parameters
  • event (int) – The event identifier

  • data (str) – The tag identifier (i.e. ul) or the text.

  • attributes – The attributes of the tag.

Returns

True if the transition is verified.

Return type

bool

_is_releases_list_beginning(event, data, attributes)
Parameters
  • event (int) – The event identifier

  • data (str) – The tag identifier (i.e. ul) or the text.

  • attributes – The attributes of the tag.

Returns

True if the transition is verified.

Return type

bool

_is_releases_list_ending(event, data, attributes)
Parameters
  • event (int) – The event identifier

  • data (str) – The tag identifier (i.e. ul) or the text.

  • attributes – The attributes of the tag.

Returns

True if the transition is verified.

Return type

bool

_null_actuating(event, data, attributes, first=False, last=False)

Null state actuating.

Parameters
  • event (int) – The event identifier

  • data (str) – The tag identifier (i.e. ul) or the text.

  • attributes (dict) – The attributes of the tag.

  • first (bool) – (optional) Indicate if it’s the first call of the actuating function (i.e. just after a state change (see _set_state) including if it’s the same state). False is the default.

  • last (bool) – (optional) Indicate if it’s the last call of the actuating function (i.e. just before a state change (see _set_state) including if it’s the same state). False is the default.

_process_event(event, data, attributes)

Process the event

Parameters
  • event (int) – The event identifier

  • data (str) – The tag identifier (i.e. ul) or the text.

  • attributes (dict) – The attributes of the tag.

_release_id_computing()

Release id computing.

_release_id_fetching(event, data, attributes, first=False, last=False)

Release state actuating.

Parameters
  • event (int) – The event identifier

  • data (str) – The tag identifier (i.e. ul) or the text.

  • attributes (dict) – The attributes of the tag.

  • first (bool) – (optional) Indicate if it’s the first call of the actuating function (i.e. just after a state change (see _set_state) including if it’s the same state). False is the default.

  • last (bool) – (optional) Indicate if it’s the last call of the actuating function (i.e. just before a state change (see _set_state) including if it’s the same state). False is the default.

_release_notes_fetching(event, data, attributes, first=False, last=False)

Release notes state actuating.

Parameters
  • event (int) – The event identifier

  • data (str) – The tag identifier (i.e. ul) or the text.

  • attributes (dict) – The attributes of the tag.

  • first (bool) – (optional) Indicate if it’s the first call of the actuating function (i.e. just after a state change (see _set_state) including if it’s the same state). False is the default.

  • last (bool) – (optional) Indicate if it’s the last call of the actuating function (i.e. just before a state change (see _set_state) including if it’s the same state). False is the default.

_set_state(state)

Set the state

Parameters

state (str) – The state identifier.