phanterpwa 13.28.0__py3-none-any.whl → 13.30.0__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.
- phanterpwa/__init__.py +1 -1
- phanterpwa/configer.py +16 -16
- phanterpwa/server.py +9 -20
- {phanterpwa-13.28.0.dist-info → phanterpwa-13.30.0.dist-info}/METADATA +1 -1
- {phanterpwa-13.28.0.dist-info → phanterpwa-13.30.0.dist-info}/RECORD +10 -10
- {phanterpwa-13.28.0.dist-info → phanterpwa-13.30.0.dist-info}/LICENSE +0 -0
- {phanterpwa-13.28.0.dist-info → phanterpwa-13.30.0.dist-info}/WHEEL +0 -0
- {phanterpwa-13.28.0.dist-info → phanterpwa-13.30.0.dist-info}/dependency_links.txt +0 -0
- {phanterpwa-13.28.0.dist-info → phanterpwa-13.30.0.dist-info}/entry_points.txt +0 -0
- {phanterpwa-13.28.0.dist-info → phanterpwa-13.30.0.dist-info}/top_level.txt +0 -0
phanterpwa/__init__.py
CHANGED
phanterpwa/configer.py
CHANGED
|
@@ -244,8 +244,8 @@ class ProjectConfig():
|
|
|
244
244
|
else:
|
|
245
245
|
ports.add(current_port)
|
|
246
246
|
cfg["BACKEND"][app_name]["port"] = current_port
|
|
247
|
-
with open(join(a, "app.ini"), 'w', encoding="utf-8") as configfile:
|
|
248
|
-
|
|
247
|
+
# with open(join(a, "app.ini"), 'w', encoding="utf-8") as configfile:
|
|
248
|
+
# ini_app.write(configfile)
|
|
249
249
|
|
|
250
250
|
self._ini_apps_backend[app_name] = ini_app
|
|
251
251
|
|
|
@@ -259,8 +259,8 @@ class ProjectConfig():
|
|
|
259
259
|
cfg["BACKEND"][app_name][i[0]] = self._dict_value(i[1])
|
|
260
260
|
else:
|
|
261
261
|
ini_secret_app["APP"] = {}
|
|
262
|
-
with open(join(a, "secret.ini"), 'w', encoding="utf-8") as configfile:
|
|
263
|
-
|
|
262
|
+
# with open(join(a, "secret.ini"), 'w', encoding="utf-8") as configfile:
|
|
263
|
+
# ini_secret_app.write(configfile)
|
|
264
264
|
|
|
265
265
|
self._ini_secret_apps_backend[app_name] = ini_secret_app
|
|
266
266
|
else:
|
|
@@ -335,8 +335,8 @@ class ProjectConfig():
|
|
|
335
335
|
else:
|
|
336
336
|
ports.add(current_port)
|
|
337
337
|
cfg["FRONTEND"][app_name]["port"] = current_port
|
|
338
|
-
with open(join(a, "app.ini"), 'w', encoding="utf-8") as configfile:
|
|
339
|
-
|
|
338
|
+
# with open(join(a, "app.ini"), 'w', encoding="utf-8") as configfile:
|
|
339
|
+
# ini_app.write(configfile)
|
|
340
340
|
|
|
341
341
|
self._ini_apps_frontend[app_name] = ini_app
|
|
342
342
|
|
|
@@ -351,8 +351,8 @@ class ProjectConfig():
|
|
|
351
351
|
else:
|
|
352
352
|
ini_secret_app["APP"] = {}
|
|
353
353
|
|
|
354
|
-
with open(join(a, "secret.ini"), 'w', encoding="utf-8") as configfile:
|
|
355
|
-
|
|
354
|
+
# with open(join(a, "secret.ini"), 'w', encoding="utf-8") as configfile:
|
|
355
|
+
# ini_secret_app.write(configfile)
|
|
356
356
|
|
|
357
357
|
self._ini_secret_apps_frontend[app_name] = ini_secret_app
|
|
358
358
|
|
|
@@ -512,16 +512,16 @@ class ProjectConfig():
|
|
|
512
512
|
for y in self.project_ini.items(x):
|
|
513
513
|
v = str(self._config[x][y[0]])
|
|
514
514
|
self.project_ini[x][y[0]] = v
|
|
515
|
-
with open(join(self._config["PROJECT"]["path"], 'project.ini'), 'w', encoding="utf-8") as configfile:
|
|
516
|
-
|
|
515
|
+
# with open(join(self._config["PROJECT"]["path"], 'project.ini'), 'w', encoding="utf-8") as configfile:
|
|
516
|
+
# self._ini_project.write(configfile)
|
|
517
517
|
|
|
518
518
|
if not os.path.exists(join(self._config["PROJECT"]["path"], 'secret.ini')):
|
|
519
519
|
for x in self.project_secret_ini.sections():
|
|
520
520
|
for y in self.project_secret_ini.items(x):
|
|
521
521
|
v = str(self._config[x][y[0]])
|
|
522
522
|
self.project_secret_ini[x][y[0]] = v
|
|
523
|
-
with open(join(self._config["PROJECT"]["path"], 'secret.ini'), 'w', encoding="utf-8") as configfile:
|
|
524
|
-
|
|
523
|
+
# with open(join(self._config["PROJECT"]["path"], 'secret.ini'), 'w', encoding="utf-8") as configfile:
|
|
524
|
+
# self._ini_secret.write(configfile)
|
|
525
525
|
|
|
526
526
|
for a in self.backend_ini:
|
|
527
527
|
if not os.path.exists(join(self._config["PROJECT"]["path"], "backapps", a, 'app.ini')):
|
|
@@ -530,8 +530,8 @@ class ProjectConfig():
|
|
|
530
530
|
for y in self.backend_ini[a].items(x):
|
|
531
531
|
v = str(self._config['BACKEND'][a][y[0]])
|
|
532
532
|
self.backend_ini[a][x][y[0]] = v
|
|
533
|
-
with open(join(self._config["PROJECT"]["path"], "backapps", a, 'app.ini'), 'w', encoding="utf-8") as configfile:
|
|
534
|
-
|
|
533
|
+
# with open(join(self._config["PROJECT"]["path"], "backapps", a, 'app.ini'), 'w', encoding="utf-8") as configfile:
|
|
534
|
+
# self.backend_ini[a].write(configfile)
|
|
535
535
|
|
|
536
536
|
for a in self.frontend_ini:
|
|
537
537
|
if not os.path.exists(join(self._config["PROJECT"]["path"], "frontapps", a, 'app.ini')):
|
|
@@ -540,8 +540,8 @@ class ProjectConfig():
|
|
|
540
540
|
for y in self.frontend_ini[a].items(x):
|
|
541
541
|
v = str(self._config['FRONTEND'][a][y[0]])
|
|
542
542
|
self.frontend_ini[a][x][y[0]] = v
|
|
543
|
-
with open(join(self._config["PROJECT"]["path"], "frontapps", a, 'app.ini'), 'w', encoding="utf-8") as configfile:
|
|
544
|
-
|
|
543
|
+
# with open(join(self._config["PROJECT"]["path"], "frontapps", a, 'app.ini'), 'w', encoding="utf-8") as configfile:
|
|
544
|
+
# self.frontend_ini[a].write(configfile)
|
|
545
545
|
|
|
546
546
|
|
|
547
547
|
def __iter__(self):
|
phanterpwa/server.py
CHANGED
|
@@ -81,7 +81,7 @@ class PhanterPWATornado(object):
|
|
|
81
81
|
self.cpu_number = 1
|
|
82
82
|
needs_fork = self.cpu_number != 1 and self.cpu_number > -1
|
|
83
83
|
if needs_fork:
|
|
84
|
-
|
|
84
|
+
|
|
85
85
|
socs = {}
|
|
86
86
|
for x in self.projectConfig['BACKEND']:
|
|
87
87
|
current_port = self.projectConfig['BACKEND'][x]['port']
|
|
@@ -91,7 +91,10 @@ class PhanterPWATornado(object):
|
|
|
91
91
|
current_port = self.projectConfig['FRONTEND'][x]['port']
|
|
92
92
|
socket = netutil.bind_sockets(current_port)
|
|
93
93
|
socs[f'front_{x}'] = socket
|
|
94
|
+
|
|
94
95
|
process.fork_processes(self.cpu_number)
|
|
96
|
+
print(f"After fork - PID: {os.getpid()}")
|
|
97
|
+
|
|
95
98
|
for x in self.projectConfig['BACKEND']:
|
|
96
99
|
handlers_app = importlib.import_module("backapps.{0}.handlers".format(x))
|
|
97
100
|
if isinstance(handlers_app.HANDLER, (list, tuple)):
|
|
@@ -116,7 +119,7 @@ class PhanterPWATornado(object):
|
|
|
116
119
|
app = handlers_app.HANDLER
|
|
117
120
|
|
|
118
121
|
app_http_server = httpserver.HTTPServer(app)
|
|
119
|
-
app_http_server.add_sockets(socs[f'
|
|
122
|
+
app_http_server.add_sockets(socs[f'front_{x}'])
|
|
120
123
|
else:
|
|
121
124
|
for x in self.projectConfig['BACKEND']:
|
|
122
125
|
current_port = self.projectConfig['BACKEND'][x]['port']
|
|
@@ -131,6 +134,7 @@ class PhanterPWATornado(object):
|
|
|
131
134
|
|
|
132
135
|
app_http_server = httpserver.HTTPServer(app)
|
|
133
136
|
app_http_server.listen(current_port)
|
|
137
|
+
print(id(app_http_server))
|
|
134
138
|
|
|
135
139
|
for x in self.projectConfig['FRONTEND']:
|
|
136
140
|
current_port = self.projectConfig['FRONTEND'][x]['port']
|
|
@@ -145,6 +149,7 @@ class PhanterPWATornado(object):
|
|
|
145
149
|
|
|
146
150
|
app_http_server = httpserver.HTTPServer(app)
|
|
147
151
|
app_http_server.listen(current_port)
|
|
152
|
+
print(id(app_http_server))
|
|
148
153
|
|
|
149
154
|
|
|
150
155
|
autoreload.watch(os.path.join(self.projectPath, "config.json"))
|
|
@@ -187,38 +192,21 @@ class ProjectRunner():
|
|
|
187
192
|
ppwa_version = PHANTERPWA_VERSION
|
|
188
193
|
with open(ppwa_version_file, 'w', encoding="utf-8") as f:
|
|
189
194
|
f.write(ppwa_version)
|
|
190
|
-
# majors_version = majors_version_cfg = "0.0"
|
|
191
195
|
if os.path.isfile(os.path.join(project_path, 'project.ini')):
|
|
192
196
|
self._ini_project.read(
|
|
193
197
|
os.path.join(project_path, 'project.ini'), encoding='utf-8')
|
|
194
198
|
project_version = self._ini_project["PROJECT"].get("version", "0.0.1")
|
|
195
|
-
# if version_regex.match(project_version):
|
|
196
|
-
# majors_version = ".".join(project_version.split(".")[0:2])
|
|
197
199
|
|
|
198
200
|
if os.path.isfile(os.path.join(project_path, "config.json")):
|
|
199
201
|
cfg_ini = config(os.path.join(project_path, "config.json"))
|
|
200
202
|
else:
|
|
201
203
|
cfg_ini = configer.ProjectConfig(project_path)
|
|
202
204
|
project_version_cfg = cfg_ini["PROJECT"]["version"]
|
|
203
|
-
# project_version_cfg = cfg_ini["PROJECT"]["version"]
|
|
204
|
-
# if version_regex.match(project_version_cfg):
|
|
205
|
-
# majors_version_cfg = ".".join(project_version_cfg.split(".")[0:2])
|
|
206
205
|
reset_compilation = False
|
|
207
206
|
cfg = configer.ProjectConfig(project_path)
|
|
208
207
|
if str(project_version).strip() != str(project_version_cfg).strip():
|
|
209
208
|
reset_compilation = True
|
|
210
|
-
|
|
211
|
-
# reset_compilation = True
|
|
212
|
-
# new_version = ".".join([majors_version, str(0)])
|
|
213
|
-
# elif project_version_cfg != project_version:
|
|
214
|
-
# new_version = ".".join([majors_version, str(cfg_ini["PROJECT"]['compilation'])])
|
|
215
|
-
# else:
|
|
216
|
-
# new_version = project_version
|
|
217
|
-
# if compile or str(ppwa_version).strip() != str(PHANTERPWA_VERSION).strip():
|
|
218
|
-
# new_version = ".".join([majors_version, str(cfg_ini["PROJECT"]['compilation'])])
|
|
219
|
-
# with open(os.path.join(project_path, 'project.ini'), 'w', encoding="utf-8") as configfile:
|
|
220
|
-
# self._ini_project["PROJECT"]["version"] = new_version
|
|
221
|
-
# self._ini_project.write(configfile)
|
|
209
|
+
|
|
222
210
|
|
|
223
211
|
if compile:
|
|
224
212
|
c = compiler.Compiler(project_path, reset_compilation=reset_compilation)
|
|
@@ -348,3 +336,4 @@ if __name__ == "__main__":
|
|
|
348
336
|
AppRunv.run()
|
|
349
337
|
except KeyboardInterrupt:
|
|
350
338
|
AppRunv.stop()
|
|
339
|
+
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
phanterpwa/__init__.py,sha256=
|
|
1
|
+
phanterpwa/__init__.py,sha256=jfR2uUtXNrISHiuH1EcXzfoqjLvjnIzixNTpbZsUlAk,397
|
|
2
2
|
phanterpwa/__main__.py,sha256=1vSHtv6-sgAgpZiklf9bwarXX1b-fmKx1rjwJw4h78o,4017
|
|
3
3
|
phanterpwa/compiler.py,sha256=Je3qtVO_cZ69_PPWcXKyBgnRfQ-Ev-zkZ3UTN-ddOTQ,47478
|
|
4
|
-
phanterpwa/configer.py,sha256=
|
|
4
|
+
phanterpwa/configer.py,sha256=PFO_nVy9r6yt5iDso1amDIR0Ge2UYYK3h-ae9M0Ezyk,26359
|
|
5
5
|
phanterpwa/helpers.py,sha256=gUoSd6OeMtA08jwFMrOCsuou58nwech-aGdiPSCX9GI,12138
|
|
6
6
|
phanterpwa/mail.py,sha256=YrsiIQY_SpqySIc7mi6MfyY881DIsoYAJ5dPAz8vorE,5741
|
|
7
7
|
phanterpwa/reversexml.py,sha256=YJeI8VuzEPw0D2z0Cz-HLt2n27WyJawZh6HRNZX5Ujg,10764
|
|
8
|
-
phanterpwa/server.py,sha256=
|
|
8
|
+
phanterpwa/server.py,sha256=1KTp1vNtP8D8v9DvJfi-KYYv7tnABafRXV8bo9a7Cds,13334
|
|
9
9
|
phanterpwa/sms.py,sha256=XUULyDSk5gPjBqupchIcaGv-C6kX66XxrXpmzfnSp_A,1313
|
|
10
10
|
phanterpwa/tools.py,sha256=SKwqx_suix-b1DP72a7z98jlnSWDmtGNWgCQq_ogB1I,46173
|
|
11
11
|
phanterpwa/xmlconstructor.py,sha256=DMtc9BXI2NMGGmLszZXh2A63Iv0D1qgoWtn0aKyrmoo,162695
|
|
@@ -435,10 +435,10 @@ phanterpwa/usual_sass/preloaders/indefined_text.sass,sha256=z4JuUtBrzoqH3HuNFXvN
|
|
|
435
435
|
phanterpwa/usual_sass/preloaders/run_points.sass,sha256=EYl93ljfgAc-ZLJ0VScrCoIlHP7Nr6NLdxj1zk2wm_E,3367
|
|
436
436
|
phanterpwa/usual_sass/preloaders/square.sass,sha256=TOsh9muP4zkYLUJcw4i1LeRs60NrtgRWBk_1oMt2_58,1348
|
|
437
437
|
phanterpwa/usual_sass/preloaders/squares.sass,sha256=kH1I89qEfmbvYxCtKFVNcxP5bWIjnqbheXVnyGF0VNo,3862
|
|
438
|
-
phanterpwa-13.
|
|
439
|
-
phanterpwa-13.
|
|
440
|
-
phanterpwa-13.
|
|
441
|
-
phanterpwa-13.
|
|
442
|
-
phanterpwa-13.
|
|
443
|
-
phanterpwa-13.
|
|
444
|
-
phanterpwa-13.
|
|
438
|
+
phanterpwa-13.30.0.dist-info/LICENSE,sha256=lGEW1PRSZOkug2-d0IJgryCjqt6zhxN5x9pFgy3lx2E,1087
|
|
439
|
+
phanterpwa-13.30.0.dist-info/METADATA,sha256=noGlk3AqATgsCXJgwQWpa_Kt8_eIK8X_X3sRZptICos,1939
|
|
440
|
+
phanterpwa-13.30.0.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
441
|
+
phanterpwa-13.30.0.dist-info/dependency_links.txt,sha256=Pslekmz-4l1SpBO0x2aYkYZPCScmbrB9HUq1YvXYUzM,40
|
|
442
|
+
phanterpwa-13.30.0.dist-info/entry_points.txt,sha256=siJH2lFXIdsUBDRgcXV4blOb2_iku1vcbqxJ-trIQrw,56
|
|
443
|
+
phanterpwa-13.30.0.dist-info/top_level.txt,sha256=nF1WJ8AByxBv3bLKp3xySR2l2Twrj5n5n7C404lULSk,5319
|
|
444
|
+
phanterpwa-13.30.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|