/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to mandos-monitor

  • Committer: Teddy Hogeborn
  • Date: 2010-01-01 15:17:12 UTC
  • Revision ID: teddy@fukt.bsnet.se-20100101151712-x20p42nhuvf9lxol
Bug fix: mandos-client needs GnuPG but lacked a dependency on it.  The
Mandos server, on the other hand, did not need GnuPG but declared an
incorrect dependency on it.

* debian/control (Package: mandos/Depends): Removed "gnupg (< 2)".
  (Package: mandos-client/Depends): Added "gnupg (<< 2)".

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
import UserList
21
21
 
 
22
import locale
 
23
 
 
24
locale.setlocale(locale.LC_ALL, u'')
 
25
 
22
26
# Some useful constants
23
27
domain = 'se.bsnet.fukt'
24
28
server_interface = domain + '.Mandos'
38
42
    properties and calls a hook function when any of them are
39
43
    changed.
40
44
    """
41
 
    def __init__(self, proxy_object=None, properties=None, *args,
42
 
                 **kwargs):
 
45
    def __init__(self, proxy_object=None, *args, **kwargs):
43
46
        self.proxy = proxy_object # Mandos Client proxy object
44
47
        
45
 
        if properties is None:
46
 
            self.properties = dict()
47
 
        else:
48
 
            self.properties = properties
 
48
        self.properties = dict()
49
49
        self.proxy.connect_to_signal(u"PropertyChanged",
50
50
                                     self.property_changed,
51
51
                                     client_interface,
52
52
                                     byte_arrays=True)
53
 
        
54
 
        if properties is None:
55
 
            self.properties.update(self.proxy.GetAll(client_interface,
56
 
                                                     dbus_interface =
57
 
                                                     dbus.PROPERTIES_IFACE))
 
53
 
 
54
        self.properties.update(
 
55
            self.proxy.GetAll(client_interface,
 
56
                              dbus_interface = dbus.PROPERTIES_IFACE))
58
57
        super(MandosClientPropertyCache, self).__init__(
59
 
            proxy_object=proxy_object,
60
 
            properties=properties, *args, **kwargs)
 
58
            proxy_object=proxy_object, *args, **kwargs)
61
59
    
62
60
    def property_changed(self, property=None, value=None):
63
61
        """This is called whenever we get a PropertyChanged signal
424
422
            return
425
423
        self.remove_client(client, path)
426
424
    
427
 
    def add_new_client(self, path, properties):
 
425
    def add_new_client(self, path):
428
426
        client_proxy_object = self.bus.get_object(self.busname, path)
429
427
        self.add_client(MandosClientWidget(server_proxy_object
430
428
                                           =self.mandos_serv,
431
429
                                           proxy_object
432
430
                                           =client_proxy_object,
433
 
                                           properties=properties,
434
431
                                           update_hook
435
432
                                           =self.refresh,
436
433
                                           delete_hook
437
 
                                           =self.remove_client),
 
434
                                           =self.remove_client,
 
435
                                           logger
 
436
                                           =self.log_message),
438
437
                        path=path)
439
438
    
440
439
    def add_client(self, client, path=None):
562
561
ui = UserInterface()
563
562
try:
564
563
    ui.run()
565
 
except:
 
564
except Exception, e:
 
565
    ui.log_message(unicode(e))
566
566
    ui.screen.stop()
567
567
    raise