Changeset 323

Show
Ignore:
Timestamp:
08/22/08 13:06:17 (3 months ago)
Author:
haypo
Message:

Create getmail extractor

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lamer/lamer.py

    r107 r323  
    5050    def displayAccount(self, **data): 
    5151        message = [] 
    52         for key in ("user", "login", "email"): 
     52        if "protocol" in data: 
     53            message.append("Protocol %s: " % data["protocol"]) 
     54            del data["protocol"] 
     55        # Try to write the keys in a specific order 
     56        for key in ("user", "username", "login", "email", "password"): 
    5357            if key not in data: 
    5458                continue 
    55             message.append("%s=%s, " % (key, data[key])) 
     59            message.append("%s=%s" % (key, data[key])) 
    5660            del data[key] 
    57             break 
    58         if "password" in data: 
    59             message.append("password=%s" % data["password"]) 
    60             del data["password"] 
    61         if "protocol" in data: 
    62             message.insert(0, "Protocol %s: " % data["protocol"]) 
    63             del data["protocol"] 
     61        if "server" in data and "port" in data: 
     62            message.append("server=%s:%s" % (data["server"], data["port"])) 
     63            del data["server"] 
     64            del data["port"] 
    6465        for key, value in data.iteritems(): 
    65             message.append(", %s=%s" % (key, value)) 
    66         self.write(''.join(message)) 
     66            message.append("%s=%s" % (key, value)) 
     67        self.write(', '.join(message)) 
    6768