From 9a78999565b4ff3d871b27a9e13acb82d941f487 Mon Sep 17 00:00:00 2001 From: Denis Fomin Date: Tue, 20 Aug 2013 14:08:54 +0400 Subject: [PATCH] [axcel] update AcronymsExpanderPlugin --- plugins/acronyms_expander/acronyms | 69 +++++++++++++++++++ .../acronyms_expander/acronyms_expander.py | 16 ++++- 2 files changed, 82 insertions(+), 3 deletions(-) create mode 100644 plugins/acronyms_expander/acronyms diff --git a/plugins/acronyms_expander/acronyms b/plugins/acronyms_expander/acronyms new file mode 100644 index 000000000..7cbe8e545 --- /dev/null +++ b/plugins/acronyms_expander/acronyms @@ -0,0 +1,69 @@ +{"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 index e6b997925..834cc4f9a 100644 --- a/plugins/acronyms_expander/acronyms_expander.py +++ b/plugins/acronyms_expander/acronyms_expander.py @@ -47,16 +47,26 @@ class AcronymsExpanderPlugin(GajimPlugin): self.config_default_values = { 'INVOKER': (' ', ''), - 'ACRONYMS': ({'RTFM': 'Read The Friendly Manual', - '/slap': '/me slaps', + 'ACRONYMS': ({'/slap': '/me slaps', 'PS-': 'plug-in system', 'G-': 'Gajim', 'GNT-': 'http://trac.gajim.org/newticket', 'GW-': 'http://trac.gajim.org/', 'GTS-': 'http://trac.gajim.org/report', }, - ''), + ''), } + 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') + data = open(data_file, 'r') + acronyms = eval(data.read()) + data.close() + return acronyms @log_calls('AcronymsExpanderPlugin') def textbuffer_live_acronym_expander(self, tb):