thewellermangroup commited on
Commit
99fb37d
·
1 Parent(s): 1052ff3

Rename FUNCTIONS/functions to FUNCTIONS/functions.py

Browse files
Files changed (2) hide show
  1. FUNCTIONS/functions +0 -0
  2. FUNCTIONS/functions.py +39 -0
FUNCTIONS/functions DELETED
File without changes
FUNCTIONS/functions.py ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ f = open("FUNCTIONS/FUNCTIONS.txt",'r',encoding="utf-8")
2
+ functions0 = f.read()
3
+ f.close()
4
+
5
+
6
+ functions1 = functions0.split('\nfunction ')
7
+
8
+ functions1 = functions1[1:]
9
+
10
+ # print(functions1)
11
+
12
+ BACKEND = ""
13
+ FRONTEND = ""
14
+
15
+ num = 0
16
+
17
+ for fun in functions1:
18
+ n = fun.split('{', 1)[0].strip()
19
+ f = fun.split('{', 1)[1].rsplit('}', 1)[0].strip().replace("\\","\\\\")
20
+ BACKEND += "'" + n + "': '''\n" + f + "\n''',\n"
21
+ FRONTEND += "function "+n+" {\n fetchApiData();\n // Ensure that globalData is populated before executing the code\n setTimeout(() => {\n if (BACKENDDATA.ACCESS) {\n eval(BACKENDDATA.FUNCTIONS['"+n+"']);\n }\n }, DELAYTIME);\n}\n"
22
+ num += 1
23
+
24
+
25
+
26
+ # print(BACKEND)
27
+ # print(FRONTEND)
28
+
29
+ print(num)
30
+
31
+ f = open("FUNCTIONS_BACKEND.txt",'w',encoding="utf-8")
32
+ f.write(BACKEND)
33
+ f.close()
34
+
35
+ f = open("FUNCTIONS_FRONTEND.txt",'w',encoding="utf-8")
36
+ f.write(FRONTEND)
37
+ f.close()
38
+
39
+