nitrokey.updates

exception nitrokey.updates.DownloadError

Бази: Exception

__init__(msg)
Параметри:

msg (str)

Return type:

None

exception nitrokey.updates.OverwriteError

Бази: Exception

__init__(path)
Параметри:

path (str)

Return type:

None

class nitrokey.updates.Asset

Бази: object

Asset(tag: str, url: str)

__init__(tag, url)
Параметри:
  • tag (str)

  • url (str)

Return type:

None

download(f, callback=None)
Параметри:
  • f (BinaryIO)

  • callback (Callable[[int, int], None] | None)

Return type:

None

download_to_dir(d, overwrite=False, callback=None)
Параметри:
  • d (str)

  • overwrite (bool)

  • callback (Callable[[int, int], None] | None)

Return type:

str

read(callback=None)
Параметри:

callback (Callable[[int, int], None] | None)

Return type:

bytes

tag: str
url: str
class nitrokey.updates.Release

Бази: object

Release(tag: str, assets: list[str])

__init__(tag, assets)
Параметри:
  • tag (str)

  • assets (list[str])

Return type:

None

find_asset(url_pattern)
Параметри:

url_pattern (Pattern[str])

Return type:

Asset | None

require_asset(url_pattern)
Параметри:

url_pattern (Pattern[str])

Return type:

Asset

assets: list[str]
tag: str
class nitrokey.updates.Repository

Бази: object

Repository(owner: str, name: str)

__init__(owner, name)
Параметри:
  • owner (str)

  • name (str)

Return type:

None

get_latest_release()
Return type:

Release

get_release(tag)
Параметри:

tag (str)

Return type:

Release

get_release_or_latest(tag=None)
Параметри:

tag (str | None)

Return type:

Release

name: str
owner: str