Skip to content

Commit af9d5b7

Browse files
committed
refactor: minor changes for pylance
1 parent f8beec7 commit af9d5b7

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

docs/Todo.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
### Low Priority
1414

1515
- [x] Refactor self giving to cmds
16-
- [ ] Add precompilation of cmds dir
1716
- [ ] Publish as python lib
1817

1918
### Suspended
19+
20+
- [ ] Add precompilation of cmds dir

scr/commands/obfuscation/obfuscate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ def ObfuscateFiles(self):
207207
self.obfuscation.ProtectFile(self.options["--output"], filepath+sep+filename)
208208

209209
def SaveFile(self, filename, filepath, content, entrypoint = False):
210+
imports = ""
210211
if entrypoint:
211-
imports = ""
212212
for module in self.imports:
213213
imports+=f"import {module}\n"
214214

scr/pyshield.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ def ParseArgs(self):
4343
except Exception as error:
4444
Log.Fail(f"Options parsing failed: {error}", True)
4545

46-
def GetCommand(self, name):
47-
command = self.SearchCommand(name, f"{path.dirname(path.abspath(__file__))}/commands/")
46+
def GetCommand(self, name) -> Command:
47+
command: Command = self.SearchCommand(name, f"{path.dirname(path.abspath(__file__))}/commands/")
4848
if not command:
4949
raise Exception(f"invalid command name: \"{name}\".")
5050

5151
return command
5252

53-
def SearchCommand(self, name: str, path: str):
53+
def SearchCommand(self, name: str, path: str) -> Command:
5454
for dirpath, dirnames, filenames in walk(path):
5555
for filename in filenames:
5656
if filename.endswith(".py") and filename != "__init__.py":
@@ -62,7 +62,7 @@ def SearchCommand(self, name: str, path: str):
6262
try:
6363
spec.loader.exec_module(module)
6464
for cmdName in dir(module):
65-
command = getattr(module, cmdName)
65+
command: Command = getattr(module, cmdName)
6666
if (isclass(command) and
6767
not isabstract(command) and
6868
issubclass(command, Command) and

0 commit comments

Comments
 (0)