Skip to content

Commit

Permalink
Fix linting except for overlong lines
Browse files Browse the repository at this point in the history
  • Loading branch information
rytilahti committed Sep 14, 2017
1 parent 3be9f4c commit 2000fab
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mirobo/extract_tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
import tarfile
import tempfile
import sqlite3
import binascii
from Crypto.Cipher import AES
from pprint import pformat as pf


def dump_raw(dev):
raw = {k: dev[k] for k in dev.keys()}
click.echo(pf(raw))


def decrypt_ztoken(ztoken):
if len(ztoken) <= 32:
return ztoken
Expand Down Expand Up @@ -46,12 +47,14 @@ def read_android(conn):
token = dev['token']
click.echo("%s (%s) at %s. token: %s (mac: %s, ssid: %s)" % (name, model, ip, token, mac, ssid))


def write(db, fp):
fp.open()
db.seek(0) # go to the beginning
click.echo("Saving db to %s" % fp)
fp.write(db.read())


def read_tokens(db):
conn = sqlite3.connect(db)
conn.row_factory = sqlite3.Row
Expand Down Expand Up @@ -93,4 +96,4 @@ def main(backup, write_to_disk):


if __name__ == "__main__":
main()
main()

0 comments on commit 2000fab

Please sign in to comment.