Skip to content

Commit 00346d8

Browse files
committed
Flake8
1 parent 3ea628d commit 00346d8

26 files changed

Lines changed: 165 additions & 73 deletions

computercraft/cc/commands.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,9 @@ def getBlockInfo(x: int, y: int, z: int) -> dict:
3333
return eval_lua(b'G:commands:M:getBlockInfo', x, y, z).take_dict()
3434

3535

36-
def getBlockInfos(x1: int, y1: int, z1: int, x2: int, y2: int, z2: int) -> List[dict]:
37-
return eval_lua(b'G:commands:M:getBlockInfos', x1, y1, z1, x2, y2, z2).take_list()
36+
def getBlockInfos(
37+
x1: int, y1: int, z1: int, x2: int, y2: int, z2: int,
38+
) -> List[dict]:
39+
return eval_lua(
40+
b'G:commands:M:getBlockInfos', x1, y1, z1, x2, y2, z2,
41+
).take_list()

computercraft/cc/disk.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def getMountPath(side: str) -> Optional[str]:
3030
return eval_lua(b'G:disk:M:getMountPath', side).take_option_string()
3131

3232

33-
def setLabel(side: str, label: Optional[str]):
33+
def setLabel(side: str, label: Optional[str]) -> None:
3434
return eval_lua(b'G:disk:M:setLabel', side, label).take_none()
3535

3636

@@ -50,13 +50,13 @@ def getAudioTitle(side: str) -> Optional[Union[bool, str]]:
5050
return eval_lua(b'G:disk:M:getAudioTitle', side).take_option_string_bool()
5151

5252

53-
def playAudio(side: str):
53+
def playAudio(side: str) -> None:
5454
return eval_lua(b'G:disk:M:playAudio', side).take_none()
5555

5656

57-
def stopAudio(side: str):
57+
def stopAudio(side: str) -> None:
5858
return eval_lua(b'G:disk:M:stopAudio', side).take_none()
5959

6060

61-
def eject(side: str):
61+
def eject(side: str) -> None:
6262
return eval_lua(b'G:disk:M:eject', side).take_none()

computercraft/cc/fs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ def isDriveRoot(path: str) -> bool:
186186

187187

