nitrokey.updates

exception nitrokey.updates.DownloadError

基类:Exception

__init__(msg)
参数:

msg (str)

返回类型:

None

exception nitrokey.updates.OverwriteError

基类:Exception

__init__(path)
参数:

path (str)

返回类型:

None

class nitrokey.updates.Asset

基类:object

资产(标签:str,url:str)

__init__(tag, url)
参数:
  • tag (str)

  • url (str)

返回类型:

None

download(f, callback=None)
参数:
  • f (BinaryIO)

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

返回类型:

None

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

  • overwrite (bool)

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

返回类型:

str

read(callback=None)
参数:

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

返回类型:

bytes

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

基类:object

发布(tag:str,assets:list[str])

__init__(tag, assets)
参数:
  • tag (str)

  • assets (list[str])

返回类型:

None

find_asset(url_pattern)
参数:

url_pattern (Pattern[str])

返回类型:

Asset | None

require_asset(url_pattern)
参数:

url_pattern (Pattern[str])

返回类型:

Asset

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

基类:object

存储库(所有者:str,名称:str)

__init__(owner, name)
参数:
  • owner (str)

  • name (str)

返回类型:

None

get_latest_release()
返回类型:

Release

get_release(tag)
参数:

tag (str)

返回类型:

Release

get_release_or_latest(tag=None)
参数:

tag (str | None)

返回类型:

Release

name: str
owner: str