Browse Source

fix: DemoShow add: test_import.py check

micha 1 year ago
parent
commit
08de5cfb8c
2 changed files with 62 additions and 4 deletions
  1. 4 4
      _LibreLightDesk.py
  2. 58 0
      test/test_import.py

+ 4 - 4
_LibreLightDesk.py

@@ -2261,7 +2261,7 @@ class Base():
         self._init()
 
     def _init(self):
-        show_name = "ErrorRead-init.txt"
+        show_name = "" #DemoShow #"ErrorRead-init.txt"
         self.show_path0 = HOME +"/LibreLight/"
         self.show_path  = self.show_path0 
         self.show_path1 = self.show_path0 + "show/"
@@ -5177,7 +5177,7 @@ if __run_main:
 
     name = "SETUP"
     args = {"title":name +" SHOW:"+master.base.show_name,
-                "master":0,"width":445,"height":42,"left":L1+10+W1,"top":TOP,"resize":0}
+                "master":0,"width":445,"height":42,"left":L1+10+W1,"top":TOP,"resize":10}
     args["title"]  = "SETUP SHOW:"+master.base.show_name
     geo = split_window_position(pos_list,name)
     try:
@@ -5199,7 +5199,7 @@ if __run_main:
 
 
     name = "COMMAND"
-    args = {"title":name,"master":0,"width":415,"height":130,"left":L1+10+W1,"top":TOP+81,"resize":0}
+    args = {"title":name,"master":0,"width":415,"height":130,"left":L1+10+W1,"top":TOP+81,"resize":10}
     geo = split_window_position(pos_list,name)
     if geo:
         args.update(geo)
@@ -5213,7 +5213,7 @@ if __run_main:
         window_manager.top(name)
 
     name = "LIVE"
-    args = {"title":name,"master":0,"width":415,"height":42,"left":L1+10+W1,"top":TOP+235,"resize":0}
+    args = {"title":name,"master":0,"width":415,"height":42,"left":L1+10+W1,"top":TOP+235,"resize":10}
     geo = split_window_position(pos_list,name)
     if geo:
         args.update(geo)

+ 58 - 0
test/test_import.py

@@ -0,0 +1,58 @@
+#!/use/bin/python3
+
+import os
+import importlib
+
+# check all sourcefiles
+# if python module is indtalled 
+
+cmd='grep -r -I "import " . | cut -d ":" -f 2-99 | sort | uniq ' #| sort -h | grep -v "from \|lib\|tkgui\|tksdl"'
+r=os.popen(cmd)
+data = {}
+for line in r.readlines():
+    line = line.strip()
+    if line.startswith("#"):
+        continue
+
+    #print(line)
+    line = line.split()
+    module = line[1]
+    module = module.split(",")[0] #.replace(",","")
+    module = module.replace(";","")
+
+    if module.startswith("-"):
+        continue
+    if module.startswith("_"):
+        continue
+    if "." in module:
+        continue
+    if module.startswith("lib"):
+        continue
+    if "nodesca" in module:
+        continue
+
+    if module not in data:
+        data[module] = []
+    data[module].append(line)
+
+err = []
+ok = []
+for module in data:
+    if importlib.util.find_spec(module):
+        ok.append(module)
+    else:
+        err.append(module)
+
+print()
+ok.sort()
+err.sort()
+
+for i in ok:
+    print((i +" OK").rjust(20," "))
+print()
+for i in err:
+    #print(i,"ERR")
+    print((i +" ERR").rjust(20," "))
+print("OK",len(ok),"ERR",len(err))
+print()
+#print(dir())