simo 2.0.30__py3-none-any.whl → 2.0.31__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 simo might be problematic. Click here for more details.
- simo/generic/__pycache__/forms.cpython-38.pyc +0 -0
- simo/generic/__pycache__/gateways.cpython-38.pyc +0 -0
- simo/generic/forms.py +1 -1
- simo/generic/gateways.py +17 -9
- {simo-2.0.30.dist-info → simo-2.0.31.dist-info}/METADATA +1 -1
- {simo-2.0.30.dist-info → simo-2.0.31.dist-info}/RECORD +9 -9
- {simo-2.0.30.dist-info → simo-2.0.31.dist-info}/LICENSE.md +0 -0
- {simo-2.0.30.dist-info → simo-2.0.31.dist-info}/WHEEL +0 -0
- {simo-2.0.30.dist-info → simo-2.0.31.dist-info}/top_level.txt +0 -0
|
Binary file
|
|
Binary file
|
simo/generic/forms.py
CHANGED
|
@@ -33,7 +33,7 @@ class ScriptConfigForm(BaseComponentForm):
|
|
|
33
33
|
)
|
|
34
34
|
keep_alive = forms.BooleanField(
|
|
35
35
|
initial=True, required=False,
|
|
36
|
-
help_text="
|
|
36
|
+
help_text="Restart the script if it fails. "
|
|
37
37
|
)
|
|
38
38
|
code = forms.CharField(widget=PythonCode)
|
|
39
39
|
log = forms.CharField(
|
simo/generic/gateways.py
CHANGED
|
@@ -216,7 +216,7 @@ class GenericGatewayHandler(BaseObjectCommandsGatewayHandler):
|
|
|
216
216
|
for script in Component.objects.filter(
|
|
217
217
|
controller_uid=Script.uid,
|
|
218
218
|
config__keep_alive=True
|
|
219
|
-
).exclude(
|
|
219
|
+
).exclude(value__in=('running', 'stopped', 'finished')):
|
|
220
220
|
self.start_script(script)
|
|
221
221
|
|
|
222
222
|
def watch_watering(self):
|
|
@@ -252,12 +252,18 @@ class GenericGatewayHandler(BaseObjectCommandsGatewayHandler):
|
|
|
252
252
|
for component in Component.objects.filter(
|
|
253
253
|
controller_uid=Script.uid, value='running'
|
|
254
254
|
):
|
|
255
|
-
component.value = '
|
|
255
|
+
component.value = 'error'
|
|
256
256
|
component.save()
|
|
257
257
|
|
|
258
|
+
# Start scripts that are designed to be autostarted
|
|
259
|
+
# as well as those who are designed to be kept alive, but
|
|
260
|
+
# got terminated unexpectedly
|
|
258
261
|
for script in Component.objects.filter(
|
|
259
|
-
controller_uid=Script.uid,
|
|
260
|
-
)
|
|
262
|
+
controller_uid=Script.uid,
|
|
263
|
+
).filter(
|
|
264
|
+
Q(config__autostart=True) |
|
|
265
|
+
Q(value='error', config__keep_alive=True)
|
|
266
|
+
).disticnt():
|
|
261
267
|
self.start_script(script)
|
|
262
268
|
|
|
263
269
|
for cam in Component.objects.filter(
|
|
@@ -276,7 +282,9 @@ class GenericGatewayHandler(BaseObjectCommandsGatewayHandler):
|
|
|
276
282
|
|
|
277
283
|
script_ids = [id for id in self.running_scripts.keys()]
|
|
278
284
|
for id in script_ids:
|
|
279
|
-
self.stop_script(
|
|
285
|
+
self.stop_script(
|
|
286
|
+
Component.objects.get(id=id), 'error'
|
|
287
|
+
)
|
|
280
288
|
|
|
281
289
|
while len(script_ids):
|
|
282
290
|
time.sleep(0.1)
|
|
@@ -310,17 +318,17 @@ class GenericGatewayHandler(BaseObjectCommandsGatewayHandler):
|
|
|
310
318
|
if component.id in self.running_scripts:
|
|
311
319
|
if self.running_scripts[component.id].is_alive():
|
|
312
320
|
self.running_scripts[component.id].kill()
|
|
313
|
-
component.value = '
|
|
321
|
+
component.value = 'error'
|
|
314
322
|
component.save(update_fields=['value'])
|
|
315
323
|
self.running_scripts[component.id] = ScriptRunHandler(
|
|
316
324
|
component.id, daemon=True
|
|
317
325
|
)
|
|
318
326
|
self.running_scripts[component.id].start()
|
|
319
327
|
|
|
320
|
-
def stop_script(self, component):
|
|
328
|
+
def stop_script(self, component, stop_status='stopped'):
|
|
321
329
|
if component.id not in self.running_scripts:
|
|
322
330
|
if component.value == 'running':
|
|
323
|
-
component.value =
|
|
331
|
+
component.value = stop_status
|
|
324
332
|
component.save(update_fields=['value'])
|
|
325
333
|
return
|
|
326
334
|
if self.running_scripts[component.id].is_alive():
|
|
@@ -342,7 +350,7 @@ class GenericGatewayHandler(BaseObjectCommandsGatewayHandler):
|
|
|
342
350
|
)
|
|
343
351
|
self.running_scripts[component.id].kill()
|
|
344
352
|
|
|
345
|
-
component.value =
|
|
353
|
+
component.value = stop_status
|
|
346
354
|
component.save(update_fields=['value'])
|
|
347
355
|
self.running_scripts.pop(component.id)
|
|
348
356
|
logger.handlers = []
|
|
@@ -10276,8 +10276,8 @@ simo/generic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
10276
10276
|
simo/generic/app_widgets.py,sha256=E_pnpA1hxMIhenRCrHoQ5cik06jm2BAHCkl_eo-OudU,1264
|
|
10277
10277
|
simo/generic/base_types.py,sha256=djymox_boXTHX1BTTCLXrCH7ED-uAsV_idhaDOc3OLI,409
|
|
10278
10278
|
simo/generic/controllers.py,sha256=WYuOUzDWvkYRaTvlbdGy_qmwp1o_ohqKDfV7OrOq2QU,52218
|
|
10279
|
-
simo/generic/forms.py,sha256=
|
|
10280
|
-
simo/generic/gateways.py,sha256=
|
|
10279
|
+
simo/generic/forms.py,sha256=NPHNg_8BPTIJt-DR0-GkNWgVo9bE0_50PUWSnpIE4Dg,24262
|
|
10280
|
+
simo/generic/gateways.py,sha256=Vw2r9wsIa86bs2nS-ExT31smpKnA19E0paiho7HeNX0,17390
|
|
10281
10281
|
simo/generic/models.py,sha256=92TACMhJHadAg0TT9GnARO_R3_Sl6i-GGjhG_x7YdFI,7391
|
|
10282
10282
|
simo/generic/routing.py,sha256=elQVZmgnPiieEuti4sJ7zITk1hlRxpgbotcutJJgC60,228
|
|
10283
10283
|
simo/generic/socket_consumers.py,sha256=NfTQGYtVAc864IoogZRxf_0xpDPM0eMCWn0SlKA5P7Y,1751
|
|
@@ -10285,8 +10285,8 @@ simo/generic/__pycache__/__init__.cpython-38.pyc,sha256=mLu54WS9KIl-pHwVCBKpsDFI
|
|
|
10285
10285
|
simo/generic/__pycache__/app_widgets.cpython-38.pyc,sha256=0IoKRG9n1tkNRRkrqAeOQwWBPd_33u98JBcVtMVVCio,2374
|
|
10286
10286
|
simo/generic/__pycache__/base_types.cpython-38.pyc,sha256=ptw6axyAqemZA35oa6vzr7EihzvbhW9w7Y-G6kfDedU,555
|
|
10287
10287
|
simo/generic/__pycache__/controllers.cpython-38.pyc,sha256=e0bvgyePgJbIs1omBq0TRPlVSKar2sK_JbUKqDRj7mY,33235
|
|
10288
|
-
simo/generic/__pycache__/forms.cpython-38.pyc,sha256=
|
|
10289
|
-
simo/generic/__pycache__/gateways.cpython-38.pyc,sha256=
|
|
10288
|
+
simo/generic/__pycache__/forms.cpython-38.pyc,sha256=du8pawGkAyGP51Cb6uWgvVLx48JZKNkVCdOpRmqQFaA,17915
|
|
10289
|
+
simo/generic/__pycache__/gateways.cpython-38.pyc,sha256=LcBnE4rzzBOpVP1oI2mHSoB4dtZ4wP_vL0Y-YzTBVRE,12786
|
|
10290
10290
|
simo/generic/__pycache__/models.cpython-38.pyc,sha256=PzlZsM1jxo3FVb7QDm3bny8UFwTsGrMQe4mj4tJ06eQ,5675
|
|
10291
10291
|
simo/generic/__pycache__/routing.cpython-38.pyc,sha256=xtxTUTBTdivzFyA5Wh7k-hUj1WDO_FiRq6HYXdbr9Ks,382
|
|
10292
10292
|
simo/generic/__pycache__/socket_consumers.cpython-38.pyc,sha256=piFHces0J9QuXu_CNBCQCYjoZEeoaxyVjLfJ9KaR8C8,1898
|
|
@@ -10456,8 +10456,8 @@ simo/users/templates/invitations/expired_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCe
|
|
|
10456
10456
|
simo/users/templates/invitations/expired_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10457
10457
|
simo/users/templates/invitations/taken_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10458
10458
|
simo/users/templates/invitations/taken_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10459
|
-
simo-2.0.
|
|
10460
|
-
simo-2.0.
|
|
10461
|
-
simo-2.0.
|
|
10462
|
-
simo-2.0.
|
|
10463
|
-
simo-2.0.
|
|
10459
|
+
simo-2.0.31.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
|
|
10460
|
+
simo-2.0.31.dist-info/METADATA,sha256=65C9h0Hq9Zg-Iob4o6DO_iM3KjIs6e2u5D5qoNdprYw,1730
|
|
10461
|
+
simo-2.0.31.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
10462
|
+
simo-2.0.31.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
|
|
10463
|
+
simo-2.0.31.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|