mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 22:54:01 -06:00
Fixes for all of the plugins. Added a script to invoke mypy. (I'm stiiiick of .bat files. They are just broken.)
This commit is contained in:
parent
fb70eb6813
commit
1b43e4981e
12 changed files with 62 additions and 20 deletions
31
run_mypy.py
Normal file
31
run_mypy.py
Normal file
|
@ -0,0 +1,31 @@
|
|||
#!env python
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
os.putenv("MYPYPATH", r".;.\plugins;..\Uranium_hint\;..\Uranium_hint\stubs\\" )
|
||||
|
||||
def findModules(path):
|
||||
result = []
|
||||
for entry in os.scandir(path):
|
||||
if entry.is_dir() and os.path.exists(os.path.join(path, entry.name, "__init__.py")):
|
||||
result.append(entry.name)
|
||||
return result
|
||||
|
||||
plugins = findModules("plugins")
|
||||
plugins.sort()
|
||||
|
||||
mods = ["cura"] + plugins
|
||||
|
||||
for mod in mods:
|
||||
print("------------- Checking module {mod}".format(**locals()))
|
||||
result = subprocess.run(["python", r"c:\python35\Scripts\mypy", "-p", mod])
|
||||
if result.returncode != 0:
|
||||
print("""
|
||||
Module {mod} failed checking. :(
|
||||
""".format(**locals()))
|
||||
break
|
||||
else:
|
||||
print("""
|
||||
|
||||
Done checking. All is good.
|
||||
""")
|
Loading…
Add table
Add a link
Reference in a new issue