/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

  • Committer: teddy at bsnet
  • Date: 2010-08-23 19:23:15 UTC
  • mto: (24.1.154 mandos)
  • mto: This revision was merged to the branch mainline in revision 421.
  • Revision ID: teddy@fukt.bsnet.se-20100823192315-pefgye0l6cavcejs
* debian/control (mandos/Depends): Added "python-urwid".
* mandos (Client.approved_by_default): Changed default to "True".
  (Client.approved_delay): Changed default to "0s".
  (ClientDBus.GotSecret, ClientDBus.Rejected,
  ClientDBus.NeedApproval): Emit "PropertyChanged" signal for the
                            "approved_pending" property.

Show diffs side-by-side

added added

removed removed

Lines of Context:
326
326
        self.approvals_pending = 0
327
327
        self._approved = None
328
328
        self.approved_by_default = config.get(u"approved_by_default",
329
 
                                              False)
 
329
                                              True)
330
330
        self.approved_delay = string_to_delta(
331
331
            config[u"approved_delay"])
332
332
        self.approved_duration = string_to_delta(
816
816
 
817
817
    def approved_pending(self):
818
818
        return self.approvals_pending > 0
819
 
 
 
819
    
820
820
    
821
821
    ## D-Bus methods, signals & properties
822
822
    _interface = u"se.bsnet.fukt.Mandos.Client"
845
845
    @dbus.service.signal(_interface)
846
846
    def GotSecret(self):
847
847
        "D-Bus signal"
848
 
        pass
 
848
        if self.approved_pending():
 
849
            self.PropertyChanged(dbus.String(u"checker_running"),
 
850
                                 dbus.Boolean(False, variant_level=1))
849
851
    
850
852
    # Rejected - signal
851
853
    @dbus.service.signal(_interface, signature=u"s")
852
854
    def Rejected(self, reason):
853
855
        "D-Bus signal"
854
 
        pass
 
856
        if self.approved_pending():
 
857
            self.PropertyChanged(dbus.String(u"checker_running"),
 
858
                                 dbus.Boolean(False, variant_level=1))
855
859
    
856
860
    # NeedApproval - signal
857
861
    @dbus.service.signal(_interface, signature=u"db")
858
862
    def NeedApproval(self, timeout, default):
859
863
        "D-Bus signal"
860
 
        pass
 
864
        if not self.approved_pending():
 
865
            self.PropertyChanged(dbus.String(u"approved_pending"),
 
866
                                 dbus.Boolean(True, variant_level=1))
861
867
    
862
868
    ## Methods
863
869
 
1684
1690
                        u"interval": u"5m",
1685
1691
                        u"checker": u"fping -q -- %%(host)s",
1686
1692
                        u"host": u"",
1687
 
                        u"approved_delay": u"5m",
 
1693
                        u"approved_delay": u"0s",
1688
1694
                        u"approved_duration": u"1s",
1689
1695
                        }
1690
1696
    client_config = configparser.SafeConfigParser(client_defaults)