Mercurial > libervia-backend
annotate frontends/src/quick_frontend/quick_gateways.py @ 694:4284b6ad8aa3
tests: plugin text syntaxes sanitisation tests
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 12 Nov 2013 14:16:11 +0100 |
parents | 84a6e83157c2 |
children | bfabeedbf32e |
rev | line source |
---|---|
173 | 1 #!/usr/bin/python |
2 # -*- coding: utf-8 -*- | |
3 | |
609
84a6e83157c2
fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents:
588
diff
changeset
|
4 # helper class for making a SAT frontend |
84a6e83157c2
fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents:
588
diff
changeset
|
5 # Copyright (C) 2009, 2010, 2011, 2012, 2013 Jérôme Poisson (goffi@goffi.org) |
173 | 6 |
609
84a6e83157c2
fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents:
588
diff
changeset
|
7 # This program is free software: you can redistribute it and/or modify |
84a6e83157c2
fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents:
588
diff
changeset
|
8 # it under the terms of the GNU Affero General Public License as published by |
84a6e83157c2
fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents:
588
diff
changeset
|
9 # the Free Software Foundation, either version 3 of the License, or |
84a6e83157c2
fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents:
588
diff
changeset
|
10 # (at your option) any later version. |
173 | 11 |
609
84a6e83157c2
fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents:
588
diff
changeset
|
12 # This program is distributed in the hope that it will be useful, |
84a6e83157c2
fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents:
588
diff
changeset
|
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
84a6e83157c2
fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents:
588
diff
changeset
|
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
84a6e83157c2
fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents:
588
diff
changeset
|
15 # GNU Affero General Public License for more details. |
173 | 16 |
609
84a6e83157c2
fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents:
588
diff
changeset
|
17 # You should have received a copy of the GNU Affero General Public License |
84a6e83157c2
fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents:
588
diff
changeset
|
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
173 | 19 |
20 | |
21 | |
22 | |
588
beaf6bec2fcd
Remove every old-style class.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
587
diff
changeset
|
23 class QuickGatewaysManager(object): |
173 | 24 |
587
952322b1d490
Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
572
diff
changeset
|
25 |
173 | 26 def __init__(self, host, gateways, title=_("Gateways manager"), server=None): |
27 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. | |
28 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).""") | |
29 self.host = host | |
30 | |
31 def getGatewayDesc(self, gat_type): | |
32 """Return a human readable description of gateway type | |
33 @param gat_type: type of gateway, as given by SàT""" | |
34 desc = _('Unknown IM') | |
35 | |
36 if gat_type == 'irc': | |
37 desc = "Internet Relay Chat" | |
38 elif gat_type == 'xmpp': | |
39 desc = "XMPP" | |
40 elif gat_type == 'qq': | |
41 desc = "Tencent QQ" | |
42 elif gat_type == 'simple': | |
43 desc = "SIP/SIMPLE" | |
44 elif gat_type == 'icq': | |
45 desc = "ICQ" | |
46 elif gat_type == 'yahoo': | |
47 desc = "Yahoo! Messenger" | |
48 elif gat_type == 'gadu-gadu': | |
49 desc = "Gadu-Gadu" | |
50 elif gat_type == 'aim': | |
51 desc = "AOL Instant Messenger" | |
52 elif gat_type == 'msn': | |
53 desc = 'Windows Live Messenger' | |
54 | |
55 return desc |