From 51b114871ced554b13bf3087a3c1fcda76494643 Mon Sep 17 00:00:00 2001 From: Hexye <65314629+HexyeDEV@users.noreply.github.com> Date: Sun, 20 Feb 2022 22:02:16 +0100 Subject: [PATCH] Delete src directory --- src/EzPython.py | 103 ------------------------------------------------ src/update.py | 28 ------------- src/version.txt | 1 - 3 files changed, 132 deletions(-) delete mode 100644 src/EzPython.py delete mode 100644 src/update.py delete mode 100644 src/version.txt diff --git a/src/EzPython.py b/src/EzPython.py deleted file mode 100644 index 93e3be4..0000000 --- a/src/EzPython.py +++ /dev/null @@ -1,103 +0,0 @@ -from cProfile import label -from tkinter import Tk as tk -from tkinter import Toplevel, Button, Label, Entry, messagebox -import os - -from click import edit - -window = tk() - -# Commands -def new_file(filename, entry): - entry.delete(0, 'end') - open(filename + ".py", 'a').close() - messagebox.showinfo("New File", "New file created") - -def add_print(text, filename, entry): - file = open(filename, 'a') - entry.delete(0, 'end') - file.write(f"print(f\"{text}\")" + "\n") - file.close() - messagebox.showinfo("Add text on Console", "Text on Console added", parent=editwindow) - -def add_variable(variable, filename, entry): - file = open(filename, 'a') - entry.delete(0, 'end') - var = variable.split(",")[0] - val = variable.split(",")[1].replace(" ", "") - try: - val = int(val) - except: - try: - val = float(val) - except: - val = "\"" + val + "\"" - file.write(f"{var} = {val}" + "\n") - file.close() - messagebox.showinfo("Add variable", "Variable added", parent=editwindow) - -def add_input(variable, filename, entry): - file = open(filename, 'a') - entry.delete(0, 'end') - var = variable.split(",")[0] - val = variable.split(",")[1].replace(" ", "") - file.write(f"{var} = input(\"{val}\")" + "\n") - file.close() - messagebox.showinfo("Add input", "Input added", parent=editwindow) - - -def open_file(filename, entry): - entry.delete(0, 'end') - global window - try: - global editwindow - editwindow = Toplevel(window) - editwindow.title(filename[:-3]) - editwindow.geometry("750x750") - editwindow.resizable(False, False) - editwindow.configure(background="#bebebe") - Label(editwindow, text=filename[:-3], font=("Arial", 20), bg="#bebebe").pack() - Label(editwindow, text="", bg="#bebebe").pack() - Label(editwindow, text="Text to show on Console (use {variable_name} to show a variable)", bg="#bebebe").pack() - textprint = Entry(editwindow) - textprint.pack() - Button(editwindow, text="Add text on Console", command=lambda: add_print(textprint.get(), filename, textprint)).pack() - Label(editwindow, text="", bg="#bebebe").pack() - Label(editwindow, text="Create Variable (write: variable_name, variable value)", bg="#bebebe").pack() - addvariable = Entry(editwindow) - addvariable.pack() - Button(editwindow, text="Add variable", command=lambda: add_variable(addvariable.get(), filename, addvariable)).pack() - Label(editwindow, text="", bg="#bebebe").pack() - Label(editwindow, text="Add input Variable (write: variable_name, Input String)", bg="#bebebe").pack() - addinput = Entry(editwindow) - addinput.pack() - Button(editwindow, text="Add input", command=lambda: add_input(addinput.get(), filename, addinput)).pack() - except: - messagebox.showerror("Open File", "File not found") - -def update(window): - window.destroy() - os.system("python3 update.py") - exit() - - - -window.geometry("750x750") -window.title("EzPython") -window.resizable(False, False) -window.configure(background="#bebebe") -Label(window, text="EzPython", font=("Arial", 20), bg="#bebebe").pack() -Label(window, text="", bg="#bebebe").pack() -Label(window, text="New File Name", bg="#bebebe").pack() -filename = Entry(window) -filename.pack() -Button(window, text="New File", command=lambda: new_file(filename.get().replace(" ", "_"), filename)).pack() -Label(window, text="", bg="#bebebe").pack() -Label(window, text="Open File Name", bg="#bebebe").pack() -openfilename = Entry(window) -openfilename.pack() -Button(window, text="Open File", command=lambda: open_file(openfilename.get().replace(" ", "_") + ".py", openfilename)).pack() -Label(window, text="", bg="#bebebe").pack() -Button(window, text="Update Software", command=lambda: update(window)).pack() - -window.mainloop() \ No newline at end of file diff --git a/src/update.py b/src/update.py deleted file mode 100644 index 9a8f007..0000000 --- a/src/update.py +++ /dev/null @@ -1,28 +0,0 @@ -from tkinter import Tk as tk -from tkinter import Label, messagebox -import requests, os - -window = tk() -window.title("Update") -window.geometry("500x500") -window.resizable(False, False) -window.configure(background="#bebebe") -Label(window, text="Update", font=("Arial", 20), bg="#bebebe").pack() -Label(window, text="", bg="#bebebe").pack() -Label(window, text="Looking for updates...", bg="#bebebe").pack() -req = requests.get("https://raw.githubusercontent.com/HexyeDEV/EzPython/main/version.json").json() - -current_version = open("version.txt", "r").read() -f = open("version.txt", "w") - -if req['version'] != current_version: - messagebox.showinfo("Update", "Update available, Installing it Now") - f.write(req['version']).close() - new_file = requests.get("https://raw.githubusercontent.com/HexyeDEV/EzPython/main/src/EzPython.py").text - open("EzPython.py", 'w').write(new_file).close() - messagebox.showinfo("Update", "Update installed") - exit() -else: - messagebox.showinfo("Update", "No updates available") - os.system("python3 EzPython.py") - exit() diff --git a/src/version.txt b/src/version.txt deleted file mode 100644 index 4e379d2..0000000 --- a/src/version.txt +++ /dev/null @@ -1 +0,0 @@ -0.0.2