2
2
# -*- mode: python; coding: utf-8 -*-
 
4
4
# Mandos Monitor - Control and monitor the Mandos server
 
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
 
 
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
 
13
11
# the Free Software Foundation, either version 3 of the License, or
 
14
12
# (at your option) any later version.
 
16
 
#     Mandos is distributed in the hope that it will be useful, but
 
17
 
#     WITHOUT ANY WARRANTY; without even the implied warranty of
 
 
14
#     This program is distributed in the hope that it will be useful,
 
 
15
#     but WITHOUT ANY WARRANTY; without even the implied warranty of
 
18
16
#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
19
17
#     GNU General Public License for more details.
 
21
19
# You should have received a copy of the GNU General Public License
 
22
 
# along with Mandos.  If not, see <http://www.gnu.org/licenses/>.
 
 
20
# along with this program.  If not, see
 
 
21
# <http://www.gnu.org/licenses/>.
 
24
23
# Contact the authors at <mandos@recompile.se>.
 
 
467
466
        self.busname = domain + '.Mandos'
 
468
467
        self.main_loop = GLib.MainLoop()
 
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))
 
 
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))
 
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)-1,
 
 
505
        self.logbox.set_focus(len(self.logbox.body.contents),
 
506
506
                              coming_from="above")
 
 
630
 
        self._input_callback_tag = (
 
632
 
                GLib.IOChannel.unix_new(sys.stdin.fileno()),
 
633
 
                GLib.PRIORITY_DEFAULT, GLib.IO_IN,
 
 
630
        self._input_callback_tag = (GLib.io_add_watch
 
635
634
        self.main_loop.run()
 
636
635
        # Main loop has finished, we should close everything now
 
637
636
        GLib.source_remove(self._input_callback_tag)
 
638
 
        with warnings.catch_warnings():
 
639
 
            warnings.simplefilter("ignore", BytesWarning)
 
643
640
        self.main_loop.quit()