RMaixtr 1 year ago
parent
commit
3f5e0751a6
2 changed files with 14 additions and 3 deletions
  1. 5 0
      backup/preset/app/checkout.py
  2. 9 3
      backup/preset/app/pull.py

+ 5 - 0
backup/preset/app/checkout.py

@@ -29,6 +29,11 @@ class NewStream(RawIOBase):
 
 git.rw()
 steam = NewStream()
+image.load_freetype("/root/preset/fonts/simhei.ttf")
+hello_img = image.new(size=(320, 240), color=(0, 0, 0),
+                      mode="RGB")  # 创建一张黑色背景图
+hello_img.draw_string(10, 115,'Start', scale=1.0, color=(255, 255, 255),
+                      thickness=1)  # 在黑色背景图上写下hello world
 if os.path.exists(localrep + "/cclb_launch"):
     os.remove(localrep + "/cclb_launch")
 if git.activeBranch(localrep) != b'master':

+ 9 - 3
backup/preset/app/pull.py

@@ -20,15 +20,21 @@ class NewStream(RawIOBase):
 
     def write(self, b):
         hello_img = image.new(size=(320, 240), color=(0, 0, 0),
-                              mode="RGB")  # 创建一张黑色背景图
+                              mode="RGB")
         hello_img.draw_string(10, 115, str(b), scale=1.0, color=(255, 255, 255),
-                              thickness=1)  # 在黑色背景图上写下hello world
-        display.show(hello_img)  # 把这张图显示出来
+                              thickness=1)
+        display.show(hello_img)
         return None
 
 
 git.rw()
 steam = NewStream()
+image.load_freetype("/root/preset/fonts/simhei.ttf")
+hello_img = image.new(size=(320, 240), color=(0, 0, 0),
+                      mode="RGB")  # 创建一张黑色背景图
+hello_img.draw_string(10, 115,'Start', scale=1.0, color=(255, 255, 255),
+                      thickness=1)  # 在黑色背景图上写下hello world
+display.show(hello_img)  # 把这张图显示出来
 if os.path.exists(localrep + "/cclb_launch"):
     os.remove(localrep + "/cclb_launch")
 git.pull(localrep, steam)