瀏覽代碼

fix: if NONE DATA

micha 2 月之前
父節點
當前提交
f23ac10e80
共有 1 個文件被更改,包括 9 次插入1 次删除
  1. 9 1
      tkray/fix.py

+ 9 - 1
tkray/fix.py

@@ -248,13 +248,21 @@ while not pyray.window_should_close():
         p=0
         keys = []
         host_list = {}
+        if not DATA:
+            DATA = {}
+            print("mc.get ist NONE")
+            pyray.draw_text_ex(font25,"ERR:{NO DATA}",[10,5], 25, 0,  pyray.VIOLET)
+            pyray.end_drawing()
+            time.sleep(0.5)
+            continue
+
         for k in DATA:
             #print(k,DATA[k])
             #print(k)
             keys.append(k)
             host_list[k] = DATA[k] #[0]).ljust(" ",18) #,0,"=",0]
         keys.sort()
-
+        
         k=keys[0]
 
         if cur is None: