<html>
  <head>

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