VIStk 0.3.6__py3-none-any.whl → 0.3.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of VIStk might be problematic. Click here for more details.
- VIS/Form.zip +0 -0
- VIS/Templates/screen.txt +0 -2
- VIS/VIS.py +27 -68
- VIS/project.py +270 -2
- VIS/release.py +3 -3
- {vistk-0.3.6.dist-info → vistk-0.3.7.dist-info}/METADATA +1 -1
- vistk-0.3.7.dist-info/RECORD +17 -0
- VIS/elements.py +0 -27
- VIS/patch.py +0 -11
- VIS/screen.py +0 -15
- VIS/stitch.py +0 -37
- vistk-0.3.6.dist-info/RECORD +0 -21
- {vistk-0.3.6.dist-info → vistk-0.3.7.dist-info}/WHEEL +0 -0
- {vistk-0.3.6.dist-info → vistk-0.3.7.dist-info}/entry_points.txt +0 -0
- {vistk-0.3.6.dist-info → vistk-0.3.7.dist-info}/licenses/LICENSE +0 -0
- {vistk-0.3.6.dist-info → vistk-0.3.7.dist-info}/top_level.txt +0 -0
VIS/Form.zip
CHANGED
|
Binary file
|
VIS/Templates/screen.txt
CHANGED
VIS/VIS.py
CHANGED
|
@@ -3,24 +3,17 @@ import os
|
|
|
3
3
|
import zipfile
|
|
4
4
|
import subprocess
|
|
5
5
|
import shutil
|
|
6
|
-
|
|
6
|
+
from VIS.project import *
|
|
7
7
|
from importlib import metadata
|
|
8
8
|
import json
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
vl = subprocess.check_output('python -c "import os, sys; print(os.path.dirname(sys.executable))"').decode().strip("\r\n")+"\\Lib\\site-packages\\VIS\\"
|
|
12
|
-
#print(vl)
|
|
10
|
+
|
|
13
11
|
|
|
14
12
|
inp = sys.argv
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
(wd := os.getcwd()) if inp[1] in ["new","New","N","n"] else (wd := vp.getPath())
|
|
18
|
-
except:
|
|
19
|
-
print(f"VIS Version {metadata.version("VIS")}")
|
|
20
|
-
sys.exit()
|
|
13
|
+
print(f"VIS Version {metadata.version("VIStk")}")
|
|
14
|
+
|
|
21
15
|
|
|
22
|
-
#Copied from source
|
|
23
|
-
#https://stackoverflow.com/a/75246706
|
|
16
|
+
#Copied from source https://stackoverflow.com/a/75246706
|
|
24
17
|
def unzip_without_overwrite(src_path, dst_dir):
|
|
25
18
|
with zipfile.ZipFile(src_path, "r") as zf:
|
|
26
19
|
for member in zf.infolist():
|
|
@@ -30,67 +23,33 @@ def unzip_without_overwrite(src_path, dst_dir):
|
|
|
30
23
|
def __main__():
|
|
31
24
|
match inp[1]:
|
|
32
25
|
case "new"|"New"|"N"|"n":#Create a new VIS project
|
|
33
|
-
|
|
34
|
-
os.mkdir(wd+"\\.VIS")
|
|
35
|
-
open(wd+"/.VIS/path.cfg","w").write(wd) if os.path.exists(wd+"/.VIS/path.cfg") else open(wd+"/.VIS/path.cfg", 'a').write(wd)
|
|
36
|
-
print(f"Created path.cfg as {vp.getPath()}")
|
|
37
|
-
unzip_without_overwrite(vl.replace("\\","/")+"Form.zip",wd)#Unzip project template to project
|
|
38
|
-
shutil.copytree(vl+"Templates",wd+".VIS/Templates",dirs_exist_ok=True)#copy templates to project
|
|
39
|
-
#DO NOT MESS WITH THE TEMPLATE HEADERS
|
|
40
|
-
title = input("Enter a name for the VIS project:")
|
|
41
|
-
info = {}
|
|
42
|
-
info[title] = {}
|
|
43
|
-
info[title]["Screens"]={}
|
|
44
|
-
info[title]["defaults"]={}
|
|
45
|
-
info[title]["defaults"]["icon"]="VIS"#default icon
|
|
46
|
-
os.mkdir(wd+"\\.VIS\\project.json")
|
|
47
|
-
with open(wd+"/.VIS/project.json","w") as f:
|
|
48
|
-
json.dump(info,f,indent=4)
|
|
49
|
-
else:
|
|
50
|
-
print(f"VIS project already initialized with path {vp.getPath()}")
|
|
26
|
+
project = VINFO()
|
|
51
27
|
|
|
52
28
|
case "add" | "Add" | "a" | "A":
|
|
29
|
+
project = Project()
|
|
53
30
|
match inp[2]:
|
|
54
31
|
case "screen" | "Screen" | "s" | "S":
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
match input("Should this screen have its own .exe?: "):
|
|
68
|
-
case "Yes" | "yes" | "Y" | "y":
|
|
69
|
-
info[name]["Screens"][sc_name]["release"] = "TRUE"
|
|
70
|
-
case _:
|
|
71
|
-
info[name]["Screens"][sc_name]["release"] = "FALSE"
|
|
72
|
-
ictf =input("What is the icon for this screen (or none)?: ")
|
|
73
|
-
if ".ICO" in ictf.upper():
|
|
74
|
-
info[name]["Screens"][sc_name]["icon"] = ictf.strip(".ico")
|
|
75
|
-
with open(wd+"/.VIS/project.json","w") as f:
|
|
76
|
-
json.dump(info,f,indent=4)
|
|
77
|
-
#somewhere in this process we can attempt to replace "Placeholder Title" and the root.iconbitmap
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
if len(inp) >= 5:
|
|
81
|
-
match inp[4]:
|
|
82
|
-
case "menu" | "Menu" | "m" | "M":
|
|
83
|
-
print("Add screen menu")
|
|
84
|
-
case "elements" | "Elements" | "e" | "E":
|
|
85
|
-
subprocess.call("python " + vl.replace("\\","/")+"/elements.py "+ screen + " " + inp[5])
|
|
86
|
-
else:
|
|
87
|
-
print("Add Screen")
|
|
88
|
-
|
|
89
|
-
case "patch" | "Patch" | "p" | "P":
|
|
90
|
-
subprocess.call("python " + vl.replace("\\","/")+"/patch.py " + inp[2])
|
|
32
|
+
if not inp[3] == None:
|
|
33
|
+
screen = project.verScreen(inp[3])
|
|
34
|
+
if len(inp) >= 5:
|
|
35
|
+
match inp[4]:
|
|
36
|
+
case "menu" | "Menu" | "m" | "M":
|
|
37
|
+
screen.addMenu(inp[5])
|
|
38
|
+
case "elements" | "Elements" | "e" | "E":
|
|
39
|
+
for i in inp[5].split("-"):
|
|
40
|
+
screen.addElement(i)
|
|
41
|
+
screen.stitch()
|
|
42
|
+
else:
|
|
43
|
+
project.newScreen(inp[3])
|
|
91
44
|
|
|
92
45
|
case "stitch" | "Stitch" | "s" | "S":
|
|
93
|
-
|
|
46
|
+
project = Project()
|
|
47
|
+
screen = project.getScreen(inp[2])
|
|
48
|
+
if not screen == None:
|
|
49
|
+
screen.stitch()
|
|
50
|
+
else:
|
|
51
|
+
print("Screen does not exist")
|
|
94
52
|
|
|
95
53
|
case "release" | "Release" | "r" | "R":
|
|
96
|
-
|
|
54
|
+
project = VINFO()
|
|
55
|
+
subprocess.call("python " + project.p_vis+"/release.py " + inp[2])
|
VIS/project.py
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
import os
|
|
2
|
+
import json
|
|
3
|
+
import zipfile
|
|
4
|
+
import shutil
|
|
5
|
+
import re
|
|
6
|
+
import glob
|
|
7
|
+
import subprocess
|
|
8
|
+
|
|
9
|
+
#Copied from source
|
|
10
|
+
#https://stackoverflow.com/a/75246706
|
|
11
|
+
def unzip_without_overwrite(src_path, dst_dir):
|
|
12
|
+
with zipfile.ZipFile(src_path, "r") as zf:
|
|
13
|
+
for member in zf.infolist():
|
|
14
|
+
file_path = os.path.join(dst_dir, member.filename)
|
|
15
|
+
if not os.path.exists(file_path):
|
|
16
|
+
zf.extract(member, dst_dir)
|
|
17
|
+
|
|
2
18
|
def getPath():
|
|
3
19
|
"""Searches for .VIS folder and returns from path.cfg
|
|
4
20
|
"""
|
|
@@ -11,6 +27,258 @@ def getPath():
|
|
|
11
27
|
if os.path.exists(step+".VIS/"):
|
|
12
28
|
return open(step+".VIS/path.cfg","r").read().replace("\\","/") #return stored path
|
|
13
29
|
else:
|
|
14
|
-
|
|
30
|
+
if os.path.exists(step):
|
|
31
|
+
sto += 1
|
|
32
|
+
else:
|
|
33
|
+
return None #return none if cant escape more
|
|
15
34
|
except:
|
|
16
|
-
return None #if failed return none
|
|
35
|
+
return None #if failed return none
|
|
36
|
+
|
|
37
|
+
def validName(name:str):
|
|
38
|
+
"""Checks if provided path is a valid filename
|
|
39
|
+
"""
|
|
40
|
+
if " " in name:
|
|
41
|
+
print("Cannot have spaces in file name.")
|
|
42
|
+
return False
|
|
43
|
+
if "/" in name or "\\" in name:
|
|
44
|
+
print("Cannot have filepath deliminator in file name.")
|
|
45
|
+
return False
|
|
46
|
+
if "<" in name or ">" in name or ":" in name or '"' in name or "|" in name or "?" in name or "*" in name:
|
|
47
|
+
print('Invlaid ASCII characters for windows file creation, please remove all <>:"|?* from file name.')
|
|
48
|
+
return False
|
|
49
|
+
if name.split(".")[0] in ["CON","PRN","AUX","NUL","COM1","COM2","COM3","COM4","COM5","COM6","COM7","COM8","COM9","LPT1","LPT2","LPT3","LPT4","LPT5","LPT6","LPT7","LPT8","LPT9"]:
|
|
50
|
+
print(f"Filename {name} reserved by OS.")
|
|
51
|
+
return False
|
|
52
|
+
if "" == name:
|
|
53
|
+
print("Must provide a name for file.")
|
|
54
|
+
return False
|
|
55
|
+
else:
|
|
56
|
+
return True
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class VINFO():
|
|
60
|
+
"""Overarching control structure within the /.VIS/ folder
|
|
61
|
+
"""
|
|
62
|
+
def __init__(self):
|
|
63
|
+
if getPath() == None:
|
|
64
|
+
wd = os.getcwd()
|
|
65
|
+
os.mkdir(wd+"\\.VIS")
|
|
66
|
+
open(wd+"/.VIS/path.cfg","w").write(wd) if os.path.exists(wd+"/.VIS/path.cfg") else open(wd+"/.VIS/path.cfg", 'a').write(wd)
|
|
67
|
+
print(f"Stored project path in path.cfg as {wd} in {wd}/.VIS/path.cfg")
|
|
68
|
+
|
|
69
|
+
unzip_without_overwrite("./Form.zip",wd)
|
|
70
|
+
print(f"Copied structure to {wd}")
|
|
71
|
+
|
|
72
|
+
shutil.copytree("./Templates",wd+"/.VIS/Templates",dirs_exist_ok=True)
|
|
73
|
+
print(f"Loaded default templates into {wd}/.VIS/Templates/")
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
#DO NOT MESS WITH THE TEMPLATE HEADERS
|
|
77
|
+
|
|
78
|
+
title = input("Enter a name for the VIS project: ")
|
|
79
|
+
|
|
80
|
+
info = {}
|
|
81
|
+
info[title] = {}
|
|
82
|
+
info[title]["Screens"]={}
|
|
83
|
+
info[title]["defaults"]={}
|
|
84
|
+
info[title]["defaults"]["icon"]="VIS"#default icon
|
|
85
|
+
with open(wd+"/.VIS/project.json","w") as f:
|
|
86
|
+
f.write("{}")
|
|
87
|
+
json.dump(info,f,indent=4)
|
|
88
|
+
print(f"Setup project.json for project {title} in {wd}/.VIS/")
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
#Need to get current python location where VIS is installed
|
|
92
|
+
self.p_vis = subprocess.check_output('python -c "import os, sys; print(os.path.dirname(sys.executable))"').decode().strip("\r\n")+"\\Lib\\site-packages\\VIS\\"
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
self.p_project = getPath()
|
|
96
|
+
self.p_vinfo = self.p_project + "/.VIS"
|
|
97
|
+
self.p_sinfo = self.p_vinfo + "/project.json"
|
|
98
|
+
with open(self.p_sinfo,"r") as f: self.title = list(json.load(f).keys())[0]
|
|
99
|
+
self.p_screens = self.p_project +"/Screens"
|
|
100
|
+
self.p_modules = self.p_project +"/modules"
|
|
101
|
+
self.p_templates = self.p_vinfo + "/Templates"
|
|
102
|
+
self.screenlist=[]
|
|
103
|
+
|
|
104
|
+
class Screen(VINFO):
|
|
105
|
+
"""A VIS screen object
|
|
106
|
+
"""
|
|
107
|
+
def __init__(self,name:str,script:str,release:bool=False,icon:str=None,exists:bool=True):
|
|
108
|
+
super().__init__()
|
|
109
|
+
self.name=name
|
|
110
|
+
self.script=script
|
|
111
|
+
self.release=release
|
|
112
|
+
self.icon=icon
|
|
113
|
+
self.path = self.p_screens+"/"+name
|
|
114
|
+
self.m_path = self.p_modules+"/"+name
|
|
115
|
+
|
|
116
|
+
if not exists:
|
|
117
|
+
with open(self.p_sinfo,"r") as f:
|
|
118
|
+
info = json.load(f)
|
|
119
|
+
|
|
120
|
+
info[self.title]["Screens"][name] = {"script":script,"release":release}
|
|
121
|
+
if not icon == None:
|
|
122
|
+
info[self.title]["Screens"][name]["icon"] = icon
|
|
123
|
+
|
|
124
|
+
with open(self.p_sinfo,"w") as f:
|
|
125
|
+
json.dump(info,f,indent=4)
|
|
126
|
+
|
|
127
|
+
shutil.copyfile(self.p_templates+"/screen.txt",self.p_project+"/"+script)
|
|
128
|
+
os.mkdir(self.p_screens+"/"+name)
|
|
129
|
+
os.mkdir(self.p_modules+"/"+name)
|
|
130
|
+
#can use this info to create something about a new screen
|
|
131
|
+
|
|
132
|
+
def addElement(self,element:str) -> int:
|
|
133
|
+
if validName(element):
|
|
134
|
+
if not os.path.exists(self.path+"/f_"+element+".py"):
|
|
135
|
+
shutil.copyfile(self.p_templates+"/f_element.txt",self.path+"/f_"+element+".py")
|
|
136
|
+
print(f"Created element f_{element}.py in {self.path}")
|
|
137
|
+
self.patch(element)
|
|
138
|
+
if not os.path.exists(self.m_path+"/m_"+element+".py"):
|
|
139
|
+
with open(self.m_path+"/m_"+element+".py", "w"): pass
|
|
140
|
+
print(f"Created module m_{element}.py in {self.m_path}")
|
|
141
|
+
return 1
|
|
142
|
+
else:
|
|
143
|
+
return 0
|
|
144
|
+
|
|
145
|
+
def addMenu(self,menu:str) -> int:
|
|
146
|
+
pass #will be command line menu creation tool
|
|
147
|
+
|
|
148
|
+
def patch(self,element:str) -> int:
|
|
149
|
+
"""Patches up the template after its copied
|
|
150
|
+
"""
|
|
151
|
+
if os.path.exists(self.path+"/f_"+element+".py"):
|
|
152
|
+
with open(self.path+"/f_"+element+".py","r") as f:
|
|
153
|
+
text = f.read()
|
|
154
|
+
text = text.replace("<frame>","f_"+element)
|
|
155
|
+
with open(self.path+"/f_"+element+".py","w") as f:
|
|
156
|
+
f.write(text)
|
|
157
|
+
print(f"patched f_{element}.py")
|
|
158
|
+
return 1
|
|
159
|
+
else:
|
|
160
|
+
print(f"Could not patch, element does not exist.")
|
|
161
|
+
return 0
|
|
162
|
+
|
|
163
|
+
def stitch(self) -> int:
|
|
164
|
+
"""Connects screen elements to a screen
|
|
165
|
+
"""
|
|
166
|
+
with open(self.p_project+"/"+self.script,"r") as f: text = f.read()
|
|
167
|
+
stitched = []
|
|
168
|
+
#Elements
|
|
169
|
+
pattern = r"#Screen Elements.*#Screen Grid"
|
|
170
|
+
|
|
171
|
+
elements = glob.glob(self.path+'/f_*')#get all elements
|
|
172
|
+
for i in range(0,len(elements),1):#iterate into module format
|
|
173
|
+
elements[i] = elements[i].replace("\\","/")
|
|
174
|
+
elements[i] = elements[i].replace(self.path+"/","Screens."+self.name+".")[:-3]
|
|
175
|
+
stitched.append(elements[i])
|
|
176
|
+
#combine and change text
|
|
177
|
+
elements = "from " + " import *\nfrom ".join(elements) + " import *\n"
|
|
178
|
+
text = re.sub(pattern, "#Screen Elements\n" + elements + "\n#Screen Grid", text, flags=re.DOTALL)
|
|
179
|
+
|
|
180
|
+
#Modules
|
|
181
|
+
pattern = r"#Screen Modules.*#Handle Arguments"
|
|
182
|
+
|
|
183
|
+
modules = glob.glob(self.m_path+'/m_*')#get all modules
|
|
184
|
+
for i in range(0,len(modules),1):#iterate into module format
|
|
185
|
+
modules[i] = modules[i].replace("\\","/")
|
|
186
|
+
modules[i] = modules[i].replace(self.m_path+"/","modules."+self.name+".")[:-3]
|
|
187
|
+
stitched.append(modules[i])
|
|
188
|
+
#combine and change text
|
|
189
|
+
modules = "from " + " import *\nfrom ".join(modules) + " import *\n"
|
|
190
|
+
text = re.sub(pattern, "#Screen Modules\n" + modules + "\n#Handle Arguments", text, flags=re.DOTALL)
|
|
191
|
+
|
|
192
|
+
#write out
|
|
193
|
+
with open(self.p_project+"/"+self.script,"w") as f:
|
|
194
|
+
f.write(text)
|
|
195
|
+
print("Stitched: ")
|
|
196
|
+
for i in stitched:
|
|
197
|
+
print(f"\t{i} to {self.name}")
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
class Project(VINFO):
|
|
201
|
+
"""VIS Project Object
|
|
202
|
+
"""
|
|
203
|
+
def __init__(self):
|
|
204
|
+
"""Initializes or load a VIS project
|
|
205
|
+
"""
|
|
206
|
+
super().__init__()
|
|
207
|
+
with open(self.p_sinfo,"r") as f:
|
|
208
|
+
info = json.load(f)
|
|
209
|
+
self.name = list(info.keys())[0]
|
|
210
|
+
|
|
211
|
+
for screen in list(info[self.name]["Screens"].keys()):
|
|
212
|
+
scr = Screen(screen,
|
|
213
|
+
info[self.name]["Screens"][screen]["script"],
|
|
214
|
+
info[self.name]["Screens"][screen]["release"],
|
|
215
|
+
info[self.name]["Screens"][screen].get("icon"))
|
|
216
|
+
self.screenlist.append(scr)
|
|
217
|
+
|
|
218
|
+
def newScreen(self,screen:str) -> int:
|
|
219
|
+
"""Creates a new screen with some prompting
|
|
220
|
+
|
|
221
|
+
Returns:
|
|
222
|
+
0 Failed
|
|
223
|
+
1 Success
|
|
224
|
+
"""
|
|
225
|
+
#Check for valid filename
|
|
226
|
+
if not validName(screen):
|
|
227
|
+
return 0
|
|
228
|
+
|
|
229
|
+
with open(self.p_sinfo,"r") as f:
|
|
230
|
+
info = json.load(f) #Load info
|
|
231
|
+
|
|
232
|
+
name = self.title
|
|
233
|
+
if info[name]["Screens"].get(screen) == None: #If Screen does not exist in VINFO
|
|
234
|
+
while True: #ensures a valid name is used for script
|
|
235
|
+
match input(f"Should python script use name {screen}.py? "):
|
|
236
|
+
case "Yes" | "yes" | "Y" | "y":
|
|
237
|
+
script = screen + ".py"
|
|
238
|
+
break
|
|
239
|
+
case _:
|
|
240
|
+
script = input("Enter the name for the script file: ").strip(".py")+".py"
|
|
241
|
+
if validName(script):
|
|
242
|
+
break
|
|
243
|
+
|
|
244
|
+
match input("Should this screen have its own .exe?: "):
|
|
245
|
+
case "Yes" | "yes" | "Y" | "y":
|
|
246
|
+
release = True
|
|
247
|
+
case _:
|
|
248
|
+
release = False
|
|
249
|
+
ictf =input("What is the icon for this screen (or none)?: ")
|
|
250
|
+
icon = ictf.strip(".ico") if ".ICO" in ictf.upper() else None
|
|
251
|
+
self.screenlist.append(Screen(screen,script,release,icon,False))
|
|
252
|
+
|
|
253
|
+
return 1
|
|
254
|
+
else:
|
|
255
|
+
print(f"Information for {screen} already in project.")
|
|
256
|
+
return 1
|
|
257
|
+
|
|
258
|
+
def hasScreen(self,screen:str) -> bool:
|
|
259
|
+
"""Checks if the project has the correct screen
|
|
260
|
+
"""
|
|
261
|
+
for i in self.screenlist:
|
|
262
|
+
if i.name == screen:
|
|
263
|
+
return True
|
|
264
|
+
return False
|
|
265
|
+
|
|
266
|
+
def getScreen(self,screen:str) -> Screen:
|
|
267
|
+
"""Returns a screen object by its name
|
|
268
|
+
"""
|
|
269
|
+
for i in self.screenlist:
|
|
270
|
+
if i.name == screen:
|
|
271
|
+
return i
|
|
272
|
+
return None
|
|
273
|
+
|
|
274
|
+
def verScreen(self,screen:str) -> Screen:
|
|
275
|
+
"""Verifies a screen exists and returns it
|
|
276
|
+
|
|
277
|
+
Returns:
|
|
278
|
+
screen (Screen): Verified screen
|
|
279
|
+
"""
|
|
280
|
+
if not self.hasScreen(screen):
|
|
281
|
+
self.newScreen(screen)
|
|
282
|
+
scr = self.getScreen(screen)
|
|
283
|
+
return scr
|
|
284
|
+
|
VIS/release.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import sys
|
|
2
|
-
from project import *
|
|
2
|
+
from VIS.project import *
|
|
3
3
|
import subprocess
|
|
4
4
|
import json
|
|
5
5
|
import shutil
|
|
@@ -26,7 +26,7 @@ def build(version:str=""):
|
|
|
26
26
|
name_list = []
|
|
27
27
|
|
|
28
28
|
for i in info[name]["Screens"].keys():
|
|
29
|
-
if info[name]["Screens"][i]["release"]
|
|
29
|
+
if info[name]["Screens"][i]["release"]:
|
|
30
30
|
name_list.append(i)
|
|
31
31
|
file = info[name]["Screens"][i]["script"]
|
|
32
32
|
#icon = "du"
|
|
@@ -59,7 +59,7 @@ def clean(version:str=" "):
|
|
|
59
59
|
"""Cleans up build environment to save space
|
|
60
60
|
"""
|
|
61
61
|
print("Cleaning up build environment")
|
|
62
|
-
if version == "":
|
|
62
|
+
if version == " ":
|
|
63
63
|
if exists(f"{root}/dist/{name}/Icons/"): shutil.rmtree(f"{root}/dist/{name}/Icons/")
|
|
64
64
|
if exists(f"{root}/dist/{name}/Images/"): shutil.rmtree(f"{root}/dist/{name}/Images/")
|
|
65
65
|
shutil.copytree(root+"/Icons/",f"{root}/dist/{name}/Icons/",dirs_exist_ok=True)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
VIS/Form.zip,sha256=qyNG6hPgFcMkkilC1D3KnIC2BStmFJabyGXQmxqvQzg,24596
|
|
2
|
+
VIS/VIS.py,sha256=PRTVufZLrpqdhToVNUe61CHPVTeYQA2BTKw5GrNO_s0,1887
|
|
3
|
+
VIS/__init__.py,sha256=gO-ri9N9K-CQ3wJi-CX12MYhbrdqz2fvhJU-ZGf5BjI,69
|
|
4
|
+
VIS/menu.py,sha256=PqPYzsFfGpVeej85v59wbeWeSy24I-m0bFUAxtRBiSQ,1815
|
|
5
|
+
VIS/project.py,sha256=ONgPwmAdDz6qTvXmMB2hW1t1bAUfkoKmIHhq4McLxLk,10722
|
|
6
|
+
VIS/release.py,sha256=t4K1PbYAHSy6pt65dmyvbkW65bnuPkPVzKREWFNAAUI,4473
|
|
7
|
+
VIS/Templates/collect.txt,sha256=ZU5m4g2VBOWNWAGMUjZoi2UIc2uWmlV-L7_IXc3lBVU,96
|
|
8
|
+
VIS/Templates/f_element.txt,sha256=MVovajsLC2O5t_ZSOb9NppGqzziGqISWSaEJ7kbrl7U,485
|
|
9
|
+
VIS/Templates/screen.txt,sha256=qjEB8x_krQ1UGcVjbIxuVgasxcpJwIMh2UKbdeeE0KI,791
|
|
10
|
+
VIS/Templates/spec.txt,sha256=_IlwxuNxmtFOriZ6JWgtPANLkA8GFzOm80lE9PhqKfs,690
|
|
11
|
+
VIS/__pycache__/__init__.cpython-313.pyc,sha256=G_EdBuWyhjGJ4zI9Sc81loMtV0ANdEzC6JmUwcnaomI,218
|
|
12
|
+
vistk-0.3.7.dist-info/licenses/LICENSE,sha256=FxXH04vmzWaQWNEoGwgDcLEG8Li5qf36NNz3UyrBMvQ,1300
|
|
13
|
+
vistk-0.3.7.dist-info/METADATA,sha256=sWIcFbsGgao7bXCkehiAz83yEDsC1l145ru0JlsafCM,2493
|
|
14
|
+
vistk-0.3.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
15
|
+
vistk-0.3.7.dist-info/entry_points.txt,sha256=Fq_VLNEc6Rk4-S8ICPkPjNozFeDeeeFAF5lvK7hQu7o,41
|
|
16
|
+
vistk-0.3.7.dist-info/top_level.txt,sha256=iFRNav6cokh9J-6nat5rgNWLdQm371xQ3OPb9w7i5mI,4
|
|
17
|
+
vistk-0.3.7.dist-info/RECORD,,
|
VIS/elements.py
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import sys
|
|
2
|
-
import shutil
|
|
3
|
-
import os
|
|
4
|
-
import subprocess
|
|
5
|
-
import project as vp
|
|
6
|
-
|
|
7
|
-
screen = sys.argv[1]
|
|
8
|
-
elements = sys.argv[2]
|
|
9
|
-
elements = elements.split('-')
|
|
10
|
-
|
|
11
|
-
project = vp.getPath()
|
|
12
|
-
|
|
13
|
-
for e in elements:
|
|
14
|
-
if not os.path.exists(project+"/Screens/"+screen+"/f_"+e+".py"):
|
|
15
|
-
shutil.copyfile(project+"/.VIS/Templates/f_element.txt",project+"/Screens/"+screen+"/f_"+e+".py")
|
|
16
|
-
print("element\tf_"+e+".py\tcreated in\tScreens/"+screen+"/")
|
|
17
|
-
subprocess.call("VIS patch "+project+"/Screens/"+screen+"/"+e+".py")
|
|
18
|
-
|
|
19
|
-
if not os.path.exists(project+"/modules/"+screen+"/m_"+e+".py"):
|
|
20
|
-
with open(project+"/modules/"+screen+"/m_"+e+".py", "w"): pass
|
|
21
|
-
print("module\tm_"+e+".py\tcreated in\tScreens/"+screen+"/")
|
|
22
|
-
|
|
23
|
-
if not os.path.exists(project+"/"+screen+".py"):#cannot create elements without screen so will create screen if it doesnt exist
|
|
24
|
-
shutil.copyfile(project+"/.VIS/Templates/screen.txt"+project+"/"+screen+".py")
|
|
25
|
-
print("screen\t"+e+".py \tcreated in\troot")
|
|
26
|
-
|
|
27
|
-
subprocess.call("VIS stitch "+screen)
|
VIS/patch.py
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import sys
|
|
2
|
-
|
|
3
|
-
file = sys.argv[1]
|
|
4
|
-
frame = file.split('/')[-1][:-3]
|
|
5
|
-
file=file.replace(frame,"f_"+frame)
|
|
6
|
-
with open(file,"r") as f:
|
|
7
|
-
text = f.read()
|
|
8
|
-
text = text.replace("<frame>","f_"+frame)
|
|
9
|
-
with open(file,"w") as f:
|
|
10
|
-
f.write(text)
|
|
11
|
-
print("patched\tf_"+frame+".py")
|
VIS/screen.py
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import sys
|
|
2
|
-
file = sys.argv[1]
|
|
3
|
-
frame = file.split('\\')[-1][:-3]
|
|
4
|
-
dump_screens = False
|
|
5
|
-
dump_modules = False
|
|
6
|
-
with open(file,"r") as f:
|
|
7
|
-
text= f.readlines()
|
|
8
|
-
for line in text:
|
|
9
|
-
if "screen elements" in line.lower():
|
|
10
|
-
dump_screens=True
|
|
11
|
-
elif "screen elements" in line.lower():
|
|
12
|
-
dump_modules=True
|
|
13
|
-
|
|
14
|
-
with open(file,"w") as f:
|
|
15
|
-
f.write(text)
|
VIS/stitch.py
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import sys
|
|
2
|
-
import re
|
|
3
|
-
import glob
|
|
4
|
-
import project as vp
|
|
5
|
-
|
|
6
|
-
project = vp.getPath()
|
|
7
|
-
screen = sys.argv[1]
|
|
8
|
-
with open(project+"/"+screen+".py","r") as f:
|
|
9
|
-
text = f.read()
|
|
10
|
-
|
|
11
|
-
#Elements
|
|
12
|
-
pattern = r"#Screen Elements.*#Screen Grid"
|
|
13
|
-
replacement = glob.glob(project+"/Screens/"+screen+'/f_*')
|
|
14
|
-
for i in range(0,len(replacement),1):
|
|
15
|
-
replacement[i] = replacement[i].replace("\\","/")
|
|
16
|
-
replacement[i] = replacement[i].replace(project+"/Screens/"+screen+"/","Screens."+screen+".")[:-3]
|
|
17
|
-
#print(replacement)
|
|
18
|
-
replacement = "from " + " import *\nfrom ".join(replacement) + " import *\n"
|
|
19
|
-
#print(replacement)
|
|
20
|
-
text = re.sub(pattern, "#Screen Elements\n" + replacement + "\n#Screen Grid", text, flags=re.DOTALL)
|
|
21
|
-
|
|
22
|
-
#Modules
|
|
23
|
-
pattern = r"#Screen Modules.*#Handle Arguments"
|
|
24
|
-
replacement = glob.glob(project+"/modules/"+screen+'/m_*')
|
|
25
|
-
for i in range(0,len(replacement),1):
|
|
26
|
-
replacement[i] = replacement[i].replace("\\","/")
|
|
27
|
-
print("stitching\t"+replacement[i].strip(project)+"\tto\t"+screen+".py")
|
|
28
|
-
replacement[i] = replacement[i].replace(project+"/modules/"+screen+"/","modules."+screen+".")[:-3]
|
|
29
|
-
#print(replacement)
|
|
30
|
-
replacement = "from " + " import *\nfrom ".join(replacement) + " import *\n"
|
|
31
|
-
#print(replacement)
|
|
32
|
-
text = re.sub(pattern, "#Screen Modules\n" + replacement + "\n#Handle Arguments", text, flags=re.DOTALL)
|
|
33
|
-
#print(text)
|
|
34
|
-
|
|
35
|
-
with open(project+"/"+screen+".py","w") as f:
|
|
36
|
-
f.write(text)
|
|
37
|
-
print("stitched\t"+screen+".py\twith\tall")
|
vistk-0.3.6.dist-info/RECORD
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
VIS/Form.zip,sha256=Uu6GK-n26kOSxSzL7HWHcqZf6p3bCn7tHCZ2F1YWnxk,25866
|
|
2
|
-
VIS/VIS.py,sha256=4ZpMLbYSlvHpiQvWptY-pb4kH3tflbNfu4wumbJXQWM,4885
|
|
3
|
-
VIS/__init__.py,sha256=gO-ri9N9K-CQ3wJi-CX12MYhbrdqz2fvhJU-ZGf5BjI,69
|
|
4
|
-
VIS/elements.py,sha256=cq5__ICkdiKVF981o5AbetbmD3lB3HgMp0nsfZ6vKIo,1041
|
|
5
|
-
VIS/menu.py,sha256=PqPYzsFfGpVeej85v59wbeWeSy24I-m0bFUAxtRBiSQ,1815
|
|
6
|
-
VIS/patch.py,sha256=xvXXSF1cWH1aQhYauHkHulAyoj-RB85pJgSaPvGkglM,268
|
|
7
|
-
VIS/project.py,sha256=kWkNzCSIdc6Ij0vnGVGugSjbWs0EFCkPmDtCF8w5850,536
|
|
8
|
-
VIS/release.py,sha256=grA6M5hVbZDdJyi3bUXcwYzcye21yiNThThsjRgzTuY,4478
|
|
9
|
-
VIS/screen.py,sha256=am3pRnfXoC2G1TSVA_FyAuOKQ_PuVCKQMQCwkwSWe_s,377
|
|
10
|
-
VIS/stitch.py,sha256=AT9y9bDAJp-wmfUCWeUCp3mn_b8u9yEL5DE5XOn32Sc,1428
|
|
11
|
-
VIS/Templates/collect.txt,sha256=ZU5m4g2VBOWNWAGMUjZoi2UIc2uWmlV-L7_IXc3lBVU,96
|
|
12
|
-
VIS/Templates/f_element.txt,sha256=MVovajsLC2O5t_ZSOb9NppGqzziGqISWSaEJ7kbrl7U,485
|
|
13
|
-
VIS/Templates/screen.txt,sha256=4k732aBbT_tf3fwcsM1RLB8UPFNA03EWBRo1aw0jw8U,803
|
|
14
|
-
VIS/Templates/spec.txt,sha256=_IlwxuNxmtFOriZ6JWgtPANLkA8GFzOm80lE9PhqKfs,690
|
|
15
|
-
VIS/__pycache__/__init__.cpython-313.pyc,sha256=G_EdBuWyhjGJ4zI9Sc81loMtV0ANdEzC6JmUwcnaomI,218
|
|
16
|
-
vistk-0.3.6.dist-info/licenses/LICENSE,sha256=FxXH04vmzWaQWNEoGwgDcLEG8Li5qf36NNz3UyrBMvQ,1300
|
|
17
|
-
vistk-0.3.6.dist-info/METADATA,sha256=dUjKSYpAIYq7nrYOFYdsZ8SNNJMtXkRqrTRREg9SLoc,2493
|
|
18
|
-
vistk-0.3.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
19
|
-
vistk-0.3.6.dist-info/entry_points.txt,sha256=Fq_VLNEc6Rk4-S8ICPkPjNozFeDeeeFAF5lvK7hQu7o,41
|
|
20
|
-
vistk-0.3.6.dist-info/top_level.txt,sha256=iFRNav6cokh9J-6nat5rgNWLdQm371xQ3OPb9w7i5mI,4
|
|
21
|
-
vistk-0.3.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|