188188
def complete(
189-
partialName: str, path: str, includeFiles: bool = None, includeDirs: bool = None,
189+
partialName: str, path: str,
190+
includeFiles: bool = None, includeDirs: bool = None,
190191
) -> List[str]:
191192
return eval_lua(
192193
b'G:fs:M:complete', partialName, path, includeFiles, includeDirs,

computercraft/cc/gps.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
CHANNEL_GPS = 65534
1414

1515

16-
def locate(timeout: LuaNum = None, debug: bool = None) -> Optional[Tuple[LuaNum, LuaNum, LuaNum]]:
16+
def locate(
17+
timeout: LuaNum = None, debug: bool = None,
18+
) -> Optional[Tuple[LuaNum, LuaNum, LuaNum]]:
1719
rp = eval_lua(b'G:gps:M:locate', timeout, debug)
1820
if rp.peek() is None:
1921
return None

computercraft/cc/help.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,6 @@ def topics() -> List[str]:
2929

3030

3131
def completeTopic(topicPrefix: str) -> List[str]:
32-
return eval_lua(b'G:help:M:completeTopic', topicPrefix).take_list_of_strings()
32+
return eval_lua(
33+
b'G:help:M:completeTopic', topicPrefix,
34+
).take_list_of_strings()

computercraft/cc/multishell.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ def getCount() -> int:
2323

2424

2525
def launch(environment: dict, programPath: str, *args: str) -> int:
26-
return eval_lua(b'G:multishell:M:launch', environment, programPath, *args).take_int()
26+
return eval_lua(
27+
b'G:multishell:M:launch', environment, programPath, *args,
28+
).take_int()
2729

2830

29-
def setTitle(tabID: int, title: str):
31+
def setTitle(tabID: int, title: str) -> None:
3032
return eval_lua(b'G:multishell:M:setTitle', tabID, title).take_none()
3133

3234

computercraft/cc/os.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ def getComputerLabel() -> Optional[str]:
3939
return eval_lua(b'G:os:M:getComputerLabel').take_option_string()
4040

4141

42-
def setComputerLabel(label: Optional[str]):
42+
def setComputerLabel(label: Optional[str]) -> None:
4343
return eval_lua(b'G:os:M:setComputerLabel', label).take_none()
4444

4545

46-
def run(environment: dict, programPath: str, *args: str):
46+
def run(environment: dict, programPath: str, *args: str) -> bool:
4747
return eval_lua(b'G:os:M:run', environment, programPath, *args).take_bool()
4848

4949

@@ -64,7 +64,7 @@ def captureEvent(event: str):
6464
evr.unsub(glet._task_id, event)
6565

6666

67-
def queueEvent(event: str, *params):
67+
def queueEvent(event: str, *params) -> None:
6868
return eval_lua(b'G:os:M:queueEvent', event, *params).take_none()
6969

7070

@@ -90,15 +90,15 @@ def epoch(locale=b'ingame') -> int:
9090
return eval_lua(b'G:os:M:epoch', locale).take_int()
9191

9292

93-
def sleep(seconds: LuaNum):
93+
def sleep(seconds: LuaNum) -> None:
9494
return eval_lua(b'G:os:M:sleep', seconds).take_none()
9595

9696

9797
def startTimer(timeout: LuaNum) -> int:
9898
return eval_lua(b'G:os:M:startTimer', timeout).take_int()
9999

100100

101-
def cancelTimer(timerID: int):
101+
def cancelTimer(timerID: int) -> None:
102102
return eval_lua(b'G:os:M:cancelTimer', timerID).take_none()
103103

104104

computercraft/cc/paintutils.py

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,33 @@ def loadImage(path: str) -> List[List[int]]:
2222
return eval_lua(b'G:paintutils:M:loadImage', path).take_2d_int()
2323

2424

25-
def drawPixel(x: int, y: int, color: int = None):
25+
def drawPixel(x: int, y: int, color: int = None) -> None:
2626
return eval_lua(b'G:paintutils:M:drawPixel', x, y, color).take_none()
2727

2828

29-
def drawLine(startX: int, startY: int, endX: int, endY: int, color: int = None):
30-
return eval_lua(b'G:paintutils:M:drawLine', startX, startY, endX, endY, color).take_none()
29+
def drawLine(
30+
startX: int, startY: int, endX: int, endY: int, color: int = None,
31+
) -> None:
32+
return eval_lua(
33+
b'G:paintutils:M:drawLine', startX, startY, endX, endY, color,
34+
).take_none()
3135

3236

33-
def drawBox(startX: int, startY: int, endX: int, endY: int, color: int = None):
34-
return eval_lua(b'G:paintutils:M:drawBox', startX, startY, endX, endY, color).take_none()
37+
def drawBox(
38+
startX: int, startY: int, endX: int, endY: int, color: int = None,
39+
) -> None:
40+
return eval_lua(
41+
b'G:paintutils:M:drawBox', startX, startY, endX, endY, color,
42+
).take_none()
3543

3644

37-
def drawFilledBox(startX: int, startY: int, endX: int, endY: int, color: int = None):
38-
return eval_lua(b'G:paintutils:M:drawFilledBox', startX, startY, endX, endY, color).take_none()
45+
def drawFilledBox(
46+
startX: int, startY: int, endX: int, endY: int, color: int = None,
47+
) -> None:
48+
return eval_lua(
49+
b'G:paintutils:M:drawFilledBox', startX, startY, endX, endY, color,
50+
).take_none()
3951

4052

41-
def drawImage(image: List[List[int]], xPos: int, yPos: int):
53+
def drawImage(image: List[List[int]], xPos: int, yPos: int) -> None:
4254
return eval_lua(b'G:paintutils:M:drawImage', image, xPos, yPos).take_none()

computercraft/cc/rednet.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ def close(side: str = None) -> None:
3232

3333

3434
def send(receiverID: int, message: Any, protocol: str = None) -> bool:
35-
return eval_lua(b'G:rednet:M:send', receiverID, message, protocol).take_bool()
35+
return eval_lua(
36+
b'G:rednet:M:send', receiverID, message, protocol,
37+
).take_bool()
3638

3739

3840
def broadcast(message: Any, protocol: str = None) -> None:
@@ -60,7 +62,9 @@ def unhost(protocol: str) -> None:
6062
return eval_lua(b'G:rednet:M:unhost', protocol).take_none()
6163

6264

63-
def lookup(protocol: str, hostname: str = None) -> Union[Optional[int], List[int]]:
65+
def lookup(
66+
protocol: str, hostname: str = None,
67+
) -> Union[Optional[int], List[int]]:
6468
rp = eval_lua(b'G:rednet:M:lookup', protocol, hostname)
6569
if hostname is None:
6670
r = []

computercraft/cc/redstone.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ def getAnalogInput(side: str) -> int:
3939

4040

4141
def setAnalogOutput(side: str, strength: int) -> None:
42-
return eval_lua(b'G:redstone:M:setAnalogOutput', side, strength).take_none()
42+
return eval_lua(
43+
b'G:redstone:M:setAnalogOutput', side, strength,
44+
).take_none()
4345

4446

4547
def getAnalogOutput(side: str) -> int:
@@ -52,7 +54,7 @@ def getBundledInput(side: str) -> int:
5254
return eval_lua(b'G:redstone:M:getBundledInput', side).take_int()
5355

5456

55-
def setBundledOutput(side: str, colors: int):
57+
def setBundledOutput(side: str, colors: int) -> None:
5658
return eval_lua(b'G:redstone:M:setBundledOutput', side, colors).take_none()
5759

5860

0 commit comments

Comments
 (0)