nitrokey.updates

exception nitrokey.updates.DownloadError

Baser: Exception

__init__(msg)
Parametre:

msg (str)

Returtype:

None

exception nitrokey.updates.OverwriteError

Baser: Exception

__init__(path)
Parametre:

path (str)

Returtype:

None

class nitrokey.updates.Asset

Baser: object

Asset(tag: str, url: str)

__init__(tag, url)
Parametre:
  • tag (str)

  • url (str)

Returtype:

None

download(f, callback=None)
Parametre:
  • f (BinaryIO)

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

Returtype:

None

download_to_dir(d, overwrite=False, callback=None)
Parametre:
  • d (str)

  • overwrite (bool)

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

Returtype:

str

read(callback=None)
Parametre:

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

Returtype:

bytes

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

Baser: object

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

__init__(tag, assets)
Parametre:
  • tag (str)

  • assets (list[str])

Returtype:

None

find_asset(url_pattern)
Parametre:

url_pattern (Pattern[str])

Returtype:

Asset | None

require_asset(url_pattern)
Parametre:

url_pattern (Pattern[str])

Returtype:

Asset

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

Baser: object

Repository(ejer: str, navn: str)

__init__(owner, name)
Parametre:
  • owner (str)

  • name (str)

Returtype:

None

get_latest_release()
Returtype:

Release

get_release(tag)
Parametre:

tag (str)

Returtype:

Release

get_release_or_latest(tag=None)
Parametre:

tag (str | None)

Returtype:

Release

name: str
owner: str