Unverified Commit 55d892d1 authored by anarcat's avatar anarcat 💥 Committed by Pierre-Elliott Bécue
Browse files

Add a get method to the Account class



As in dict.get(key, default_value)

Signed-off-by: default avatarPierre-Elliott Bécue <peb@debian.org>
parent 4551de6f
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -55,6 +55,11 @@ class Account:
    def __contains__(self, key):
        return key in self.attributes

    def get(self, key, default=None):
        if key not in self:
            return default
        return self[key]

    def has_mail(self):
        if 'mailDisableMessage' in self.attributes:
            return False