2
2
# -*- mode: python; coding: utf-8 -*-
4
4
# Mandos Monitor - Control and monitor the Mandos server
6
# Copyright © 2009-2016 Teddy Hogeborn
7
# Copyright © 2009-2016 Björn Påhlsson
9
# This program is free software: you can redistribute it and/or modify
10
# it under the terms of the GNU General Public License as published by
6
# Copyright © 2009-2019 Teddy Hogeborn
7
# Copyright © 2009-2019 Björn Påhlsson
9
# This file is part of Mandos.
11
# Mandos is free software: you can redistribute it and/or modify it
12
# under the terms of the GNU General Public License as published by
11
13
# the Free Software Foundation, either version 3 of the License, or
12
14
# (at your option) any later version.
14
# This program is distributed in the hope that it will be useful,
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16
# Mandos is distributed in the hope that it will be useful, but
17
# WITHOUT ANY WARRANTY; without even the implied warranty of
16
18
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
19
# GNU General Public License for more details.
19
21
# You should have received a copy of the GNU General Public License
20
# along with this program. If not, see
21
# <http://www.gnu.org/licenses/>.
22
# along with Mandos. If not, see <http://www.gnu.org/licenses/>.
23
24
# Contact the authors at <mandos@recompile.se>.
466
467
self.busname = domain + '.Mandos'
467
468
self.main_loop = GLib.MainLoop()
469
def client_not_found(self, fingerprint, address):
470
self.log_message("Client with address {} and fingerprint {}"
471
" could not be found"
472
.format(address, fingerprint))
470
def client_not_found(self, key_id, address):
471
self.log_message("Client with address {} and key ID {} could"
472
" not be found".format(address, key_id))
474
474
def rebuild(self):
475
475
"""This rebuilds the User Interface.
502
502
if self.max_log_length:
503
503
if len(self.log) > self.max_log_length:
504
504
del self.log[0:len(self.log)-self.max_log_length-1]
505
self.logbox.set_focus(len(self.logbox.body.contents),
505
self.logbox.set_focus(len(self.logbox.body.contents)-1,
506
506
coming_from="above")
630
self._input_callback_tag = (GLib.io_add_watch
630
self._input_callback_tag = (
632
GLib.IOChannel.unix_new(sys.stdin.fileno()),
633
GLib.PRIORITY_DEFAULT, GLib.IO_IN,
634
635
self.main_loop.run()
635
636
# Main loop has finished, we should close everything now
636
637
GLib.source_remove(self._input_callback_tag)
638
with warnings.catch_warnings():
639
warnings.simplefilter("ignore", BytesWarning)
640
643
self.main_loop.quit()