mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-23 09:56:23 +03:00
refactor: remove dead get_features code
This commit is contained in:
parent
2bbad39382
commit
006df9f44d
@ -16,8 +16,6 @@ from ykman.oath import OathController, Credential, SW
|
||||
from qr import qrparse
|
||||
from qr import qrdecode
|
||||
|
||||
NON_FEATURE_CAPABILITIES = [CAPABILITY.CCID, CAPABILITY.NFC]
|
||||
|
||||
|
||||
def as_json(f):
|
||||
def wrapped(*args):
|
||||
@ -37,10 +35,6 @@ class Controller(object):
|
||||
if isinstance(func, types.MethodType):
|
||||
setattr(self, f, as_json(func))
|
||||
|
||||
def get_features(self):
|
||||
return [
|
||||
c.name for c in CAPABILITY if c not in NON_FEATURE_CAPABILITIES]
|
||||
|
||||
def count_devices(self):
|
||||
return len(list(get_descriptors()))
|
||||
|
||||
|
@ -11,7 +11,6 @@ Python {
|
||||
property string name
|
||||
property string version
|
||||
property string oathId
|
||||
property var features: []
|
||||
property var connections: []
|
||||
property var credentials: []
|
||||
property int nextRefresh: 0
|
||||
@ -34,15 +33,10 @@ Python {
|
||||
addImportPath(urlPrefix + '/py')
|
||||
importModule('yubikey', function () {
|
||||
ready = true
|
||||
do_call('yubikey.controller.get_features', [],
|
||||
function (res) {
|
||||
features = res
|
||||
for (var i in queue) {
|
||||
do_call(queue[i][0], queue[i][1],
|
||||
queue[i][2])
|
||||
}
|
||||
queue = []
|
||||
})
|
||||
for (var i in queue) {
|
||||
do_call(queue[i][0], queue[i][1], queue[i][2])
|
||||
}
|
||||
queue = []
|
||||
})
|
||||
})
|
||||
})
|
||||
@ -168,7 +162,8 @@ Python {
|
||||
for (var i = 0; i < creds.length; i++) {
|
||||
var cred = creds[i]
|
||||
// Update min expiration
|
||||
if (cred.expiration && cred.expiration < minExpiration && cred.period === 30) {
|
||||
if (cred.expiration && cred.expiration < minExpiration
|
||||
&& cred.period === 30) {
|
||||
minExpiration = cred.expiration
|
||||
}
|
||||
// Touch credentials should only be replaced by user
|
||||
@ -207,7 +202,6 @@ Python {
|
||||
return credentials[i]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function credentialExists(longName) {
|
||||
@ -243,7 +237,7 @@ Python {
|
||||
function calculate(credential, copyAfterUpdate) {
|
||||
var now = Math.floor(Date.now() / 1000)
|
||||
do_call('yubikey.controller.calculate', [credential, now, passwordKey],
|
||||
function(cred) {
|
||||
function (cred) {
|
||||
updateSingleCredential(cred, copyAfterUpdate)
|
||||
})
|
||||
}
|
||||
@ -251,7 +245,7 @@ Python {
|
||||
function calculateSlotMode(slot, digits, copyAfterUpdate) {
|
||||
var now = Math.floor(Date.now() / 1000)
|
||||
do_call('yubikey.controller.calculate_slot_mode', [slot, digits, now],
|
||||
function(cred) {
|
||||
function (cred) {
|
||||
updateSingleCredential(cred, copyAfterUpdate)
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user