wip package install
This commit is contained in:
parent
ec63a1ecb9
commit
c1f5e027ea
3 changed files with 26 additions and 3 deletions
|
@ -101,7 +101,7 @@ def download_all_packages(progress_bar, progress_label, download_location, insta
|
|||
traceback.print_exc()
|
||||
progress_label.set_text(f"Error processing {app_name}: {e}")
|
||||
print(f"Error processing {app_name}: {e}")
|
||||
install_main.install_all_packages()
|
||||
install_main.install_all_packages(data)
|
||||
except FileNotFoundError:
|
||||
progress_label.set_text(f"Config file not found.")
|
||||
print("Config file not found.")
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
|
||||
import json_main
|
||||
|
||||
def install_all_packages():
|
||||
print("installing!")
|
||||
def install_all_packages(data):
|
||||
|
||||
json_main.check_package_consistency(data)
|
||||
|
||||
print("installing!")
|
||||
|
||||
def install_package():
|
||||
|
|
|
@ -58,6 +58,23 @@ def save_package(version, app, source_type, source_info, package_type):
|
|||
with open(data_location, 'w') as file:
|
||||
json.dump(data, file, indent=2)
|
||||
|
||||
def check_package_consistency(data):
|
||||
browser_count = 0
|
||||
style_count = 0
|
||||
|
||||
for package in data.get("packages", []):
|
||||
for app, app_data in package.items():
|
||||
if app_data["type"] == "browser":
|
||||
browser_count += 1
|
||||
elif app_data["type"] == "style":
|
||||
style_count += 1
|
||||
|
||||
if browser_count == 1 and style_count <= 1:
|
||||
return True
|
||||
else:
|
||||
print("Warning: Inconsistent package counts.")
|
||||
return False
|
||||
|
||||
# This function will get the package information for the given app.
|
||||
# If the app is not in .json, return an empty dictionary.
|
||||
def get_package(app):
|
||||
|
|
Reference in a new issue