annotate frontends/src/quick_frontend/quick_gateways.py @ 411:b109a79ac72f

primitivus: urwid 1.0.0 update (crash was caused by using non unicode caption)
author Goffi <goffi@goffi.org>
date Sat, 08 Oct 2011 21:03:02 +0200
parents b1794cbb88e5
children cf005701624b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
173
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
1 #!/usr/bin/python
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
2 # -*- coding: utf-8 -*-
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
3
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
4 """
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
5 helper class for making a SAT frontend
228
b1794cbb88e5 2011 copyright upgrade
Goffi <goffi@goffi.org>
parents: 223
diff changeset
6 Copyright (C) 2009, 2010, 2011 Jérôme Poisson (goffi@goffi.org)
173
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
7
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
8 This program is free software: you can redistribute it and/or modify
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
9 it under the terms of the GNU General Public License as published by
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
10 the Free Software Foundation, either version 3 of the License, or
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
11 (at your option) any later version.
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
12
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
13 This program is distributed in the hope that it will be useful,
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
16 GNU General Public License for more details.
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
17
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
20 """
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
21
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
22
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
23
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
24
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
25 class QuickGatewaysManager():
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
26
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
27
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
28 def __init__(self, host, gateways, title=_("Gateways manager"), server=None):
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
29 self.WARNING_MSG = _(u"""Be careful ! Gateways allow you to use an external IM (legacy IM), so you can see your contact as jabber contacts.
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
30 But when you do this, all your messages go throught the external legacy IM server, it is a huge privacy issue (i.e.: all your messages throught the gateway can be monitored, recorded, analyzed by the external server, most of time a private company).""")
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
31 self.host = host
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
32
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
33 def getGatewayDesc(self, gat_type):
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
34 """Return a human readable description of gateway type
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
35 @param gat_type: type of gateway, as given by SàT"""
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
36 desc = _('Unknown IM')
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
37
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
38 if gat_type == 'irc':
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
39 desc = "Internet Relay Chat"
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
40 elif gat_type == 'xmpp':
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
41 desc = "XMPP"
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
42 elif gat_type == 'qq':
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
43 desc = "Tencent QQ"
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
44 elif gat_type == 'simple':
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
45 desc = "SIP/SIMPLE"
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
46 elif gat_type == 'icq':
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
47 desc = "ICQ"
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
48 elif gat_type == 'yahoo':
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
49 desc = "Yahoo! Messenger"
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
50 elif gat_type == 'gadu-gadu':
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
51 desc = "Gadu-Gadu"
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
52 elif gat_type == 'aim':
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
53 desc = "AOL Instant Messenger"
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
54 elif gat_type == 'msn':
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
55 desc = 'Windows Live Messenger'
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
56
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
57 return desc