Skip to content

Commit

Permalink
enter myenv before doing anything
Browse files Browse the repository at this point in the history
  • Loading branch information
KorryKatti authored Mar 14, 2024
1 parent 33a9d56 commit 85f461e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import json
import requests
from bs4 import BeautifulSoup
import customtkinter as ctk
import subprocess
import os
import shutil

def activate_virtualenv():
if os.name == 'posix': # Unix-like OS (Linux/Mac)
subprocess.run(["source", "myenv/bin/activate"], shell=True)
elif os.name == 'nt': # Windows
subprocess.run(["myenv\\Scripts\\activate.bat"], shell=True)

def read_version():
with open('config.json', 'r') as f:
config_data = json.load(f)
Expand All @@ -26,6 +31,8 @@ def close_window(window):
window.destroy()

def compare_versions():
activate_virtualenv()

# Delete the "update" folder if it exists
update_folder = "update"
if os.path.exists(update_folder):
Expand All @@ -40,7 +47,7 @@ def compare_versions():
else:
result_message = f"Software is not up to date. Initializing Update.\nLocal version: {local_version}\nExternal version: {external_version}"
else:
result_message = "Failed to retrieve external version.Continuing Either way to app"
result_message = "Failed to retrieve external version. Continuing either way to app"

# Create a customtkinter window to display the results
app = ctk.CTk()
Expand Down

0 comments on commit 85f461e

Please sign in to comment.