thewellermangroup commited on
Commit
2e85a8f
·
1 Parent(s): 3f54794

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +39 -37
app.py CHANGED
@@ -12,6 +12,45 @@ def checkPassword(passwordInput, password):
12
  app = flask.Flask(__name__)
13
  flask_cors.CORS(app)
14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  # creates a API endpoint for the password input
16
  @app.route('/api/thewellermangroup/passwordinput/<passwordIn>', methods=['GET'])
17
  def password(passwordIn):
@@ -56,47 +95,10 @@ def password(passwordIn):
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()
99
- print(FCODE)
100
  exec("data.update({'FUNCTIONS': {"+FCODE+"}})")
101
  else:
102
  data = {
 
12
  app = flask.Flask(__name__)
13
  flask_cors.CORS(app)
14
 
15
+ f = open("FUNCTIONS.txt",'r',encoding="utf-8")
16
+ functions0 = f.read()
17
+ f.close()
18
+
19
+
20
+ functions1 = functions0.split('\nfunction ')
21
+
22
+ functions1 = functions1[1:]
23
+
24
+ # print(functions1)
25
+
26
+ BACKEND = ""
27
+ FRONTEND = ""
28
+
29
+ num = 0
30
+
31
+ for fun in functions1:
32
+ n = fun.split('{', 1)[0].strip()
33
+ f = fun.split('{', 1)[1].rsplit('}', 1)[0].strip().replace("\\","\\\\")
34
+ BACKEND += "'" + n + "': '''\n" + f + "\n''',\n"
35
+ 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"
36
+ num += 1
37
+
38
+
39
+
40
+ # print(BACKEND)
41
+ # print(FRONTEND)
42
+
43
+ print(num)
44
+
45
+ f = open("./FUNCTIONS_BACKEND.txt",'w',encoding="utf-8")
46
+ f.write(BACKEND)
47
+ f.close()
48
+
49
+ f = open("./FUNCTIONS_FRONTEND.txt",'w',encoding="utf-8")
50
+ f.write(FRONTEND)
51
+ f.close()
52
+
53
+
54
  # creates a API endpoint for the password input
55
  @app.route('/api/thewellermangroup/passwordinput/<passwordIn>', methods=['GET'])
56
  def password(passwordIn):
 
95
 
96
  }
97
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  f = open('./FUNCTIONS_BACKEND.txt', 'r', encoding='utf-8')
100
  FCODE = f.read()
101
  f.close()
 
102
  exec("data.update({'FUNCTIONS': {"+FCODE+"}})")
103
  else:
104
  data = {