From 5aeed6c7376d9ccf0d24c08cca113b49c72a040c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Sat, 14 Oct 2017 16:10:14 +0200 Subject: [PATCH] Remove AcronymExpanderPlugin Moved to the gajim-plugins repository --- plugins/acronyms_expander/__init__.py | 1 - plugins/acronyms_expander/acronyms | 69 ----------- .../acronyms_expander/acronyms_expander.py | 110 ------------------ plugins/acronyms_expander/manifest.ini | 9 -- 4 files changed, 189 deletions(-) delete mode 100644 plugins/acronyms_expander/__init__.py delete mode 100644 plugins/acronyms_expander/acronyms delete mode 100644 plugins/acronyms_expander/acronyms_expander.py delete mode 100644 plugins/acronyms_expander/manifest.ini diff --git a/plugins/acronyms_expander/__init__.py b/plugins/acronyms_expander/__init__.py deleted file mode 100644 index 6b85dc735..000000000 --- a/plugins/acronyms_expander/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .acronyms_expander import AcronymsExpanderPlugin diff --git a/plugins/acronyms_expander/acronyms b/plugins/acronyms_expander/acronyms deleted file mode 100644 index 7cbe8e545..000000000 --- a/plugins/acronyms_expander/acronyms +++ /dev/null @@ -1,69 +0,0 @@ -{"afaik": "as far as I know", -"afaict": "as far as I can tell", -"afk": "away from keyboard", -"atm": "at the moment", -"bbiab": "be back in a bit", -"bbiaf": "be back in a few (minutes)", -"bbl": "be back later", -"bbs": "be back soon", -"b/c": "because", -"bf": "boyfriend", -"bfo": "blinding flash of the obvious", -"brb": "be right back", -"bsod": "blue screen of death", -"btw": "by the way", -"ciao": "Italian for goodbye", -"ctrn": "can't talk right now", -"cul8r": "see you later", -"cya": "see ya", -"dhtb": "don't have the bandwidth", -"f2f": "face to face", -"fubar": "fucked up beyond all recognition", -"fwiw": "for what it's worth", -"fyi": "for your information", -"gmta": "great minds think alike", -"iam": "in a meeting", -"ianal": "I am not a lawyer", -"ihmb": "I hate my boss", -"iirc": "if I recall correctly", -"imho": "in my humble opinion", -"imo": "in my opinion", -"iow": "in other words", -"irl": "in real life", -"": "grin", -"*g*": "grin", -"gf": "girlfriend", -"gmta": "great minds think alike", -"g2g": "got to go", -"jid": "jabber identifier", -"j/k": "just kidding", -"ok": "okay", -"lol": "laugh out loud", -"l8r": "later", -"msg": "message", -"n/m": "never mind", -"n/p": "no problem", -"oAo": "over and out!", -"omg": "oh my god", -"oob": "out of band", -"otoh": "on the other hand", -"oww": "oops, wrong window!", -"otp": "on the phone", -"pita": "pain in the ass", -"pov": "point of view", -"pw": "password", -"rotfl": "rolling on the floor laughing", -"rsn": "real soon now", -"rtfm": "read the friendly manual", -"slap": "sounds like a plan", -"thx": "thanks", -"tia": "thanks in advance", -"tla": "three-letter arconym", -"ttfn": "ta ta for now", -"ttyl": "talk to you later", -"wb": "welcome back", -"wfm": "works for me", -"wtf": "what the fuck?!", -"wtg": "way to go!", -"xfer": "transfer", -"ymmv": "your mileage may vary",} diff --git a/plugins/acronyms_expander/acronyms_expander.py b/plugins/acronyms_expander/acronyms_expander.py deleted file mode 100644 index cbfd33413..000000000 --- a/plugins/acronyms_expander/acronyms_expander.py +++ /dev/null @@ -1,110 +0,0 @@ -# -*- coding: utf-8 -*- - -## This file is part of Gajim. -## -## Gajim is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published -## by the Free Software Foundation; version 3 only. -## -## Gajim is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Gajim. If not, see . -## - -''' -Acronyms expander plugin. - -:author: Mateusz Biliński -:since: 9th June 2008 -:copyright: Copyright (2008) Mateusz Biliński -:license: GPL -''' - -import sys -import os - -from gi.repository import Gtk -from gi.repository import GObject - -from gajim.plugins import GajimPlugin -from gajim.plugins.helpers import log, log_calls - -class AcronymsExpanderPlugin(GajimPlugin): - - @log_calls('AcronymsExpanderPlugin') - def init(self): - self.description = _('Replaces acronyms (or other strings) ' - 'with given expansions/substitutes.') - self.config_dialog = None - - self.gui_extension_points = { - 'chat_control_base': (self.connect_with_chat_control_base, - self.disconnect_from_chat_control_base) - } - - self.config_default_values = { - 'INVOKER': (' ', ''), - 'ACRONYMS': ({'/slap': '/me slaps', - 'PS-': 'plug-in system', - 'G-': 'Gajim', - 'GNT-': 'https://dev.gajim.org/gajim/gajim/issues', - 'GW-': 'https://dev.gajim.org/gajim/gajim/wikis/home', - }, - ''), - } - if 'ACRONYMS' not in self.config: - myAcronyms = self.get_own_acronyms_list() - self.config['ACRONYMS'].update(myAcronyms) - - @log_calls('AcronymsExpanderPlugin') - def get_own_acronyms_list(self): - data_file = self.local_file_path('acronyms') - if not os.path.isfile(data_file): - return {} - data = open(data_file, 'r') - acronyms = eval(data.read()) - data.close() - return acronyms - - @log_calls('AcronymsExpanderPlugin') - def textbuffer_live_acronym_expander(self, tb): - """ - @param tb gtk.TextBuffer - """ - #assert isinstance(tb,gtk.TextBuffer) - ACRONYMS = self.config['ACRONYMS'] - INVOKER = self.config['INVOKER'] - t = tb.get_text(tb.get_start_iter(), tb.get_end_iter(), True) - #log.debug('%s %d'%(t, len(t))) - if t and t[-1] == INVOKER: - #log.debug('changing msg text') - base, sep, head=t[:-1].rpartition(INVOKER) - log.debug('%s | %s | %s'%(base, sep, head)) - if head in ACRONYMS: - head = ACRONYMS[head] - #log.debug('head: %s'%(head)) - t = ''.join((base, sep, head, INVOKER)) - #log.debug("setting text: '%s'"%(t)) - GObject.idle_add(tb.set_text, t) - - @log_calls('AcronymsExpanderPlugin') - def connect_with_chat_control_base(self, chat_control): - d = {} - tv = chat_control.msg_textview - tb = tv.get_buffer() - h_id = tb.connect('changed', self.textbuffer_live_acronym_expander) - d['h_id'] = h_id - - chat_control.acronyms_expander_plugin_data = d - - return True - - @log_calls('AcronymsExpanderPlugin') - def disconnect_from_chat_control_base(self, chat_control): - d = chat_control.acronyms_expander_plugin_data - tv = chat_control.msg_textview - tv.get_buffer().disconnect(d['h_id']) diff --git a/plugins/acronyms_expander/manifest.ini b/plugins/acronyms_expander/manifest.ini deleted file mode 100644 index 0674c2f88..000000000 --- a/plugins/acronyms_expander/manifest.ini +++ /dev/null @@ -1,9 +0,0 @@ -[info] -name: Acronyms Expander -short_name: acronyms_expander -version: 0.1 -description: Replaces acronyms (or other strings) with given expansions/substitutes. -authors: Mateusz Biliński -homepage: http://blog.bilinski.it - -