Skip to content

Commit a956418

Browse files
MarkKoz64json
authored andcommitted
Change kwargs to args for command()
1 parent 29bb53a commit a956418

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

algorithm_visualizer/commander.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ class Commander:
1212
_objectCount = 0
1313
commands: List[Dict[str, Any]] = []
1414

15-
def __init__(self, **kwargs):
15+
def __init__(self, *args):
1616
self._objectCount += 1
17-
self.command(self.__class__.__name__, **kwargs)
17+
self.command(self.__class__.__name__, *args)
1818

1919
@classmethod
20-
def command(cls, method: str, key: str = _keyRandomizer.create(), **kwargs):
20+
def command(cls, method: str, *args, key: str = _keyRandomizer.create()):
2121
cmd = {
2222
"key": key,
23-
"method": method
23+
"method": method,
24+
"args": args
2425
}
25-
cmd.update(kwargs)
2626
cls.commands.append(cmd)
2727

2828
if len(cls.commands) > _MAX_COMMANDS:

algorithm_visualizer/tracer.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33

44
class Tracer(Commander):
55
def __init__(self, title: str = None):
6-
super().__init__(title=title or {})
6+
if title is None:
7+
super().__init__()
8+
else:
9+
super().__init__(title)
710

811
@classmethod
912
def delay(cls, lineNumber: int = None):
10-
cls.command("delay", lineNumber=lineNumber or {})
13+
cls.command("delay", lineNumber)
1114

1215
@classmethod
1316
def set(cls):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy