Skip to content

Commit

Permalink
Merge branch 'remove-dataclasses'
Browse files Browse the repository at this point in the history
Fixes build error due to use of the dataclasses, which are not present
in Python 3.6.

Connected:
- #212
  • Loading branch information
szszszsz committed Mar 31, 2022
2 parents ae9413c + ab49d3b commit 80fcee7
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions pynitrokey/cli/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from typing import Optional

import click
import dataclasses
import usb1
from tqdm import tqdm

Expand Down Expand Up @@ -101,18 +100,25 @@ def self_check(cls) -> bool:
return True


@dataclasses.dataclass
class ConnectedDevices:
application_mode: int
update_mode: int

def __init__(self, application_mode, update_mode):
self.application_mode = application_mode
self.update_mode = update_mode

def is_connected() -> ConnectedDevices:
@dataclasses.dataclass
class UsbId:
vid: int
pid: int

class UsbId:
vid: int
pid: int

def __init__(self, vid, pid):
self.vid = vid
self.pid = pid


def is_connected() -> ConnectedDevices:
devs = {}
usb_id = {
"update_mode": UsbId(0x03EB, 0x2FF1),
Expand Down

0 comments on commit 80fcee7

Please sign in to comment.