Alexey Smishlayev
2015-09-29 12:06:03 UTC
Good day everyone!
I would like my PEAK application to stop on ^C or SIGINT. Currently, in
that case I get an output something like
in run
in run
186, in runUntil
line 1192, in run
line 1204, in mainLoop
line 105, in doSelect
to anything else except empty tuple, on the application's startup I get
the following error (I tried "stopOnSignals = ('SIGINT',)")
in run
682, in delegate
682, in delegate
Best regards,
Alexey Smishlayev
I would like my PEAK application to stop on ^C or SIGINT. Currently, in
that case I get an output something like
29.09.2015 14:56:48.179 [DEBUG] Connect.twisted Unexpected error in
main loop.29.09.2015 14:56:48.190 [ERROR] Connect.twisted Traceback (most
29.09.2015 14:56:48.190 [ERROR] File
"/Users/alexey/xtech2/tester/build/lib/ank/BBS/CommandBase.py", line 38,29.09.2015 14:56:48.190 [ERROR] File
in run
29.09.2015 14:56:48.190 [ERROR] self.mainLoop.run()
29.09.2015 14:56:48.190 [ERROR] File
"/Library/Python/2.7/site-packages/peak/running/scheduler.py", line 78,29.09.2015 14:56:48.190 [ERROR] File
in run
29.09.2015 14:56:48.190 [ERROR] return
self.eventLoop.runUntil(self.exitCode,True,idle=self.sleep)[0]29.09.2015 14:56:48.190 [ERROR] File
"/Library/Python/2.7/site-packages/peak/events/twisted_support.py", line186, in runUntil
29.09.2015 14:56:48.190 [ERROR] self.reactor.run(False)
29.09.2015 14:56:48.190 [ERROR] File
"/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/internet/base.py",29.09.2015 14:56:48.190 [ERROR] File
line 1192, in run
29.09.2015 14:56:48.190 [ERROR] self.mainLoop()
29.09.2015 14:56:48.190 [ERROR] --- <exception caught here> ---
29.09.2015 14:56:48.190 [ERROR] File
"/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/internet/base.py",29.09.2015 14:56:48.190 [ERROR] --- <exception caught here> ---
29.09.2015 14:56:48.190 [ERROR] File
line 1204, in mainLoop
29.09.2015 14:56:48.190 [ERROR] self.doIteration(t)
29.09.2015 14:56:48.190 [ERROR] File
"/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/internet/selectreactor.py",29.09.2015 14:56:48.190 [ERROR] File
line 105, in doSelect
29.09.2015 14:56:48.190 [ERROR] [], timeout)
in the log file. In CommandBase.py attribute self.mainloop is defined asfrom peak.api import binding
from peak.running import commands, interfaces
mainLoop = binding.Obtain(interfaces.IMainLoop)
...
If I set "peak.running.mainLoop.stopOnSignals" in my project's .ini filefrom peak.running import commands, interfaces
mainLoop = binding.Obtain(interfaces.IMainLoop)
...
to anything else except empty tuple, on the application's startup I get
the following error (I tried "stopOnSignals = ('SIGINT',)")
File "../ank/BBS/Assembler.py", line 370, in run
_exitCode = _root.run()
File "/Library/Python/2.7/site-packages/peak/running/commands.py",
line 229, in run_exitCode = _root.run()
File "/Library/Python/2.7/site-packages/peak/running/commands.py",
return self._run() or 0
File "/Library/Python/2.7/site-packages/peak/running/commands.py",
line 509, in _runFile "/Library/Python/2.7/site-packages/peak/running/commands.py",
return self.invoke()
File
"/Users/alexey/xtech2/tester/build/lib/ank/BBS/CommandBase.py", line 38,File
in run
self.mainLoop.run()
File "/Library/Python/2.7/site-packages/peak/running/scheduler.py",
line 66, in runFile "/Library/Python/2.7/site-packages/peak/running/scheduler.py",
handler = self.eventLoop.signals(*self.stopOnSignals)
File "_once.pyx", line 112, in _once.BaseDescriptor.__get__
File "_once.pyx", line 100, in _once.__get__
File
"/Library/Python/2.7/site-packages/peak/binding/components.py", lineFile "_once.pyx", line 112, in _once.BaseDescriptor.__get__
File "_once.pyx", line 100, in _once.__get__
File
682, in delegate
return getattr(getattr(s,delegateAttr),a)
File "_once.pyx", line 112, in _once.BaseDescriptor.__get__
File "_once.pyx", line 100, in _once.__get__
File
"/Library/Python/2.7/site-packages/peak/binding/components.py", lineFile "_once.pyx", line 112, in _once.BaseDescriptor.__get__
File "_once.pyx", line 100, in _once.__get__
File
682, in delegate
return getattr(getattr(s,delegateAttr),a)
File "_once.pyx", line 88, in _once.BaseDescriptor.__get__
AttributeError: ('Recursive attempt to compute attribute', 'signals')
How do I do everything correctly?File "_once.pyx", line 88, in _once.BaseDescriptor.__get__
AttributeError: ('Recursive attempt to compute attribute', 'signals')
Best regards,
Alexey Smishlayev