Skip to content

Commit

Permalink
UPD
Browse files Browse the repository at this point in the history
  • Loading branch information
Dartvauder committed Nov 14, 2024
1 parent 3672c6b commit 5e1927f
Show file tree
Hide file tree
Showing 12 changed files with 140 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ python -m venv venv
call venv\Scripts\activate
python -m pip install --upgrade pip setuptools
pip install wheel
pip install -r requirements.txt
pip install -r TechicalFiles/requirements.txt
timeout /t 2 /nobreak >nul
cls

Expand Down
2 changes: 1 addition & 1 deletion Install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ python -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip setuptools
pip install wheel
pip install -r requirements.txt
pip install -r TechicalFiles/requirements.txt
sleep 2
clear

Expand Down
3 changes: 1 addition & 2 deletions config.ini → TechicalFiles/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
language = en
ngrok_token =
theme = dark
region = eu

region = eu
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions ui.py → TechicalFiles/ui.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import tkinter as tk
from tkinter import messagebox, simpledialog, filedialog, ttk
from ngrok_manager import NgrokManager
from TechicalFiles.ngrok_manager import NgrokManager
import json
import webbrowser
from configparser import ConfigParser
import subprocess

with open("translations.json", "r", encoding="utf-8") as f:
with open("TechicalFiles/translations.json", "r", encoding="utf-8") as f:
translations = json.load(f)

manager = None
Expand All @@ -18,7 +18,7 @@ def __init__(self, root):
self.root.title("NgrokManager")

self.config = ConfigParser()
self.config.read('config.ini')
self.config.read('TechicalFiles/config.ini')

self.language = self.config.get('general', 'language', fallback='en')
self.theme = self.config.get('general', 'theme', fallback='dark')
Expand Down Expand Up @@ -141,19 +141,19 @@ def open_web_inspection(self):
def change_region(self, event=None):
self.region = self.region_var.get()
self.config.set('general', 'region', self.region)
with open('config.ini', 'w') as configfile:
with open('TechicalFiles/config.ini', 'w') as configfile:
self.config.write(configfile)

def create_tunnel(self):
token = self.token_entry.get()
region = self.region_var.get()

self.config.set('general', 'ngrok_token', token)
with open('config.ini', 'w') as configfile:
with open('TechicalFiles/config.ini', 'w') as configfile:
self.config.write(configfile)

self.config.set('general', 'region', region)
with open('config.ini', 'w') as configfile:
with open('TechicalFiles/config.ini', 'w') as configfile:
self.config.write(configfile)

global manager
Expand Down Expand Up @@ -214,7 +214,7 @@ def open_tunnel_url(self, event):
def change_language(self, event=None):
self.language = self.language_var.get()
self.config.set('general', 'language', self.language)
with open('config.ini', 'w') as configfile:
with open('TechicalFiles/config.ini', 'w') as configfile:
self.config.write(configfile)

self.t = translations.get(self.language, translations["en"])
Expand All @@ -223,7 +223,7 @@ def change_language(self, event=None):
def change_theme(self, event=None):
self.theme = self.theme_var.get()
self.config.set('general', 'theme', self.theme)
with open('config.ini', 'w') as configfile:
with open('TechicalFiles/config.ini', 'w') as configfile:
self.config.write(configfile)

bg_color = "#2e2e2e" if self.theme == "dark" else "#ffffff"
Expand Down
2 changes: 1 addition & 1 deletion Update.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ call venv\Scripts\activate
echo Updating Application...
python -m pip install --upgrade pip setuptools
pip install wheel
pip install -r requirements.txt
pip install -r TechicalFiles/requirements.txt
timeout /t 2 /nobreak >nul
cls

Expand Down
2 changes: 1 addition & 1 deletion Update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ python -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip setuptools
pip install wheel
pip install -r requirements.txt
pip install -r TechicalFiles/requirements.txt
sleep 2
clear

Expand Down
64 changes: 64 additions & 0 deletions Venv.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
@echo off
chcp 65001 > NUL

call venv\Scripts\activate

echo Virtual environment activated
echo.
echo Available options:
echo 1. Install package
echo 2. Uninstall package
echo 3. Upgrade package
echo 4. List installed packages
echo 5. Show package details
echo 6. Check dependencies
echo 7. Debug information
echo 8. Exit
echo.

:menu
set /p choice="Enter your choice (1-8): "

if "%choice%"=="1" (
set /p package="Enter package name to install: "
pip install %package%
goto menu
)
if "%choice%"=="2" (
set /p package="Enter package name to uninstall: "
pip uninstall %package%
goto menu
)
if "%choice%"=="3" (
set /p package="Enter package name to upgrade: "
pip install --upgrade %package%
goto menu
)
if "%choice%"=="4" (
pip list
echo.
goto menu
)
if "%choice%"=="5" (
set /p package="Enter package name to show details: "
pip show %package%
echo.
goto menu
)
if "%choice%"=="6" (
pip check
echo.
goto menu
)
if "%choice%"=="7" (
pip debug --verbose
echo.
goto menu
)
if "%choice%"=="8" (
deactivate
exit
)

echo Invalid choice. Please try again.
goto menu
61 changes: 61 additions & 0 deletions Venv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/bin/bash

source venv/bin/activate

echo "Virtual environment activated"
echo

while true; do
echo "Available options:"
echo "1. Install package"
echo "2. Uninstall package"
echo "3. Upgrade package"
echo "4. List installed packages"
echo "5. Show package details"
echo "6. Check dependencies"
echo "7. Debug information"
echo "8. Exit"
echo

read -p "Enter your choice (1-8): " choice

case $choice in
1)
read -p "Enter package name to install: " package
pip install $package
;;
2)
read -p "Enter package name to uninstall: " package
pip uninstall $package
;;
3)
read -p "Enter package name to upgrade: " package
pip install --upgrade $package
;;
4)
pip list
echo
;;
5)
read -p "Enter package name to show details: " package
pip show $package
echo
;;
6)
pip check
echo
;;
7)
pip debug --verbose
echo
;;
8)
deactivate
exit 0
;;
*)
echo "Invalid choice. Please try again."
;;
esac
echo
done
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import tkinter as tk
from configparser import ConfigParser
from ui import NgrokApp
from TechicalFiles.ui import NgrokApp

config = ConfigParser()
config.read('config.ini')
config.read('TechicalFiles/config.ini')

language = config.get('general', 'language', fallback='en')

Expand Down

0 comments on commit 5e1927f

Please sign in to comment.