annotate frontends/src/quick_frontend/quick_gateways.py @ 708:6aa71c853bf5

plugin group blog: management of extra data/rich text for blog comments
author Goffi <goffi@goffi.org>
date Fri, 15 Nov 2013 15:27:03 +0100
parents 84a6e83157c2
children bfabeedbf32e
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
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
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
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
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
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
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
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
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
19
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
588
beaf6bec2fcd Remove every old-style class.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
23 class QuickGatewaysManager(object):
173
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
24
587
952322b1d490 Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 572
diff changeset
25
173
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
26 def __init__(self, host, gateways, title=_("Gateways manager"), server=None):
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
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.
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
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).""")
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
29 self.host = host
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
30
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
31 def getGatewayDesc(self, gat_type):
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
32 """Return a human readable description of gateway type
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
33 @param gat_type: type of gateway, as given by SàT"""
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
34 desc = _('Unknown IM')
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
35
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
36 if gat_type == 'irc':
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
37 desc = "Internet Relay Chat"
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
38 elif gat_type == 'xmpp':
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
39 desc = "XMPP"
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
40 elif gat_type == 'qq':
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
41 desc = "Tencent QQ"
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
42 elif gat_type == 'simple':
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
43 desc = "SIP/SIMPLE"
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
44 elif gat_type == 'icq':
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
45 desc = "ICQ"
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
46 elif gat_type == 'yahoo':
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
47 desc = "Yahoo! Messenger"
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
48 elif gat_type == 'gadu-gadu':
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
49 desc = "Gadu-Gadu"
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
50 elif gat_type == 'aim':
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
51 desc = "AOL Instant Messenger"
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
52 elif gat_type == 'msn':
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
53 desc = 'Windows Live Messenger'
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
54
ec6611445a5b Primitivus: added Gateways support
Goffi <goffi@goffi.org>
parents:
diff changeset
55 return desc