changeset b5cca6321af8 in /home/hg/repos/gajim
branches: gtk3 details:http://hg.gajim.org/gajim?cmd=changeset;node=b5cca6321af8 description: [axcel] update AcronymsExpanderPlugin
diffstat:
plugins/acronyms_expander/acronyms | 69 ++++++++++++++++++++++++++ plugins/acronyms_expander/acronyms_expander.py | 16 ++++- 2 files changed, 82 insertions(+), 3 deletions(-)
diffs (106 lines):
diff -r 193e9b398e11 -r b5cca6321af8 plugins/acronyms_expander/acronyms --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/acronyms_expander/acronyms Tue Aug 20 14:08:54 2013 +0400 @@ -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", +"<g>": "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 -r 193e9b398e11 -r b5cca6321af8 plugins/acronyms_expander/acronyms_expander.py --- a/plugins/acronyms_expander/acronyms_expander.py Mon Aug 19 11:28:50 2013 +0400 +++ b/plugins/acronyms_expander/acronyms_expander.py Tue Aug 20 14:08:54 2013 +0400 @@ -47,16 +47,26 @@
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):