nitrokey.updates

exception nitrokey.updates.DownloadError

Bas: Exception

__init__(msg)
Parametrar:

msg (str)

Returtyp:

None

exception nitrokey.updates.OverwriteError

Bas: Exception

__init__(path)
Parametrar:

path (str)

Returtyp:

None

class nitrokey.updates.Asset

Bas: object

Asset(tag: str, url: str)

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

  • url (str)

Returtyp:

None

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

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

Returtyp:

None

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

  • overwrite (bool)

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

Returtyp:

str

read(callback=None)
Parametrar:

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

Returtyp:

bytes

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

Bas: object

Release(tag: str, tillgångar: list[str])

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

  • assets (list[str])

Returtyp:

None

find_asset(url_pattern)
Parametrar:

url_pattern (Pattern[str])

Returtyp:

Asset | None

require_asset(url_pattern)
Parametrar:

url_pattern (Pattern[str])

Returtyp:

Asset

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

Bas: object

Repository(ägare: str, namn: str)

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

  • name (str)

Returtyp:

None

get_latest_release()
Returtyp:

Release

get_release(tag)
Parametrar:

tag (str)

Returtyp:

Release

get_release_or_latest(tag=None)
Parametrar:

tag (str | None)

Returtyp:

Release

name: str
owner: str