5 def __init__(self
, mailerstring
):
6 # The following part needs to being moved
7 # to another structure. However. For the beginning it
8 # should work like this ... Or not ;)
10 tmp
= mailerstring
.split()
11 # setting default value to ensure we got some client
12 # in case no of the following rules apply
14 self
.mailclient
= mailerstring
17 if tmp
[0] == "Sylpheed" and tmp
[0] != mailerstring
:
18 if tmp
[1] == "version":
19 self
.mailclient
= tmp
[0]
23 self
.mailclient
= tmp
[0]
25 self
.buildstr
= tmp
[2]
26 if tmp
[0].startswith("Claws"):
27 self
.mailclient
= "Claws Mail"
29 if (tmp
[0] == "Thunderbird" or
30 tmp
[0] == "Mozilla-Thunderbird" or
32 self
.mailclient
= "Thunderbird"
34 self
.buildstr
= tmp
[2]
35 if tmp
[0].startswith( "Mozilla/5.0"):
36 self
.mailclient
= "Mozilla based"
39 if (tmp
[0].startswith("Mutt") or
40 tmp
[0].startswith("SquirrelMail") or
41 tmp
[0].startswith("KMail") or
42 tmp
[0].startswith("KNode") or
43 tmp
[0].startswith("Gnus") or
44 tmp
[0].startswith("tin") or
45 tmp
[0].startswith("slrn") or
46 tmp
[0].startswith("Pan")):
47 if tmp
[0].find("/") > -1:
48 self
.mailclient
, self
.version
= tmp
[0].split("/")
49 if self
.version
.find("+") > -1:
50 self
.version
, self
.buildstr
= self
.version
.split("+")
51 # Mailclient with single Name and simple version string
53 if tmp
[0] == "Balsa" or tmp
[0] == "Evolution":
54 self
.mailclient
= tmp
[0]
56 # Mailclient with single Name, version stirng and build string
57 if tmp
[0] == "Alpine":
58 self
.mailclient
= tmp
[0]
60 self
.buildstr
= tmp
[2]
62 def __cmp__(self
, other
):
66 """Not yet implemented"""
69 # def getMailClient(self):
70 # return self.mailclient, return self.version
75 def getBuildString(self
):
78 def getMailClient(self
):
79 return self
.mailclient
, self
.version
, self
.buildstr
, self
.OS