Skip to content

Commit

Permalink
Add isort
Browse files Browse the repository at this point in the history
  • Loading branch information
nickray committed Aug 13, 2019
1 parent f9829bc commit ce2bac9
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 30 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ init: update-venv
# ensure this passes before commiting
check: lint
black --check solo/
isort --check-only --recursive solo/

# automatic code fixes
fix: black
fix: black isort

black:
black solo/

isort:
isort -y --recursive solo/

lint:
flake8 solo/

Expand Down
6 changes: 1 addition & 5 deletions solo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@

import pathlib

from . import client
from . import commands
from . import dfu
from . import helpers
from . import operations
from . import client, commands, dfu, helpers, operations

__version__ = open(pathlib.Path(__file__).parent / "VERSION").read().strip()

Expand Down
4 changes: 2 additions & 2 deletions solo/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
# http://opensource.org/licenses/MIT>, at your option. This file may not be
# copied, modified, or distributed except according to those terms.

import click
import json
import os

import click
import usb.core

import solo
import solo.operations
from solo.cli.key import key
from solo.cli.monitor import monitor
from solo.cli.program import program
from . import _patches # noqa (since otherwise "unused")

from . import _patches # noqa (since otherwise "unused")

if (os.name == "posix") and os.environ.get("ALLOW_ROOT") is None:
if os.geteuid() == 0:
Expand Down
2 changes: 1 addition & 1 deletion solo/cli/key.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
from fido2.ctap1 import ApduError

import solo
from solo.cli.update import update
import solo.fido2
from solo.cli.update import update


# https://pocoo-click.readthedocs.io/en/latest/commands/#nested-handling-and-contexts
Expand Down
3 changes: 1 addition & 2 deletions solo/cli/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
import sys
import time

import usb

import click
import usb
from fido2.ctap import CtapError

import solo
Expand Down
2 changes: 1 addition & 1 deletion solo/cli/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import tempfile

import click
from fido2.ctap1 import ApduError
import requests
from fido2.ctap1 import ApduError

import solo
from solo import helpers
Expand Down
4 changes: 2 additions & 2 deletions solo/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
from fido2.ctap import CtapError
from fido2.ctap1 import CTAP1
from fido2.ctap2 import CTAP2
from fido2.hid import CtapHidDevice, CTAPHID
from fido2.hid import CTAPHID, CtapHidDevice
from fido2.utils import Timeout
from intelhex import IntelHex

from solo.commands import SoloBootloader, SoloExtension
import solo.exceptions
from solo import helpers
from solo.commands import SoloBootloader, SoloExtension


def find(solo_serial=None, retries=5, raw_device=None):
Expand Down
4 changes: 2 additions & 2 deletions solo/dfu.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
import struct
import time

import usb._objfinalizer
import usb.core
import usb.util
import usb._objfinalizer

from solo.commands import DFU, STM32L4
import solo.exceptions
from solo.commands import DFU, STM32L4


def find(dfu_serial=None, attempts=8, raw_device=None, altsetting=1):
Expand Down
3 changes: 2 additions & 1 deletion solo/fido2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import socket
import fido2._pyu2f.base

import fido2._pyu2f
import fido2._pyu2f.base


def force_udp_backend():
Expand Down
1 change: 1 addition & 0 deletions solo/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# copied, modified, or distributed except according to those terms.

import binascii

from intelhex import IntelHex

from solo import helpers
Expand Down
30 changes: 17 additions & 13 deletions solo/solotool.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,35 @@

# Programs solo using the Solo bootloader

import sys, os, time, struct, argparse
import array, struct, socket, json, base64, binascii
import argparse
import array
import base64
import binascii
import json
import os
import socket
import struct
import sys
import tempfile
import time
from binascii import hexlify, unhexlify
from hashlib import sha256

import click

import serial
import usb._objfinalizer
import usb.core
from cryptography import x509
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.backends import default_backend

from fido2.hid import CtapHidDevice, CTAPHID
from fido2.client import Fido2Client, ClientError
from cryptography.hazmat.primitives import hashes
from fido2.attestation import Attestation
from fido2.client import ClientError, Fido2Client
from fido2.ctap import CtapError
from fido2.ctap1 import CTAP1, ApduError
from fido2.ctap2 import CTAP2
from fido2.hid import CTAPHID, CtapHidDevice
from fido2.utils import Timeout
from fido2.attestation import Attestation

import usb.core
import usb._objfinalizer

from intelhex import IntelHex
import serial

import solo
from solo import helpers
Expand Down

0 comments on commit ce2bac9

Please sign in to comment.