kete: various flake8 fixes
>$ flake8 --ignore=E501,W504 tools tools/kete.py:35:1: E302 expected 2 blank lines, found 1 tools/kete.py:553:12: E713 test for membership should be 'not in' tools/kete.py:599:42: E226 missing whitespace around arithmetic operator tools/kete.py:599:61: E226 missing whitespace around arithmetic operator tools/kete.py:615:25: E226 missing whitespace around arithmetic operator tools/kete.py:615:32: E226 missing whitespace around arithmetic operator tools/kete.py:624:49: E225 missing whitespace around operator tools/kete.py:871:9: F841 local variable 'e' is assigned to but never used
This commit is contained in:
parent
146b480a84
commit
359502b134
|
@ -32,6 +32,7 @@ import configparser
|
||||||
|
|
||||||
CONFIG_PATH = os.path.join(xdg.BaseDirectory.xdg_data_home, 'tuhi-kete')
|
CONFIG_PATH = os.path.join(xdg.BaseDirectory.xdg_data_home, 'tuhi-kete')
|
||||||
|
|
||||||
|
|
||||||
class ColorFormatter(logging.Formatter):
|
class ColorFormatter(logging.Formatter):
|
||||||
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, LIGHT_GRAY = range(30, 38)
|
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, LIGHT_GRAY = range(30, 38)
|
||||||
DARK_GRAY, LIGHT_RED, LIGHT_GREEN, LIGHT_YELLOW, LIGHT_BLUE, LIGHT_MAGENTA, LIGHT_CYAN, WHITE = range(90, 98)
|
DARK_GRAY, LIGHT_RED, LIGHT_GREEN, LIGHT_YELLOW, LIGHT_BLUE, LIGHT_MAGENTA, LIGHT_CYAN, WHITE = range(90, 98)
|
||||||
|
@ -550,7 +551,7 @@ class Fetcher(Worker):
|
||||||
address = args.address
|
address = args.address
|
||||||
index = args.index
|
index = args.index
|
||||||
|
|
||||||
if not address in config:
|
if address not in config:
|
||||||
config[address] = {}
|
config[address] = {}
|
||||||
|
|
||||||
self.orientation = config[address].get('Orientation', 'Landscape')
|
self.orientation = config[address].get('Orientation', 'Landscape')
|
||||||
|
@ -596,7 +597,7 @@ class Fetcher(Worker):
|
||||||
else:
|
else:
|
||||||
# Original diemnsions are too big for SVG Standard
|
# Original diemnsions are too big for SVG Standard
|
||||||
# so we nomalize them
|
# so we nomalize them
|
||||||
width, height = dimensions[0]/100, dimensions[1]/100
|
width, height = dimensions[0] / 100, dimensions[1] / 100
|
||||||
|
|
||||||
if self.orientation in ['Portrait', 'Reverse-Portrait']:
|
if self.orientation in ['Portrait', 'Reverse-Portrait']:
|
||||||
svg = svgwrite.Drawing(filename=filename, size=(height, width))
|
svg = svgwrite.Drawing(filename=filename, size=(height, width))
|
||||||
|
@ -612,7 +613,7 @@ class Fetcher(Worker):
|
||||||
|
|
||||||
x, y = p['position']
|
x, y = p['position']
|
||||||
# Normalize coordinates too
|
# Normalize coordinates too
|
||||||
x, y = x/100, y/100
|
x, y = x / 100, y / 100
|
||||||
|
|
||||||
if self.orientation == 'Reverse-Portrait':
|
if self.orientation == 'Reverse-Portrait':
|
||||||
x, y = y, width - x
|
x, y = y, width - x
|
||||||
|
@ -621,7 +622,7 @@ class Fetcher(Worker):
|
||||||
elif self.orientation == 'Reverse-Landscape':
|
elif self.orientation == 'Reverse-Landscape':
|
||||||
x, y = width - x, height - y
|
x, y = width - x, height - y
|
||||||
|
|
||||||
delta = (p['pressure'] - 1000.0)/ 1000.0
|
delta = (p['pressure'] - 1000.0) / 1000.0
|
||||||
stoke_width = 0.4 + 0.20 * delta
|
stoke_width = 0.4 + 0.20 * delta
|
||||||
points_with_sk_width.append((x, y, stoke_width))
|
points_with_sk_width.append((x, y, stoke_width))
|
||||||
|
|
||||||
|
@ -868,7 +869,7 @@ HandlePressure = true
|
||||||
def run(self, init=None):
|
def run(self, init=None):
|
||||||
try:
|
try:
|
||||||
self.cmdloop(init)
|
self.cmdloop(init)
|
||||||
except KeyboardInterrupt as e:
|
except KeyboardInterrupt:
|
||||||
print('^C')
|
print('^C')
|
||||||
self.run('')
|
self.run('')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue