Skip to content

Commit

Permalink
black + isort
Browse files Browse the repository at this point in the history
  • Loading branch information
tatarize committed Jul 6, 2023
1 parent 480d93c commit 912185e
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ low level command system for ezcad2 lmc-controller galvo lasers

# Installing
galvo plotter can be installed with `pip`
> `pip install galvoplotter`
`pip install galvoplotter`

# Dependencies
* pyusb
Expand Down
3 changes: 2 additions & 1 deletion examples/gpio_detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
Connection happens automatically at the first issue of realtime `write_port()` command.
"""

from galvo.controller import GalvoController
from pynput import keyboard

from galvo.controller import GalvoController

controller = GalvoController("default.json")


Expand Down
2 changes: 2 additions & 0 deletions examples/light_circle_abort.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"""

import math

from pynput import keyboard

from galvo.controller import GalvoController

controller = GalvoController("default.json")
Expand Down
3 changes: 1 addition & 2 deletions galvo/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .controller import GalvoController
from .consts import *
from .controller import GalvoController


def generate_job(generator):
Expand All @@ -25,4 +25,3 @@ def job(c):
return True

return job

2 changes: 0 additions & 2 deletions galvo/consts.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


listJumpTo = 0x8001
listEndOfList = 0x8002
listLaserOnPoint = 0x8003
Expand Down
12 changes: 6 additions & 6 deletions galvo/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@
import time
from contextlib import contextmanager
from copy import copy
from .consts import *

from .consts import *
from .mock_connection import MockConnection
from .usb_connection import USBConnection


BUSY = 0x04
READY = 0x20

Expand Down Expand Up @@ -166,7 +165,8 @@ def __init__(
self._delay_end = None
if settings_file is not None:
import json
with open(settings_file, 'r') as fp:

with open(settings_file, "r") as fp:
self.__dict__.update(json.load(fp))

#######################
Expand Down Expand Up @@ -682,7 +682,7 @@ def wait_idle(self):
#######################

def wait_for_spooler_job_sent(self, job):
assert (threading.current_thread() is not self._spooler_thread)
assert threading.current_thread() is not self._spooler_thread
with self._spooler_lock:
if job not in self._queue:
# Waiting for job that does not exist.
Expand All @@ -694,7 +694,7 @@ def wait_for_machine_idle(self):
Block the current thread until system is idle
:return:
"""
assert(threading.current_thread() is not self._spooler_thread)
assert threading.current_thread() is not self._spooler_thread
self.wait_for_spooler_send()
self.wait_finished()

Expand All @@ -706,7 +706,7 @@ def wait_for_spooler_send(self):
:return:
"""
assert (threading.current_thread() is not self._spooler_thread)
assert threading.current_thread() is not self._spooler_thread
while self._queue:
with self._spooler_lock:
self._spooler_lock.wait()
Expand Down
3 changes: 1 addition & 2 deletions galvo/mock_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
import random
import struct

from .consts import list_command_lookup
from .consts import single_command_lookup
from .consts import list_command_lookup, single_command_lookup


def _(data):
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from setuptools import setup

setup(
install_requires=[
"pyusb",
Expand Down
6 changes: 3 additions & 3 deletions test/test_api.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import os
import time
import unittest

from galvo import GalvoController, generate_job

state = 0

__location__ = os.path.realpath(
os.path.join(os.getcwd(), os.path.dirname(__file__)))
__location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))

__settings__ = os.path.join(__location__, 'test.json')
__settings__ = os.path.join(__location__, "test.json")


def infinite_lighting_job(c):
Expand Down

0 comments on commit 912185e

Please sign in to comment.