Tidy support string creation and include as comment

This commit is contained in:
Zedifus 2022-08-26 15:57:35 +01:00
parent d3b7ab048d
commit b8b61649b7

View File

@ -178,18 +178,18 @@ class Controller:
) )
# Make version file .txt when we download it for support # Make version file .txt when we download it for support
# Most people have a default editor for .txt also more mobile friendly... # Most people have a default editor for .txt also more mobile friendly...
FileHelpers.copy_file( sys_info_string = (
os.path.join(self.project_root, "app", "config", "version.json"), f"Crafty v{self.helper.get_version_string()} Support Logs\n"
os.path.join(temp_dir, "crafty_sys_info.txt"), f"\n"
f"OS Info: \n"
f"OS: {str(platform.system())}\n"
f"Version: {str(platform.release())}"
) )
with open( with open(
os.path.join(temp_dir, "crafty_sys_info.txt"), "a", encoding="utf-8" os.path.join(temp_dir, "crafty_sys_info.txt"), "a", encoding="utf-8"
) as f: ) as f:
f.write("\n") f.write(sys_info_string)
f.write("OS Info:\n") FileHelpers.make_compressed_archive(temp_zip_storage, temp_dir, sys_info_string)
f.write("OS: " + str(platform.system()) + "\n")
f.write("Version: " + str(platform.release()))
FileHelpers.make_compressed_archive(temp_zip_storage, temp_dir)
if len(self.helper.websocket_helper.clients) > 0: if len(self.helper.websocket_helper.clients) > 0:
self.helper.websocket_helper.broadcast_user( self.helper.websocket_helper.broadcast_user(
exec_user["user_id"], exec_user["user_id"],