Commit d75d4730 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

[client_icons] Refactor Plugin

- Use IconTheme
- Add/Remove some clients
parent f0a1da45
CLIENTS = {
'http://www.adium.im/': ['adium.png', 'Adium'],
'http://www.adiumx.com/caps': ['adium.png', 'Adium'],
'http://www.adiumx.com': ['adium.png', 'Adium'],
'http://aqq.eu/': ['aqq.png', 'Aqq'],
'http://www.asterisk.org/xmpp/client/caps': ['asterisk.png', 'Asterisk'],
'http://ayttm.souceforge.net/caps': ['ayttm.png', 'Ayttm'],
'http://www.barobin.com/caps': ['bayanicq.png', 'Bayanicq'],
'http://bitlbee.org/xmpp/caps': ['bitlbee.png', 'BitlBee'],
'http://simpleapps.ru/caps#blacksmith': ['bot.png', 'Blacksmith'],
'http://blacksmith-2.googlecode.com/svn/': ['bot.png', 'Blacksmith-2'],
'http://jabber.pdg.pl/caps': ['bombus-klub.png', 'Bombus-klub'],
'http://klub54.wen.ru': ['bombus-klub.png', 'Bombus-klub'],
'http://bombus-im.org/java': ['bombus.png', 'Bombus'],
'http://bombusmod.net.ru/caps': ['bombusmod.png', 'Bombusmod'],
'http://bombusng-md.googlecode.com': ['bombusng.png', 'Bombus-NG'],
'http://bombus-im.org/ng': ['bombusng.png', 'Bombus-NG'],
'http://voffk.org.ru/bombus': ['bombusplus.png', 'Bombus+'],
'http://bombusng-qd.googlecode.com': ['bombusqd.png', 'Bombus-NG'],
'http://bombusmod-qd.wen.ru/caps': ['bombusqd.png', 'BombusQD'],
'http://bombusmod.net.ru': ['bombusmod.png', 'Bombusmod'],
'http://ex-im.name/caps': ['bombusmod.png', 'Bombusmod'],
'http://bombusmod.eu,http://bombus.pl': ['bombuspl.png', 'Bombusmod'],
'ChatSecure': ['chatsecure.png', 'ChatSecure'],
'http://coccinella.sourceforge.net/protocol/caps': \
['coccinella.png', 'Coccinella'],
'http://conversations.im': ['conversations.png', 'Conversations'],
'Conversations Legacy': ['conversations-legacy.png', 'Conversations Legacy'],
'https://conversejs.org': ['conversejs.png', 'Converse'],
'http://digsby.com/caps': ['digsby.png', 'Digsby'],
'https://dino.im': ['dino.png', 'Dino'],
'http://emacs-jabber.sourceforge.net': ['emacs.png', 'Emacs Jabber client'],
'http://emess.eqx.su/caps': ['emess.png', 'Emess'],
'http://live.gnome.org/empathy/caps': \
['telepathy.freedesktop.org.png', 'Empathy'],
'http://eqo.com/': ['libpurple.png', 'Eqo'],
'http://exodus.jabberstudio.org/caps': ['exodus.png', 'Exodus'],
'http://fatal-bot.spb.ru/caps': ['bot.png', 'Fatal-bot'],
'http://svn.posix.ru/fatal-bot/trunk': ['bot.png', 'Fatal-bot'],
'http://isida.googlecode.com': ['isida-bot.png', 'Isida'],
'http://isida-bot.com': ['isida-bot.png', 'Isida'],
'facebook.com': ['facebook.png', 'Facebook'],
'http://jabga.ru': ['fin.png', 'Fin jabber'],
'http://chat.freize.org/caps': ['freize.png', 'Freize'],
'http://gabber.sourceforge.net': ['gabber.png', 'Gabber'],
'http://gaim.sf.net/caps': ['gaim.png', 'Gaim'],
'http://gajim.org': ['gajim.png', 'Gajim'],
'http://gajim.org/caps': ['gajim.png', 'Gajim'],
'http://glu.net/': ['glu.png', 'Glu'],
'http://mail.google.com/xmpp/client/caps': ['google.com.png', 'GMail'],
'http://www.android.com/gtalk/client/caps': \
['talk.google.com.png', 'GTalk'],
'talk.google.com': ['talk.google.com.png', 'GTalk'],
'http://talkgadget.google.com/client/caps': ['google.png', 'GTalk'],
'http://talk.google.com/xmpp/bot/caps': ['google.png', 'GTalk'],
'http://aspro.users.ru/historian-bot/': ['bot.png', 'Historian-bot'],
'http://www.apple.com/ichat/caps': ['ichat.png', 'IChat'],
'http://instantbird.com/': ['instantbird.png', 'Instantbird'],
'http://j-tmb.ru/caps': ['bot.png', 'J-tmb'],
'http://jabbroid.akuz.de': ['android.png', 'Jabbroid'],
'http://jabbroid.akuz.de/caps': ['android.png', 'Jabbroid'],
'http://dev.jabbim.cz/jabbim/caps': ['jabbim.png', 'Jabbim'],
'http://jabbrik.ru/caps': ['bot.png', 'Jabbrik'],
'http://jabrvista.net.ru': ['bot.png', 'Jabvista'],
'http://jajc.jrudevels.org/caps': ['jajc.png', 'JAJC'],
'http://qabber.ru/jame-bot': ['bot.png', 'Jame-bot'],
'https://www.jappix.com/': ['jappix.png', 'Jappix'],
'http://japyt.googlecode.com': ['japyt.png', 'Japyt'],
'http://jasmineicq.ru/caps': ['jasmine.png', 'Jasmine'],
'http://jimm.net.ru/caps': ['jimm-aspro.png', 'Jimm'],
'http://jitsi.org' :['jitsi.png', 'Jitsi'],
'http://jtalk.ustyugov.net/caps': ['jtalk.png', 'Jtalk'],
'http://pjc.googlecode.com/caps': ['jubo.png', 'Jubo'],
'http://juick.com/caps': ['juick.png', 'Juick'],
'http://kopete.kde.org/jabber/caps': ['kopete.png', 'Kopete'],
'http://bluendo.com/protocol/caps': ['lampiro.png', 'Lampiro'],
'libpurple': ['libpurple.png', 'Libpurple'],
'http://lytgeygen.ru/caps': ['bot.png', 'Lytgeygen'],
'http://agent.mail.ru/caps': ['mailruagent.png', 'Mailruagent'],
'http://agent.mail.ru/': ['mailruagent.png', 'Mailruagent'],
'http://tomclaw.com/mandarin_im/caps': ['mandarin.png', 'Mandarin'],
'http://mcabber.lilotux.net/caps': ['mcabber.png', 'MCabber'],
'http://mcabber.com/caps': ['mcabber.png', 'MCabber'],
'http://mchat.mgslab.com/': ['mchat.png', 'Mchat'],
'https://www.meebo.com/': ['meebo.png', 'Meebo'],
'http://megafonvolga.ru/': ['megafon.png', 'Megafon'],
'http://miranda-im.org/caps': ['miranda.png', 'Miranda'],
'http://miranda-ng.org/caps' :['miranda_ng.png', 'Miranda NG'],
'http://moxl.movim.eu/': ['movim.png', 'Movim'],
'nimbuzz:caps': ['nimbuzz.png', 'Nimbuzz'],
'http://nimbuzz.com/caps': ['nimbuzz.png', 'Nimbuzz'],
'http://home.gna.org/': ['omnipresence.png', 'Omnipresence'],
'http://oneteam.im/caps': ['oneteamiphone.png', 'OneTeam'],
'http://www.process-one.net/en/solutions/oneteam_iphone/': \
['oneteamiphone.png', 'OneTeam-iphone'],
'rss@isida-bot.com': ['osiris.png', 'Osiris'],
'http://chat.ovi.com/caps': ['ovi-chat.png', 'Ovi-chat'],
'http://opensource.palm.com/packages.html': ['palm.png', 'Palm'],
'http://palringo.com/caps': ['palringo.png', 'Palringo'],
'http://pandion.im/': ['pandion.png', 'Pandion'],
'http://pidgin.im/': ['pidgin.png', 'Pidgin'],
'http://pidgin.im/caps': ['pidgin.png', 'Pidgin'],
'http://pigeon.vpro.ru/caps': ['pigeon.png', 'Pigeon'],
'Pix-Art Messenger': ['pixart.png', 'Pix-Art Messenger'],
'http://jabber.pix-art.de': ['pixart.png', 'Pix-Art Messenger'],
'httр://sleekxmpp.com/ver/1.1.11': ['poezio.png', 'Poezio'],
'https://poez.io': ['poezio.png', 'Poezio'],
'http://www.profanity.im': ['profanity.png', 'Profanity'],
'http://psi-im.org/caps': ['psi.png', 'Psi'],
'http://psi-plus.com': ['psiplus.png', 'Psi+'],
'http://psi-dev.googlecode.com/caps': ['psiplus.png', 'Psi+'],
'psto@psto.net': ['psto.png', 'Psto'],
'http://pyaim': ['pyaim-t.png', 'PyAIM-t'],
'http://pyicq': ['pyicq-t.png', 'PyICQ-t'],
'http://spectrum.im/transport': ['pyicq-t.png', 'PyICQ-t'],
'http://qq-im.com/caps': ['qq.png', 'QQ'],
'http://qq.com/caps': ['qq.png', 'QQ'],
'http://2010.qip.ru/caps': ['qip.png', 'Qip'],
'http://qip.ru/caps': ['qip.png', 'Qip'],
'http://qip.ru/caps?QIP': ['qip.png', 'Qip'],
'http://pda.qip.ru/caps': ['qippda.png', 'Qip-PDA'],
'http://qutim.org': ['qutim.png', 'QutIM'],
'http://qutim.org/': ['qutim.png', 'QutIM'],
'http://apps.radio-t.com/caps': ['radio-t.png', 'Radio-t'],
'Siemens': ['siejc.png', 'Siemens'], # Siemens Native Jabber Client
'http://sim-im.org/caps': ['sim.png', 'Sim'],
'http://www.lonelycatgames.com/slick/caps': ['slick.png', 'Slick'],
'http://slixmpp.com/ver/1.2.4': ['bot.png', 'Slixmpp'],
'http://slixmpp.com/ver/1.3.0': ['bot.png', 'Slixmpp'],
'http://snapi-bot.googlecode.com/caps': ['bot.png', 'Snapi-bot'],
'http://www.igniterealtime.org/project/spark/caps': ['spark.png', 'Spark'],
'http://spectrum.im/': ['spectrum.png', 'Spectrum'],
'http://storm-bot.googlecode.com/svn/trunk': ['bot.png', 'Storm-bot'],
'http://swift.im': ['swift.png', 'Swift'],
'http://jabber-net.ru/caps/talisman-bot': ['bot.png', 'Talisman-bot'],
'http://jabber-net.ru/talisman-bot/caps': ['bot.png', 'Talisman-bot'],
'http://www.google.com/xmpp/client/caps': ['talkonaut.png', 'Talkonaut'],
'telepathy.': ['telepathy.freedesktop.org.png', 'Telepathy'],
'http://telepathy.freedesktop.org/caps': \
['telepathy.freedesktop.org.png', 'Telepathy'],
'http://tigase.org/messenger': ['tigase.png', 'Tigase'],
'http://tkabber.jabber.ru/': ['tkabber.png', 'Tkabber'],
'http://trillian.im/caps': ['trillian.png', 'Trillian'],
'http://vacuum-im.googlecode.com': ['vacuum.png', 'Vacuum'],
'http://code.google.com/p/vacuum-im/': ['vacuum.png', 'Vacuum'],
'vk.com': ['vkontakte.png', 'Vkontakte'],
'http://pyvk-t.googlecode.com/caps': ['vkontakte.png', 'Vkontakte'],
'http://pyvk': ['vkontakte.png', 'Vkontakte'],
'http://witcher-team.ucoz.ru/': ['bot.png', 'Witcher'],
'http://online.yandex.ru/caps': ['yaonline.png', 'Yaonline'],
'http://www.igniterealtime.org/projects/smack/': ['xabber.png', 'Xabber'],
'https://www.xabber.com/': ['xabber.png', 'Xabber'],
'http://www.xfire.com/': ['xfire.png', 'Xfire'],
'http://www.xfire.com/caps': ['xfire.png', 'Xfire'],
'https://www.yaxim.org/': ['yaxim.png', 'Yaxim'],
'http://xu-6.jabbrik.ru/caps': ['bot.png', 'XU-6'],
}
LIBPURPLE_CLIENTS = {
'adium': 'http://www.adium.im/',
'eqo': 'http://eqo.com/',
'finch': 'http://pidgin.im/',
'instantbird': 'http://instantbird.com/',
'meebo': 'https://www.meebo.com/',
'palm': 'http://opensource.palm.com/packages.html',
'pidgin': 'http://pidgin.im/',
'spectrum': 'http://spectrum.im/',
'telepathy-haze': 'http://pidgin.im/'
}
\ No newline at end of file
from collections import UserDict
from collections import namedtuple
from gajim.plugins.plugins_i18n import _
ClientData = namedtuple('ClientData', ['default', 'variations'])
ClientData.__new__.__defaults__ = (None,)
def get_variations(client_name):
# get_variations('Conversation Legacy 1.2.3')
#
# Returns List:
# [Conversation Legacy 1.2.3,
# Conversation Legacy
# Conversation]
if client_name is None:
return []
alts = client_name.split()
alts = [" ".join(alts[:(i + 1)]) for i in range(len(alts))]
alts.reverse()
return alts
class ClientsDict(UserDict):
def get_client_data(self, name, node):
client_data = self.get(node)
if client_data is None:
return _('Unknown'), 'xmpp-client-unknown'
if client_data.variations is None:
client_name, icon_name = client_data.default
return client_name, 'xmpp-client-%s' % icon_name
variations = get_variations(name)
for var in variations:
try:
return var, 'xmpp-client-%s' % client_data.variations[var]
except KeyError:
pass
client_name, icon_name = client_data.default
return client_name, 'xmpp-client-%s' % icon_name
# ClientData(
# default=(Shown name, icon name)
# variations={Shown name, icon name}
# )
CLIENTS = ClientsDict({
'http://gajim.org': ClientData(('Gajim', 'gajim')),
'http://conversations.im': ClientData(
default=('Conversations', 'conversations'),
variations={'Conversations Legacy': 'conversations-legacy'}
),
'http://pidgin.im/': ClientData(('Pidgin', 'pidgin')),
'https://poez.io': ClientData(('Poezio', 'poezio')),
'https://yaxim.org/': ClientData(('yaxim', 'yaxim')),
'https://yaxim.org/bruno/': ClientData(('Bruno', 'bruno')),
'http://jabber.pix-art.de': ClientData(('Pix-Art Messenger', 'pixart')),
'http://mcabber.com/caps': ClientData(('MCabber', 'mcabber')),
'http://psi-plus.com': ClientData(('Psi+', 'psiplus')),
'https://dino.im': ClientData(('Dino', 'dino')),
'http://slixmpp.com/ver/1.2.4': ClientData(('Bot', 'bot')),
'http://slixmpp.com/ver/1.3.0': ClientData(('Bot', 'bot')),
'https://www.xabber.com/': ClientData(('Xabber', 'xabber')),
'http://www.profanity.im': ClientData(('Profanity', 'profanity')),
'http://swift.im': ClientData(('Swift', 'swift')),
'https://salut-a-toi.org': ClientData(('Salut à Toi', 'sat')),
'https://conversejs.org': ClientData(('Converse', 'conversejs')),
'http://bitlbee.org/xmpp/caps': ClientData(('BitlBee', 'bitlbee')),
'http://tkabber.jabber.ru/': ClientData(('Tkabber', 'tkabber')),
'http://miranda-ng.org/caps': ClientData(('Miranda NG', 'miranda_ng')),
'http://www.adium.im/': ClientData(('Adium', 'adium')),
'http://www.adiumx.com/caps': ClientData(('Adium', 'adium')),
'http://www.adiumx.com': ClientData(('Adium', 'adium')),
'http://aqq.eu/': ClientData(('Aqq', 'aqq')),
'http://www.asterisk.org/xmpp/client/caps': ClientData(('Asterisk', 'asterisk')),
'http://ayttm.souceforge.net/caps': ClientData(('Ayttm', 'ayttm')),
'http://www.barobin.com/caps': ClientData(('Bayanicq', 'bayanicq')),
'http://simpleapps.ru/caps#blacksmith': ClientData(('Blacksmith', 'bot')),
'http://blacksmith-2.googlecode.com/svn/': ClientData(('Blacksmith-2', 'bot')),
'http://coccinella.sourceforge.net/protocol/caps': ClientData(('Coccinella', 'coccinella')),
'http://digsby.com/caps': ClientData(('Digsby', 'digsby')),
'http://emacs-jabber.sourceforge.net': ClientData(('Emacs Jabber Client', 'emacs')),
'http://emess.eqx.su/caps': ClientData(('Emess', 'emess')),
'http://live.gnome.org/empathy/caps': ClientData(('Empathy', 'telepathy.freedesktop.org')),
'http://eqo.com/': ClientData(('Eqo', 'libpurple')),
'http://exodus.jabberstudio.org/caps': ClientData(('Exodus', 'exodus')),
'http://fatal-bot.spb.ru/caps': ClientData(('Fatal-bot', 'bot')),
'http://svn.posix.ru/fatal-bot/trunk': ClientData(('Fatal-bot', 'bot')),
'http://isida.googlecode.com': ClientData(('Isida', 'isida-bot')),
'http://isida-bot.com': ClientData(('Isida', 'isida-bot')),
'http://jabga.ru': ClientData(('Fin jabber', 'fin')),
'http://chat.freize.org/caps': ClientData(('Freize', 'freize')),
'http://gabber.sourceforge.net': ClientData(('Gabber', 'gabber')),
'http://glu.net/': ClientData(('Glu', 'glu')),
'http://mail.google.com/xmpp/client/caps': ClientData(('GMail', 'google.com')),
'http://www.android.com/gtalk/client/caps': ClientData(('GTalk', 'talk.google.com')),
'talk.google.com': ClientData(('GTalk', 'talk.google.com')),
'http://talkgadget.google.com/client/caps': ClientData(('GTalk', 'google')),
'http://talk.google.com/xmpp/bot/caps': ClientData(('GTalk', 'google')),
'http://aspro.users.ru/historian-bot/': ClientData(('Historian-bot', 'bot')),
'http://www.apple.com/ichat/caps': ClientData(('IChat', 'ichat')),
'http://instantbird.com/': ClientData(('Instantbird', 'instantbird')),
'http://j-tmb.ru/caps': ClientData(('J-tmb', 'bot')),
'http://jabbroid.akuz.de': ClientData(('Jabbroid', 'android')),
'http://jabbroid.akuz.de/caps': ClientData(('Jabbroid', 'android')),
'http://dev.jabbim.cz/jabbim/caps': ClientData(('Jabbim', 'jabbim')),
'http://jabbrik.ru/caps': ClientData(('Jabbrik', 'bot')),
'http://jabrvista.net.ru': ClientData(('Jabvista', 'bot')),
'http://jajc.jrudevels.org/caps': ClientData(('JAJC', 'jajc')),
'http://qabber.ru/jame-bot': ClientData(('Jame-bot', 'bot')),
'https://www.jappix.com/': ClientData(('Jappix', 'jappix')),
'http://japyt.googlecode.com': ClientData(('Japyt', 'japyt')),
'http://jasmineicq.ru/caps': ClientData(('Jasmine', 'jasmine')),
'http://jimm.net.ru/caps': ClientData(('Jimm', 'jimm-aspro')),
'http://jitsi.org': ClientData(('Jitsi', 'jitsi')),
'http://jtalk.ustyugov.net/caps': ClientData(('Jtalk', 'jtalk')),
'http://pjc.googlecode.com/caps': ClientData(('Jubo', 'jubo')),
'http://juick.com/caps': ClientData(('Juick', 'juick')),
'http://kopete.kde.org/jabber/caps': ClientData(('Kopete', 'kopete')),
'http://bluendo.com/protocol/caps': ClientData(('Lampiro', 'lampiro')),
'http://lytgeygen.ru/caps': ClientData(('Lytgeygen', 'bot')),
'http://agent.mail.ru/caps': ClientData(('Mailruagent', 'mailruagent')),
'http://agent.mail.ru/': ClientData(('Mailruagent', 'mailruagent')),
'http://tomclaw.com/mandarin_im/caps': ClientData(('Mandarin', 'mandarin')),
'http://mchat.mgslab.com/': ClientData(('Mchat', 'mchat')),
'https://www.meebo.com/': ClientData(('Meebo', 'meebo')),
'http://megafonvolga.ru/': ClientData(('Megafon', 'megafon')),
'http://miranda-im.org/caps': ClientData(('Miranda', 'miranda')),
'http://moxl.movim.eu/': ClientData(('Movim', 'movim')),
'nimbuzz:caps': ClientData(('Nimbuzz', 'nimbuzz')),
'http://nimbuzz.com/caps': ClientData(('Nimbuzz', 'nimbuzz')),
'http://home.gna.org/': ClientData(('Omnipresence', 'omnipresence')),
'http://oneteam.im/caps': ClientData(('OneTeam', 'oneteamiphone')),
'http://www.process-one.net/en/solutions/oneteam_iphone/': ClientData(('OneTeam-IPhone', 'oneteamiphone')),
'rss@isida-bot.com': ClientData(('Osiris', 'osiris')),
'http://chat.ovi.com/caps': ClientData(('Ovi-chat', 'ovi-chat')),
'http://opensource.palm.com/packages.html': ClientData(('Palm', 'palm')),
'http://palringo.com/caps': ClientData(('Palringo', 'palringo')),
'http://pandion.im/': ClientData(('Pandion', 'pandion')),
'http://pigeon.vpro.ru/caps': ClientData(('Pigeon', 'pigeon')),
'psto@psto.net': ClientData(('Psto', 'psto')),
'http://qq-im.com/caps': ClientData(('QQ', 'qq')),
'http://qq.com/caps': ClientData(('QQ', 'qq')),
'http://2010.qip.ru/caps': ClientData(('Qip', 'qip')),
'http://qip.ru/caps': ClientData(('Qip', 'qip')),
'http://qip.ru/caps?QIP': ClientData(('Qip', 'qip')),
'http://pda.qip.ru/caps': ClientData(('Qip-PDA', 'qippda')),
'http://qutim.org': ClientData(('QutIM', 'qutim')),
'http://qutim.org/': ClientData(('QutIM', 'qutim')),
'http://apps.radio-t.com/caps': ClientData(('Radio-t', 'radio-t')),
'http://sim-im.org/caps': ClientData(('Sim', 'sim')),
'http://www.lonelycatgames.com/slick/caps': ClientData(('Slick', 'slick')),
'http://snapi-bot.googlecode.com/caps': ClientData(('Snapi-bot', 'bot')),
'http://www.igniterealtime.org/project/spark/caps': ClientData(('Spark', 'spark')),
'http://spectrum.im/': ClientData(('Spectrum', 'spectrum')),
'http://storm-bot.googlecode.com/svn/trunk': ClientData(('Storm-bot', 'bot')),
'http://jabber-net.ru/caps/talisman-bot': ClientData(('Talisman-bot', 'bot')),
'http://jabber-net.ru/talisman-bot/caps': ClientData(('Talisman-bot', 'bot')),
'http://www.google.com/xmpp/client/caps': ClientData(('Talkonaut', 'talkonaut')),
'http://telepathy.freedesktop.org/caps': ClientData(('SlicTelepathyk', 'telepathy.freedesktop.org')),
'http://tigase.org/messenger': ClientData(('Tigase', 'tigase')),
'http://trillian.im/caps': ClientData(('Trillian', 'trillian')),
'http://vacuum-im.googlecode.com': ClientData(('Vacuum', 'vacuum')),
'http://code.google.com/p/vacuum-im/': ClientData(('Vacuum', 'vacuum')),
'http://witcher-team.ucoz.ru/': ClientData(('Witcher', 'bot')),
'http://online.yandex.ru/caps': ClientData(('Yaonline', 'yaonline')),
'http://www.igniterealtime.org/projects/smack/': ClientData(('Xabber', 'xabber')),
'http://www.xfire.com/': ClientData(('Xfire', 'xfire')),
'http://www.xfire.com/caps': ClientData(('Xfire', 'xfire')),
'http://xu-6.jabbrik.ru/caps': ClientData(('XU-6', 'bot')),
})
def get_data(*args):
return CLIENTS.get_client_data(*args)
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment