浏览代码

[server][edit][main]

zhangwei 3 年之前
父节点
当前提交
7777bd0534
共有 1 个文件被更改,包括 24 次插入5 次删除
  1. 24 5
      server/main.py

+ 24 - 5
server/main.py

@@ -1,5 +1,4 @@
 import os
-import flask
 import requests
 import json
 import time
@@ -221,17 +220,37 @@ def get_branch():
         "cd "+current_path+ ";"
         "git clone https://git.yishihui.com/weapp/longVideoFactory.git;"
         "cd longVideoFactory;"
-        "git branch -a;"
+        "git pull;"   
+    )
+    os.system(command_str)
+
+    command_str= (
+        "cd "+current_path+ ";"
+        "cd longVideoFactory;"
+        "git branch -r;"
     )
     f_read = os.popen(command_str).read()
 
     branch_list = []
     for item in f_read.split():
-        if "->" not in item and "origin/master" not in item and "HEAD" not in item and "*" not in item:
-            branch_list.append(item.replace("remotes/origin/",""))
+        if "->" not in item and "HEAD" not in item and "*" not in item:
+            branch_list.append(item.replace("origin/",""))
 
     res = {"code":0,"data":branch_list}
     return res
 
 if __name__ == '__main__':
-    app.run(host='0.0.0.0', port=7777, debug=False)
+    app.run(host='0.0.0.0', port=7777, debug=False)
+
+
+# token = tenant_access_token_by_feishu()
+# headers = {
+#     "Authorization":"Bearer "+token,
+#     "Content-Type": "application/json;charset=UTF-8"
+# }
+# url = "https://open.feishu.cn/open-apis/im/v1/chats"
+# res = requests.post(url,headers=headers).json()
+# print(res)
+
+# https://open.feishu.cn/open-apis/bot/v2/hook/a243326f-90cf-4a70-ba26-a6b202710971
+# https://open.feishu.cn/open-apis/bot/v2/hook/a924b6a5-86ef-4c76-a7e4-eb42056f70cc