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):
changeset 0b8855fbefd1 in /home/hg/repos/gajim
branches: gtk3
details:http://hg.gajim.org/gajim?cmd=changeset;node=0b8855fbefd1
description: we release under GPL v3
diffstat:
src/common/jingle.py | 10 ++++++----
src/common/jingle_content.py | 10 ++++++----
src/common/jingle_ftstates.py | 10 ++++++----
src/common/jingle_rtp.py | 10 ++++++----
src/common/jingle_session.py | 10 ++++++----
src/common/jingle_transport.py | 10 ++++++----
src/common/multimedia_helpers.py | 10 ++++++----
7 files changed, 42 insertions(+), 28 deletions(-)
diffs (175 lines):
diff -r 7963223c0f2d -r 0b8855fbefd1 src/common/jingle.py
--- a/src/common/jingle.py Fri Aug 16 09:25:07 2013 +0200
+++ b/src/common/jingle.py Fri Aug 16 09:33:15 2013 +0200
@@ -1,15 +1,17 @@
##
## Copyright (C) 2006 Gajim Team
##
-## This program is free software; you can redistribute it and/or modify
+## 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 2 only.
+## by the Free Software Foundation; version 3 only.
##
-## This program is distributed in the hope that it will be useful,
+## 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
+## 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 <http://www.gnu.org/licenses/>.
"""
Handles the jingle signalling protocol
"""
diff -r 7963223c0f2d -r 0b8855fbefd1 src/common/jingle_content.py
--- a/src/common/jingle_content.py Fri Aug 16 09:25:07 2013 +0200
+++ b/src/common/jingle_content.py Fri Aug 16 09:33:15 2013 +0200
@@ -1,15 +1,17 @@
##
## Copyright (C) 2006 Gajim Team
##
-## This program is free software; you can redistribute it and/or modify
+## 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 2 only.
+## by the Free Software Foundation; version 3 only.
##
-## This program is distributed in the hope that it will be useful,
+## 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
+## 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 <http://www.gnu.org/licenses/>.
"""
Handles Jingle contents (XEP 0166)
diff -r 7963223c0f2d -r 0b8855fbefd1 src/common/jingle_ftstates.py
--- a/src/common/jingle_ftstates.py Fri Aug 16 09:25:07 2013 +0200
+++ b/src/common/jingle_ftstates.py Fri Aug 16 09:33:15 2013 +0200
@@ -1,15 +1,17 @@
##
## Copyright (C) 2006 Gajim Team
##
-## This program is free software; you can redistribute it and/or modify
+## 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 2 only.
+## by the Free Software Foundation; version 3 only.
##
-## This program is distributed in the hope that it will be useful,
+## 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
+## 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 <http://www.gnu.org/licenses/>.
from common import gajim
import nbxmpp
diff -r 7963223c0f2d -r 0b8855fbefd1 src/common/jingle_rtp.py
--- a/src/common/jingle_rtp.py Fri Aug 16 09:25:07 2013 +0200
+++ b/src/common/jingle_rtp.py Fri Aug 16 09:33:15 2013 +0200
@@ -1,15 +1,17 @@
##
## Copyright (C) 2006 Gajim Team
##
-## This program is free software; you can redistribute it and/or modify
+## 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 2 only.
+## by the Free Software Foundation; version 3 only.
##
-## This program is distributed in the hope that it will be useful,
+## 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
+## 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 <http://www.gnu.org/licenses/>.
"""
Handles Jingle RTP sessions (XEP 0167)
diff -r 7963223c0f2d -r 0b8855fbefd1 src/common/jingle_session.py
--- a/src/common/jingle_session.py Fri Aug 16 09:25:07 2013 +0200
+++ b/src/common/jingle_session.py Fri Aug 16 09:33:15 2013 +0200
@@ -1,15 +1,17 @@
##
## Copyright (C) 2006 Gajim Team
##
-## This program is free software; you can redistribute it and/or modify
+## 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 2 only.
+## by the Free Software Foundation; version 3 only.
##
-## This program is distributed in the hope that it will be useful,
+## 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
+## 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 <http://www.gnu.org/licenses/>.
"""
Handles Jingle sessions (XEP 0166)
diff -r 7963223c0f2d -r 0b8855fbefd1 src/common/jingle_transport.py
--- a/src/common/jingle_transport.py Fri Aug 16 09:25:07 2013 +0200
+++ b/src/common/jingle_transport.py Fri Aug 16 09:33:15 2013 +0200
@@ -1,15 +1,17 @@
##
## Copyright (C) 2006 Gajim Team
##
-## This program is free software; you can redistribute it and/or modify
+## 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 2 only.
+## by the Free Software Foundation; version 3 only.
##
-## This program is distributed in the hope that it will be useful,
+## 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
+## 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 <http://www.gnu.org/licenses/>.
"""
Handles Jingle Transports (currently only ICE-UDP)
diff -r 7963223c0f2d -r 0b8855fbefd1 src/common/multimedia_helpers.py
--- a/src/common/multimedia_helpers.py Fri Aug 16 09:25:07 2013 +0200
+++ b/src/common/multimedia_helpers.py Fri Aug 16 09:33:15 2013 +0200
@@ -1,15 +1,17 @@
##
## Copyright (C) 2009 Thibaut GIRKA <thib AT sitedethib.com>
##
-## This program is free software; you can redistribute it and/or modify
+## 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 2 only.
+## by the Free Software Foundation; version 3 only.
##
-## This program is distributed in the hope that it will be useful,
+## 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
+## 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 <http://www.gnu.org/licenses/>.
import gst
changeset 4f55e5523c0c in /home/hg/repos/gajim
branches: gtk3
details:http://hg.gajim.org/gajim?cmd=changeset;node=4f55e5523c0c
description: remove external unused file
diffstat:
src/pycallgraph.py | 410 -----------------------------------------------------
1 files changed, 0 insertions(+), 410 deletions(-)
diffs (truncated from 414 to 300 lines):
diff -r 0b8855fbefd1 -r 4f55e5523c0c src/pycallgraph.py
--- a/src/pycallgraph.py Fri Aug 16 09:33:15 2013 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,410 +0,0 @@
-"""
-pycallgraph
-
-U{http://pycallgraph.slowchop.com/}
-
-Copyright Gerald Kaszuba 2007
-
-This program 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; either version 2 of the License, or
-(at your option) any later version.
-
-This program 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 this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-"""
-
-__version__ = '0.4.1'
-__author__ = 'Gerald Kaszuba'
-
-import inspect
-import sys
-import os
-import re
-import tempfile
-import time
-from distutils import sysconfig
-
-# Initialise module variables.
-# TODO Move these into settings
-trace_filter = None
-time_filter = None
-
-
-def colourize_node(calls, total_time):
- value = float(total_time * 2 + calls) / 3
- return '%f %f %f' % (value / 2 + .5, value, 0.9)
-
-
-def colourize_edge(calls, total_time):
- value = float(total_time * 2 + calls) / 3
- return '%f %f %f' % (value / 2 + .5, value, 0.7)
-
-
-def reset_settings():
- global settings
- global graph_attributes
- global __version__
-
- settings = {
- 'node_attributes': {
- 'label': r'%(func)s\ncalls: %(hits)i\ntotal time: %(total_time)f',
- 'color': '%(col)s',
- },
- 'node_colour': colourize_node,
- 'edge_colour': colourize_edge,
- 'dont_exclude_anything': False,
- 'include_stdlib': True,
- }
-
- # TODO: Move this into settings
- graph_attributes = {
- 'graph': {
- 'fontname': 'Verdana',
- 'fontsize': 7,
- 'fontcolor': '0 0 0.5',
- 'label': r'Generated by Python Call Graph v%s\n' \
- r'http://pycallgraph.slowchop.com' % __version__,
- },
- 'node': {
- 'fontname': 'Verdana',
- 'fontsize': 7,
- 'color': '.5 0 .9',
- 'style': 'filled',
- 'shape': 'rect',
- },
- }
-
-
-def reset_trace():
- """Resets all collected statistics. This is run automatically by
- start_trace(reset=True) and when the module is loaded.
- """
- global call_dict
- global call_stack
- global func_count
- global func_count_max
- global func_time
- global func_time_max
- global call_stack_timer
-
- call_dict = {}
-
- # current call stack
- call_stack = ['__main__']
-
- # counters for each function
- func_count = {}
- func_count_max = 0
-
- # accumative time per function
- func_time = {}
- func_time_max = 0
-
- # keeps track of the start time of each call on the stack
- call_stack_timer = []
-
-
-class PyCallGraphException(Exception):
- """Exception used for pycallgraph"""
- pass
-
-
-class GlobbingFilter(object):
- """Filter module names using a set of globs.
-
- Objects are matched against the exclude list first, then the include list.
- Anything that passes through without matching either, is excluded.
- """
-
- def __init__(self, include=None, exclude=None, max_depth=None,
- min_depth=None):
- if include is None and exclude is None:
- include = ['*']
- exclude = []
- elif include is None:
- include = ['*']
- elif exclude is None:
- exclude = []
- self.include = include
- self.exclude = exclude
- self.max_depth = max_depth or 9999
- self.min_depth = min_depth or 0
-
- def __call__(self, stack, module_name=None, class_name=None,
- func_name=None, full_name=None):
- from fnmatch import fnmatch
- if len(stack) > self.max_depth:
- return False
- if len(stack) < self.min_depth:
- return False
- for pattern in self.exclude:
- if fnmatch(full_name, pattern):
- return False
- for pattern in self.include:
- if fnmatch(full_name, pattern):
- return True
- return False
-
-
-def is_module_stdlib(file_name):
- """Returns True if the file_name is in the lib directory."""
- # TODO: Move these calls away from this function so it doesn't have to run
- # every time.
- lib_path = sysconfig.get_python_lib()
- path = os.path.split(lib_path)
- if path[1] == 'site-packages':
- lib_path = path[0]
- return file_name.lower().startswith(lib_path.lower())
-
-
-def start_trace(reset=True, filter_func=None, time_filter_func=None):
- """Begins a trace. Setting reset to True will reset all previously recorded
- trace data. filter_func needs to point to a callable function that accepts
- the parameters (call_stack, module_name, class_name, func_name, full_name).
- Every call will be passed into this function and it is up to the function
- to decide if it should be included or not. Returning False means the call
- will be filtered out and not included in the call graph.
- """
- global trace_filter
- global time_filter
- if reset:
- reset_trace()
-
- if filter_func:
- trace_filter = filter_func
- else:
- trace_filter = GlobbingFilter(exclude=['pycallgraph.*'])
-
- if time_filter_func:
- time_filter = time_filter_func
- else:
- time_filter = GlobbingFilter()
-
- sys.settrace(tracer)
-
-
-def stop_trace():
- """Stops the currently running trace, if any."""
- sys.settrace(None)
-
-
-def tracer(frame, event, arg):
- """This is an internal function that is called every time a call is made
- during a trace. It keeps track of relationships between calls.
- """
- global func_count_max
- global func_count
- global trace_filter
- global time_filter
- global call_stack
- global func_time
- global func_time_max
-
- if event == 'call':
- keep = True
- code = frame.f_code
-
- # Stores all the parts of a human readable name of the current call.
- full_name_list = []
-
- # Work out the module name
- module = inspect.getmodule(code)
- if module:
- module_name = module.__name__
- module_path = module.__file__
- if not settings['include_stdlib'] \
- and is_module_stdlib(module_path):
- keep = False
- if module_name == '__main__':
- module_name = ''
- else:
- module_name = ''
- if module_name:
- full_name_list.append(module_name)
-
- # Work out the class name.
- try:
- class_name = frame.f_locals['self'].__class__.__name__
- full_name_list.append(class_name)
- except (KeyError, AttributeError):
- class_name = ''
-
- # Work out the current function or method
- func_name = code.co_name
- if func_name == '?':
- func_name = '__main__'
- full_name_list.append(func_name)
-
- # Create a readable representation of the current call
- full_name = '.'.join(full_name_list)
-
- # Load the trace filter, if any. 'keep' determines if we should ignore
- # this call
- if keep and trace_filter:
- keep = trace_filter(call_stack, module_name, class_name,
- func_name, full_name)
-
- # Store the call information
- if keep:
-
- fr = call_stack[-1]
- if fr not in call_dict:
- call_dict[fr] = {}
- if full_name not in call_dict[fr]:
- call_dict[fr][full_name] = 0
- call_dict[fr][full_name] += 1
-
- if full_name not in func_count:
- func_count[full_name] = 0
- func_count[full_name] += 1
- if func_count[full_name] > func_count_max:
- func_count_max = func_count[full_name]
-
- call_stack.append(full_name)
- call_stack_timer.append(time.time())
-
- else:
- call_stack.append('')
- call_stack_timer.append(None)
-
- if event == 'return':
- if call_stack:
- full_name = call_stack.pop(-1)
- t = call_stack_timer.pop(-1)
- if t and time_filter(stack=call_stack, full_name=full_name):
- if full_name not in func_time:
- func_time[full_name] = 0
- call_time = (time.time() - t)
- func_time[full_name] += call_time
- if func_time[full_name] > func_time_max:
- func_time_max = func_time[full_name]
-
- return tracer
-
-
-def get_dot(stop=True):
- """Returns a string containing a DOT file. Setting stop to True will cause
- the trace to stop.
- """
- global func_time_max