-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0b30bbb
commit 7f45426
Showing
29 changed files
with
1,115 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
import os | ||
import webview | ||
|
||
import run | ||
|
||
|
||
from time import sleep | ||
from structured import copy_move_setup | ||
import run | ||
|
||
########################################### | ||
########################################### | ||
|
||
dirname = os.path.dirname(__file__) | ||
|
||
########################################### | ||
########################################### | ||
|
||
def on_bridge(window): | ||
# Fire the onbridge function which indicates pywebview is ready | ||
window.evaluate_js("if(window.onbridge){window.onbridge();}") | ||
|
||
|
||
|
||
|
||
########################################## | ||
#############Javascript_Entry############# | ||
########################################## | ||
|
||
|
||
|
||
class Api: | ||
def importsteam(self): | ||
response = run.importsteam() | ||
return response | ||
|
||
def install(self, id): | ||
run.install_process(id) | ||
|
||
def printer(self, val): | ||
print(val) | ||
return val | ||
|
||
|
||
# Api.install('', 63) | ||
|
||
# test install above uncomment | ||
|
||
########################################## | ||
#############Start Pywebview Html######### | ||
########################################## | ||
|
||
|
||
|
||
api = Api() | ||
window = webview.create_window('GEO11', | ||
'libber\index.html', | ||
js_api=api, | ||
width=1250, | ||
height=900) | ||
webview.start(on_bridge, window) | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
################################################## | ||
##################1/14/22 below################### | ||
################################################## | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
# def checker(window): | ||
# pass | ||
# lib = parse.main() | ||
# vals = '' | ||
# for i in lib[0]: | ||
# vals = vals + str(js.javascript(str(i.name), str(i.exe), str(i.path))) | ||
|
||
# try: | ||
# elements = window.get_elements('tabler') | ||
# elements[0]['innerHTML'] = vals | ||
|
||
# except: | ||
# pass | ||
# # lib = parse.main() | ||
# vals = '' | ||
# for i in lib[0]: | ||
# if i.longpath != 'xxxx': | ||
# val = js.javascript(str(i.name), str(i.exe), str(i.path)) | ||
# vals = vals + val | ||
|
||
# try: | ||
# elements = window.get_elements('tabler') | ||
# elements[0]['innerHTML'] = vals | ||
|
||
# except: | ||
# print('') | ||
|
||
# time.sleep(0.1) | ||
# storage = vals | ||
|
||
########################################## | ||
########################################## | ||
########################################## | ||
|
||
|
||
# def importsteam(): | ||
# try: | ||
# test = SqL.test() | ||
# insert_html = SqL.initial_retrieve() | ||
# print('log place 1') | ||
# print(insert_html[1]) | ||
# | ||
# except: | ||
# lib = parse.main() # parse steam library | ||
# SqL.loop_insert(lib) # save to sql | ||
# insert_html = js.Import.run(lib) | ||
# print("\nError: Database already exists") | ||
# response = {'message': insert_html} | ||
# return response | ||
|
||
|
||
# def install_process(id): | ||
# | ||
# msgbox("Installing...") | ||
# try: | ||
# install_game = SqL.get_game_details(id) | ||
# except: | ||
# msgbox("Error, game not found") | ||
# if install_game == 1: | ||
# msgbox("this game is already installed") | ||
# else: | ||
# # game_deets[0] = path, [1] = name | ||
# saucedest = move_copy(install_game) | ||
# | ||
# utilities.installer(saucedest[0], saucedest[1]) | ||
# | ||
# msgbox("Complete! \nFind the Geo11 Launcher to play. ") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#sqlbuilder | ||
|
||
from peewee import * | ||
|
||
|
||
db = SqliteDatabase('games.db') | ||
|
||
|
||
class Game(Model): | ||
game = CharField() | ||
exe = CharField() | ||
path = CharField() | ||
longpath = CharField() | ||
i_d = IntegerField() | ||
|
||
class Meta: | ||
database = db # This model uses the "people.db" database. | ||
|
||
|
||
def add_game(game, exe, path, longpath, i_d): | ||
try: | ||
Game.create(game=game, exe=exe, path=path, longpath=longpath, i_d=i_d) | ||
except IntegrityError: | ||
pass | ||
|
||
def loop_insert(lib): | ||
for i in lib: | ||
add_game(i.name, i.exe, i.path, i.longpath, i.id) | ||
|
||
db.connect() | ||
db.create_tables([Game]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import sys | ||
from cx_Freeze import setup, Executable | ||
|
||
|
||
build_exe_options = { | ||
"packages": ["os", "sys"], | ||
"excludes": ["tkinter"], | ||
"includes": ["pysimplegui"] # <-- Include easy_gui | ||
} | ||
|
||
base = None | ||
if sys.platform == "win32": | ||
base = "Win32GUI" | ||
|
||
|
||
setup( | ||
name = "Geo11_MM", | ||
version = "0.1", | ||
description = "My GUI application!", | ||
icon = "C:\\Users\\dower\\Documents\\virtual-reality.ico", | ||
options = {"build_exe": build_exe_options}, | ||
executables = [Executable("geo11_mm.py", base=base)]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class Path: | ||
game = 'c' | ||
p = '' | ||
|
||
test = Path() | ||
|
||
test.p = 'a' | ||
|
||
print(test.p) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
from structured import VParse as V | ||
import os.path | ||
import shutil | ||
import json | ||
import time | ||
|
||
import subprocess | ||
global dirname | ||
dirname = os.path.dirname(__file__) | ||
directory = os.path.dirname(__file__) | ||
|
||
appinfo = r'C:\Program Files (x86)\Steam\appcache\appinfo.vdf' | ||
|
||
def dirnam(path): | ||
global dirname | ||
dirname = path | ||
return dirname | ||
# class Library(): | ||
# # profile = data['Datasets'][400]['Data']['appinfo'] | ||
# def __init__(self, exe, dir, path, name): | ||
# self.exe = exe | ||
# self.name = name | ||
# self.dir = dir | ||
# # `self` is a reference to the current instance of the class. | ||
# self.path = path | ||
|
||
def main(): | ||
global dirname | ||
dirname = dirnam(os.path.dirname(__file__)) | ||
list = [] | ||
# Checking if the appinfo.vdf file is in the directory. | ||
if V.moveV(directory): | ||
|
||
time.sleep(0.2) | ||
# Calling the cmd4 function in the VParse.py file. | ||
list = V.cmd4(directory) | ||
gamedic = V.parser(list) # Parsing the list of games and their information. | ||
|
||
# Creating a list of objects. | ||
lib = V.constructor(gamedic) | ||
# A list of all the paths to the games. | ||
paths = V.callLibrary(lib) | ||
if paths == False: | ||
print('\n\nNo paths found.') | ||
time.sleep(5) | ||
return | ||
# Checking if the path to the game is valid. | ||
lib = V.pathValidator(paths, lib) | ||
with open('output1.txt', 'w') as f: | ||
f.write(str(lib)) | ||
# # Writing the data to a file. | ||
V.writer(lib, directory) | ||
print('\n\n\nComplete! Open the text file next to this app just generated. Find Output.txt') | ||
time.sleep(5) | ||
else: | ||
print('\n\nClosing now. No appinfo.vdf file found.') | ||
|
||
########last_working############## The last working code. | ||
|
||
# list = [] | ||
# V.moveV(directory) | ||
# time.sleep(0.5) | ||
# # Calling the cmd4 function in the VParse.py file. | ||
|
||
# list = V.cmd4(directory) | ||
# gamedic = V.parser(list) | ||
# val = V.constructor(gamedic) | ||
# V.writer(gamedic, directory) | ||
# V.writer(ar) | ||
############################################### | ||
|
||
|
||
# f'{VDFexe} {appinfo} --pretty >output.json' | ||
# | ||
# # A special variable in Python that gets assigned the name of the module. | ||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.