forked from Nitrokey/libnitrokey
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Nitrokey#151 from robin-nitrokey/nk3-fetch-update
nk3: Automatically fetch firmware updates
- Loading branch information
Showing
10 changed files
with
370 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ requests | |
pygments | ||
python-dateutil | ||
spsdk>=1.5.0 | ||
tqdm | ||
urllib3 | ||
cffi | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright 2022 Nitrokey Developers | ||
# | ||
# Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or | ||
# http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or | ||
# http://opensource.org/licenses/MIT>, at your option. This file may not be | ||
# copied, modified, or distributed except according to those terms. | ||
|
||
import re | ||
|
||
from pynitrokey.updates import FirmwareUpdate, Repository | ||
|
||
REPOSITORY_OWNER = "Nitrokey" | ||
REPOSITORY_NAME = "nitrokey-3-firmware" | ||
UPDATE_PATTERN = re.compile("\\.sb2$") | ||
|
||
|
||
def _get_repo() -> Repository: | ||
return Repository( | ||
owner=REPOSITORY_OWNER, name=REPOSITORY_NAME, update_pattern=UPDATE_PATTERN | ||
) | ||
|
||
|
||
def get_latest_update() -> FirmwareUpdate: | ||
return _get_repo().get_latest_update() | ||
|
||
|
||
def get_update(tag: str) -> FirmwareUpdate: | ||
return _get_repo().get_update(tag) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright 2022 Nitrokey Developers | ||
# | ||
# Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or | ||
# http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or | ||
# http://opensource.org/licenses/MIT>, at your option. This file may not be | ||
# copied, modified, or distributed except according to those terms. | ||
|
||
from typing import Optional | ||
|
||
class tqdm: | ||
def __init__( | ||
self, | ||
total: Optional[int] = None, | ||
unit: Optional[str] = None, | ||
unit_scale: Optional[bool] = None, | ||
) -> None: ... | ||
def update(self, n: int) -> None: ... | ||
def close(self) -> None: ... |
Oops, something went wrong.