Mercurial > libervia-backend
comparison twisted/plugins/sat_plugin.py @ 2695:c5543fba97e8
core: fixed reactor crash by installing reactor only in makeService
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 19 Nov 2018 23:46:50 +0100 |
parents | ef93fcbaa749 |
children | ab2696e34d29 |
comparison
equal
deleted
inserted
replaced
2694:a8ec00731ce7 | 2695:c5543fba97e8 |
---|---|
15 # GNU Affero General Public License for more details. | 15 # GNU Affero General Public License for more details. |
16 | 16 |
17 # You should have received a copy of the GNU Affero General Public License | 17 # You should have received a copy of the GNU Affero General Public License |
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 | 19 |
20 from twisted.internet import gireactor | |
21 gireactor.install() | |
22 from twisted.internet import defer | 20 from twisted.internet import defer |
23 if defer.Deferred.debug: | 21 if defer.Deferred.debug: |
24 # if we are in debug mode, we want to use ipdb instead of pdb | 22 # if we are in debug mode, we want to use ipdb instead of pdb |
25 try: | 23 try: |
26 import ipdb | 24 import ipdb |
57 tapname = C.APP_NAME_FILE | 55 tapname = C.APP_NAME_FILE |
58 description = _(u"%s XMPP client backend") % C.APP_NAME_FULL | 56 description = _(u"%s XMPP client backend") % C.APP_NAME_FULL |
59 options = Options | 57 options = Options |
60 | 58 |
61 def makeService(self, options): | 59 def makeService(self, options): |
60 from twisted.internet import gireactor | |
61 gireactor.install() | |
62 # XXX: SAT must be imported after log configuration, because it write stuff to logs | 62 # XXX: SAT must be imported after log configuration, because it write stuff to logs |
63 initialise(options.parent) | 63 initialise(options.parent) |
64 from sat.core.sat_main import SAT | 64 from sat.core.sat_main import SAT |
65 return SAT() | 65 return SAT() |
66 | 66 |