Upload files to 'settings'
This commit is contained in:
parent
f8d1bf6f66
commit
7c3ea84e8a
3 changed files with 233 additions and 0 deletions
104
settings/settings.py
Normal file
104
settings/settings.py
Normal file
|
@ -0,0 +1,104 @@
|
||||||
|
# THIS FILE IS A PART OF VCStudio
|
||||||
|
# PYTHON 3
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
def read(setting):
|
||||||
|
#opening the file
|
||||||
|
data = open("settings/settings.data")
|
||||||
|
data = data.read()
|
||||||
|
data = data.split("\n")
|
||||||
|
#finding the keyword
|
||||||
|
for line in data:
|
||||||
|
if line.startswith(setting):
|
||||||
|
return convert(line.replace(setting+" = ", ""))
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
|
def write(setting, value):
|
||||||
|
|
||||||
|
# Making sure that the value is string'
|
||||||
|
value = str(value)
|
||||||
|
|
||||||
|
#opening the file
|
||||||
|
data = open("settings/settings.data")
|
||||||
|
data = data.read()
|
||||||
|
data = data.split("\n")
|
||||||
|
|
||||||
|
#making a new file
|
||||||
|
ndata = open("settings/settings.data", "w")
|
||||||
|
|
||||||
|
|
||||||
|
#finding the keyword
|
||||||
|
found = False
|
||||||
|
for line in data:
|
||||||
|
if line.startswith(setting):
|
||||||
|
line = setting+" = "+str(value)
|
||||||
|
found = True
|
||||||
|
if line != "":
|
||||||
|
ndata.write(line+"\n")
|
||||||
|
|
||||||
|
if not found:
|
||||||
|
ndata.write(setting+" = "+str(value)+"\n")
|
||||||
|
|
||||||
|
|
||||||
|
ndata.close()
|
||||||
|
|
||||||
|
|
||||||
|
def list_languages():
|
||||||
|
|
||||||
|
# Getting list of available languages
|
||||||
|
all_langs = os.listdir("settings/languages/")
|
||||||
|
|
||||||
|
# Filtering all the unnesesary garbage
|
||||||
|
r = []
|
||||||
|
for lang in all_langs:
|
||||||
|
if lang.endswith(".data"):
|
||||||
|
r.append(lang.replace(".data", ""))
|
||||||
|
all_langs = sorted(r)
|
||||||
|
|
||||||
|
return all_langs
|
||||||
|
|
||||||
|
def load_all():
|
||||||
|
|
||||||
|
# This function will preload everything for the settings file into the RAM
|
||||||
|
# so if something has to be checked on every frame. I would not need to deal
|
||||||
|
# with it constantly. But rather have a ddictionary in the RAM to which I
|
||||||
|
# am going to refer at each frame / instance etc.
|
||||||
|
|
||||||
|
ret = {}
|
||||||
|
|
||||||
|
# Opening the file.
|
||||||
|
data = open("settings/settings.data")
|
||||||
|
data = data.read()
|
||||||
|
data = data.split("\n")
|
||||||
|
|
||||||
|
# Parsing the file.
|
||||||
|
for d in data:
|
||||||
|
if d:
|
||||||
|
ret[d[:d.find(" = ")]] = convert(d[d.find(" = ")+3:])
|
||||||
|
|
||||||
|
# Returning
|
||||||
|
return ret
|
||||||
|
|
||||||
|
def convert(string):
|
||||||
|
|
||||||
|
# This function will convert a string of value. Into the value it self.
|
||||||
|
# For exmple if it has float or boolean (True, False, None) data in the
|
||||||
|
# settings file. So it's gonna be easier to parse later on.
|
||||||
|
|
||||||
|
# Trying fload
|
||||||
|
try:
|
||||||
|
string = float(string)
|
||||||
|
except:
|
||||||
|
|
||||||
|
# Trying boolean
|
||||||
|
if string == "True":
|
||||||
|
string = True
|
||||||
|
elif string == "False":
|
||||||
|
string = False
|
||||||
|
elif string == "None":
|
||||||
|
string = None
|
||||||
|
# That's it
|
||||||
|
return string
|
||||||
|
|
36
settings/talk.py
Normal file
36
settings/talk.py
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
# THIS FILE IS A PART OF VCStudio
|
||||||
|
# PYTHON 3
|
||||||
|
|
||||||
|
# this file handles language
|
||||||
|
import os
|
||||||
|
from settings import settings
|
||||||
|
|
||||||
|
def text(var):
|
||||||
|
|
||||||
|
|
||||||
|
data = open("settings/languages/"+settings.read("Language")+".data")
|
||||||
|
data = data.read()
|
||||||
|
data = data.split("]")
|
||||||
|
|
||||||
|
#finding the keyword
|
||||||
|
for line in data:
|
||||||
|
if line.startswith("\n"+var):
|
||||||
|
return line.replace("\n"+var+" = [", "")
|
||||||
|
|
||||||
|
#Try English
|
||||||
|
|
||||||
|
data = open("settings/languages/English.data")
|
||||||
|
data = data.read()
|
||||||
|
data = data.split("]")
|
||||||
|
|
||||||
|
#finding the keyword
|
||||||
|
for line in data:
|
||||||
|
if line.startswith("\n"+var):
|
||||||
|
return line.replace("\n"+var+" = [", "!")
|
||||||
|
|
||||||
|
#If Couldn't Find
|
||||||
|
return "!Missing! "+var
|
||||||
|
|
||||||
|
def alert(message):
|
||||||
|
|
||||||
|
os.system("notify-send -i "+os.getcwd()+'/tinyicon.png "VCStudio" "'+message+'"')
|
93
settings/update.data
Normal file
93
settings/update.data
Normal file
|
@ -0,0 +1,93 @@
|
||||||
|
VERSION 20.113
|
||||||
|
|
||||||
|
settings/update.data
|
||||||
|
project_manager/pm_updateLayer.py
|
||||||
|
project_manager/pm_settingsLayer.py
|
||||||
|
project_manager/update_request.py
|
||||||
|
project_manager/pm_gtk.py
|
||||||
|
project_manager/pm_mainLayer.py
|
||||||
|
settings/themes/Default/icons/font.png
|
||||||
|
settings/languages/Dumbass.data
|
||||||
|
settings/languages/English.data
|
||||||
|
settings/languages/Russian.data
|
||||||
|
|
||||||
|
[https://open.lbry.com/@blender-organizer:5/Version-20.113-(UI-Settings):9?r=GLhXoQ3zcpvm6rzd9Z6dAyasTpmk1FUY]
|
||||||
|
|
||||||
|
VERSION 20.112
|
||||||
|
|
||||||
|
settings/update.data
|
||||||
|
project_manager/helpLayer.py
|
||||||
|
project_manager/pm_updateLayer.py
|
||||||
|
project_manager/pm_gtk.py
|
||||||
|
project_manager/pm_mainLayer.py
|
||||||
|
project_manager/update_reader.py
|
||||||
|
project_manager/update_request.py
|
||||||
|
settings/themes/Default/theme.data
|
||||||
|
settings/themes/Default/icons/open.png
|
||||||
|
settings/themes/Default/icons/closed.png
|
||||||
|
UI/UI_elements.py
|
||||||
|
settings/languages/Dumbass.data
|
||||||
|
settings/languages/English.data
|
||||||
|
settings/languages/Russian.data
|
||||||
|
project_manager/pm_installUpdatesLayer.py
|
||||||
|
HELP.txt
|
||||||
|
|
||||||
|
[https://open.lbry.com/@blender-organizer:5/Version-20.112-(Semi-Automatic-Update-System):a?r=GLhXoQ3zcpvm6rzd9Z6dAyasTpmk1FUY]
|
||||||
|
|
||||||
|
|
||||||
|
VERSION 20.111
|
||||||
|
|
||||||
|
settings/languages/Dumbass.data
|
||||||
|
settings/languages/English.data
|
||||||
|
settings/languages/Russian.data
|
||||||
|
settings/settings.py
|
||||||
|
settings/update.data
|
||||||
|
project_manager/pm_gtk.py
|
||||||
|
project_manager/pm_mainLayer.py
|
||||||
|
project_manager/pm_project.py
|
||||||
|
project_manager/pm_newprojectLayer.py
|
||||||
|
project_manager/scanLayer.py
|
||||||
|
project_manager/helpLayer.py
|
||||||
|
UI/UI_elements.py
|
||||||
|
UI/UI_testing.py
|
||||||
|
settings/themes/Default/theme.data
|
||||||
|
settings/themes/Default/icons/video.png
|
||||||
|
|
||||||
|
[https://open.lbry.com/@blender-organizer:5/VCStudio-Version-20.111:f?r=GLhXoQ3zcpvm6rzd9Z6dAyasTpmk1FUY]
|
||||||
|
|
||||||
|
VERSION 20.11
|
||||||
|
|
||||||
|
run.py
|
||||||
|
icon.png
|
||||||
|
tinyicon.png
|
||||||
|
HELP.txt
|
||||||
|
troubleshooter/troubleshooter.py
|
||||||
|
troubleshooter/fix.py
|
||||||
|
settings/languages/Dumbass.data
|
||||||
|
settings/languages/English.data
|
||||||
|
settings/languages/Russian.data
|
||||||
|
settings/settings.py
|
||||||
|
settings/talk.py
|
||||||
|
settings/update.data
|
||||||
|
project_manager/pm_console.py
|
||||||
|
project_manager/pm_gtk.py
|
||||||
|
project_manager/pm_mainLayer.py
|
||||||
|
project_manager/pm_project.py
|
||||||
|
project_manager/pm_newprojectLayer.py
|
||||||
|
project_manager/scanLayer.py
|
||||||
|
UI/UI_color.py
|
||||||
|
UI/UI_elements.py
|
||||||
|
UI/UI_testing.py
|
||||||
|
settings/themes/Default/theme.data
|
||||||
|
settings/themes/Default/icons/cancel.png
|
||||||
|
settings/themes/Default/icons/configure_file.png
|
||||||
|
settings/themes/Default/icons/folder.png
|
||||||
|
settings/themes/Default/icons/internet.png
|
||||||
|
settings/themes/Default/icons/new_file.png
|
||||||
|
settings/themes/Default/icons/ok.png
|
||||||
|
settings/themes/Default/icons/quenstion.png
|
||||||
|
settings/themes/Default/icons/search_file.png
|
||||||
|
settings/themes/Default/icons/settings.png
|
||||||
|
settings/themes/Default/icons/update.png
|
||||||
|
|
||||||
|
[https://github.com/JYamihud/VCStudio]
|
Loading…
Reference in a new issue