/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: 2009-11-19 18:31:28 UTC
  • Revision ID: teddy@fukt.bsnet.se-20091119183128-ttstewh61xmtnil1
* Makefile (LINK_FORTIFY_LD): Bug fix: removed "-fPIE".
* mandos-keygen: Bug fix: Fix quoting for the "--password" option.

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