thewellermangroup commited on
Commit
f102b09
·
1 Parent(s): 62551b6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +38 -0
app.py CHANGED
@@ -21,6 +21,7 @@ def password(passwordIn):
21
  data = {}
22
 
23
  # Example data (could be fetched or processed dynamically)
 
24
 
25
  if access:
26
  data = {
@@ -55,6 +56,43 @@ def password(passwordIn):
55
 
56
  }
57
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  f = open('./FUNCTIONS_BACKEND.txt', 'r', encoding='utf-8')
59
  FCODE = f.read()
60
  f.close()
 
21
  data = {}
22
 
23
  # Example data (could be fetched or processed dynamically)
24
+
25
 
26
  if access:
27
  data = {
 
56
 
57
  }
58
  }
59
+ f = open("FUNCTIONS.txt",'r',encoding="utf-8")
60
+ functions0 = f.read()
61
+ f.close()
62
+
63
+
64
+ functions1 = functions0.split('\nfunction ')
65
+
66
+ functions1 = functions1[1:]
67
+
68
+ # print(functions1)
69
+
70
+ BACKEND = ""
71
+ FRONTEND = ""
72
+
73
+ num = 0
74
+
75
+ for fun in functions1:
76
+ n = fun.split('{', 1)[0].strip()
77
+ f = fun.split('{', 1)[1].rsplit('}', 1)[0].strip().replace("\\","\\\\")
78
+ BACKEND += "'" + n + "': '''\n" + f + "\n''',\n"
79
+ 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"
80
+ num += 1
81
+
82
+
83
+
84
+ # print(BACKEND)
85
+ # print(FRONTEND)
86
+
87
+ print(num)
88
+
89
+ f = open("./FUNCTIONS_BACKEND.txt",'w',encoding="utf-8")
90
+ f.write(BACKEND)
91
+ f.close()
92
+
93
+ f = open("./FUNCTIONS_FRONTEND.txt",'w',encoding="utf-8")
94
+ f.write(FRONTEND)
95
+ f.close()
96
  f = open('./FUNCTIONS_BACKEND.txt', 'r', encoding='utf-8')
97
  FCODE = f.read()
98
  f.close()