Bladeren bron

code update

dukuisong 1 dag geleden
bovenliggende
commit
16e27fe291
3 gewijzigde bestanden met toevoegingen van 6 en 5 verwijderingen
  1. 4 2
      api/api_app.py
  2. 1 2
      api/ws_app.py
  3. 1 1
      readme

+ 4 - 2
api/api_app.py

@@ -504,5 +504,7 @@ def download_cloud_file():
 def start_flask(serve_client, work_path):
     app.config['serve_client'] = serve_client
     app.config['work_path'] = work_path
-
-    app.run(host='127.0.0.1', port=5855)
+    try:
+        app.run(host='127.0.0.1', port=5855)
+    except KeyboardInterrupt:
+        app.shutdown()

+ 1 - 2
api/ws_app.py

@@ -39,8 +39,7 @@ def on_message(client, server, data):
         if is_template:
             file_info = server_client.get_template_file_info(file_id)
             time_str = datetime.datetime.now().strftime('%Y-%m-%dT%H-%M-%S')
-            local_path = os.path.join(work_path,
-                                      f'{file_info["name"]}({time_str}).{file_info["nameSuffix"]}')
+            local_path = os.path.join(work_path, f'{file_info["name"]}({time_str}).{file_info["nameSuffix"]}')
 
             if server_client.download_template(file_info['fileLink'], local_path):
                 return ws_send(client, server, open_file_by_wps(local_path))

+ 1 - 1
readme

@@ -29,7 +29,7 @@ upload_file
 
 pyinstaller --onefile --noconsole --windowed --icon=../icon.ico init_wps_plug.py
 
-pyinstaller --noconsole  --windowed --add-data "static:static" --icon=icon.ico office_helper.py
+pyinstaller --noconsole --noupx --windowed --add-data "static:static" --icon=icon.ico office_helper.py
 
 
 pyinstaller --onefile --noconsole  --windowed --add-data "icon.ico;." --icon=icon.ico upload_file.py