def __del__(self): YubiKey.__del__(self) try: if self._usb_handle: self._close() except usb.USBError: pass
def __init__(self, debug=False, skip=0): """ Find and connect to a USB HIB YubiKey. Attributes : skip -- number of YubiKeys to skip debug -- True or False """ YubiKey.__init__(self, debug) self._usb_handle = None if not self._open(skip): raise YubiKeyUSBHIDError('YubiKey USB HID initialization failed') self.status()
def __init__(self, debug=False, skip=0): """ Find and connect to a YubiKey (USB HID). Attributes : skip -- number of YubiKeys to skip debug -- True or False """ YubiKey.__init__(self, debug) self._usb_handle = None if not self._open(skip): raise YubiKeyUSBHIDError('YubiKey USB HID initialization failed') self.status() self.capabilities = \ YubiKeyUSBHIDCapabilities(model = self.model, \ version = self.version_num(), \ default_answer = False)