Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xautogen.sh2
-rw-r--r--configure.ac5
-rwxr-xr-xmaint-helper.py40
-rw-r--r--po/de.po12
-rw-r--r--po/hi.po10
-rw-r--r--po/nl.po16
-rw-r--r--po/sugar-base.pot37
-rw-r--r--src/sugar/dispatch/__init__.py3
-rw-r--r--src/sugar/dispatch/dispatcher.py42
-rw-r--r--src/sugar/dispatch/saferef.py102
-rw-r--r--src/sugar/logger.py20
-rw-r--r--src/sugar/mime.py1
12 files changed, 145 insertions, 145 deletions
diff --git a/autogen.sh b/autogen.sh
index f25b0a3..3d12f8f 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -3,4 +3,4 @@ export ACLOCAL="aclocal -I m4"
intltoolize
autoreconf -i
-./configure --enable-maintainer-mode "$@"
+./configure "$@"
diff --git a/configure.ac b/configure.ac
index a950c85..dd69bf4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-AC_INIT([sugar-base],[0.90.1],[],[sugar-base])
+AC_INIT([sugar-base],[0.87.2],[],[sugar-base])
AC_PREREQ([2.59])
@@ -7,7 +7,6 @@ AC_CONFIG_SRCDIR([configure.ac])
AM_INIT_AUTOMAKE([1.9 foreign dist-bzip2 no-dist-gzip])
-AM_MAINTAINER_MODE
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
@@ -22,7 +21,7 @@ PKG_CHECK_MODULES(EXTENSION, pygobject-2.0)
# Setup GETTEXT
#
-ALL_LINGUAS="af am ar ay bg bi bn_IN bn ca cpp cs da de dz el en es fa_AF fa ff fil fr gu ha he hi ht hu id ig is it ja km ko kos mg mi mk ml mn mr ms mvo nb ne nl pa pap pis pl pseudo ps pt_BR pt qu ro ru rw sd si sk sl sq sv sw ta te th tpi tr tvl tzo ug ur vi wa yo zh_CN zh_TW"
+ALL_LINGUAS="af am ar ay bg bn bn_IN ca de dz el en es fa fa_AF ff fr gu ha hi ht ig is it ja km ko mk ml mn mr mvo nb ne nl pa pap pis pl ps pt pt_BR qu ro ru rw sd si sl te th tpi tr ur vi yo zh_CN zh_TW"
GETTEXT_PACKAGE=sugar-base
AC_PROG_INTLTOOL([0.33])
diff --git a/maint-helper.py b/maint-helper.py
index 8bd35ce..50f7d07 100755
--- a/maint-helper.py
+++ b/maint-helper.py
@@ -16,22 +16,21 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+# Latest source available at git://dev.laptop.org/sugar
+
import os
import sys
import re
import datetime
import subprocess
-source_exts = ['.py', '.c', '.h', '.cpp']
-COPYRIGHT = 'Copyright (C) '
-
+source_exts = [ '.py', '.c', '.h', '.cpp' ]
def is_source(path):
for ext in source_exts:
if path.endswith(ext):
return True
-
def get_name_and_version():
f = open('configure.ac', 'r')
config = f.read()
@@ -43,8 +42,7 @@ def get_name_and_version():
print 'Cannot find the package name and version.'
sys.exit(0)
- return [match.group(2), match.group(1)]
-
+ return [ match.group(2), match.group(1) ]
def cmd_help():
print 'Usage: \n\
@@ -52,9 +50,8 @@ maint-helper.py build-snapshot - build a source snapshot \n\
maint-helper.py fix-copyright [path] - fix the copyright year \n\
maint-helper.py check-licenses - check licenses in the source'
-
def cmd_build_snapshot():
- [name, version] = get_name_and_version()
+ [ name, version ] = get_name_and_version()
print 'Update git...'
@@ -79,7 +76,7 @@ def cmd_build_snapshot():
print 'Update NEWS.sugar...'
- if 'SUGAR_NEWS' in os.environ:
+ if os.environ.has_key('SUGAR_NEWS'):
sugar_news_path = os.environ['SUGAR_NEWS']
if os.path.isfile(sugar_news_path):
f = open(sugar_news_path, 'r')
@@ -88,7 +85,7 @@ def cmd_build_snapshot():
else:
sugar_news = ''
- name, version = get_name_and_version()
+ [ name, version ] = get_name_and_version()
sugar_news += '%s - %s - %s\n\n' % (name, version, alphatag)
f = open('NEWS', 'r')
@@ -128,22 +125,21 @@ def cmd_build_snapshot():
print 'Done.'
-
-def check_licenses(path, license_name, missing):
- matchers = {'LGPL': 'GNU Lesser General Public License',
- 'GPL': 'GNU General Public License'}
+def check_licenses(path, license, missing):
+ matchers = { 'LGPL' : 'GNU Lesser General Public',
+ 'GPL' : 'GNU General Public License' }
license_file = os.path.join(path, '.license')
if os.path.isfile(license_file):
f = open(license_file, 'r')
- license_name = f.readline().strip()
+ license = f.readline().strip()
f.close()
for item in os.listdir(path):
full_path = os.path.join(path, item)
if os.path.isdir(full_path):
- check_licenses(full_path, license_name, missing)
+ check_licenses(full_path, license, missing)
else:
check_source = is_source(item)
@@ -158,7 +154,7 @@ def check_licenses(path, license_name, missing):
f.close()
miss_license = True
- if source.find(matchers[license_name]) > 0:
+ if source.find(matchers[license]) > 0:
miss_license = False
# Special cases.
@@ -166,10 +162,9 @@ def check_licenses(path, license_name, missing):
miss_license = False
if miss_license:
- if license_name not in missing:
- missing[license_name] = []
- missing[license_name].append(full_path)
-
+ if not missing.has_key(license):
+ missing[license] = []
+ missing[license].append(full_path)
def cmd_check_licenses():
missing = {}
@@ -181,6 +176,7 @@ def cmd_check_licenses():
print path
print '\n'
+COPYRIGHT = 'Copyright (C) '
def fix_copyright(path):
for item in os.listdir(path):
@@ -218,11 +214,9 @@ def fix_copyright(path):
f.write(result)
f.close()
-
def cmd_fix_copyright(path):
fix_copyright(path)
-
if len(sys.argv) < 2:
cmd_help()
elif sys.argv[1] == 'build-snapshot':
diff --git a/po/de.po b/po/de.po
index c17b1d3..16dfd63 100644
--- a/po/de.po
+++ b/po/de.po
@@ -1,18 +1,6 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
# Markus Schlager <m.slg@gmx.de>, 2008.
msgid ""
msgstr ""
diff --git a/po/hi.po b/po/hi.po
index c0ded4b..c3145a6 100644
--- a/po/hi.po
+++ b/po/hi.po
@@ -18,20 +18,20 @@ msgstr ""
#: ../src/sugar/mime.py:29
msgid "Text"
-msgstr "पाठ"
+msgstr ""
#: ../src/sugar/mime.py:37
msgid "Image"
-msgstr "फ़ोटो"
+msgstr ""
#: ../src/sugar/mime.py:42
msgid "Audio"
-msgstr "ऑडियो"
+msgstr ""
#: ../src/sugar/mime.py:47
msgid "Video"
-msgstr "वीडियो"
+msgstr ""
#: ../src/sugar/mime.py:52
msgid "Link"
-msgstr "कड़ी"
+msgstr ""
diff --git a/po/nl.po b/po/nl.po
index a010866..961cf26 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -2,24 +2,18 @@
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-06-24 00:21+0530\n"
-"PO-Revision-Date: 2010-06-28 21:07+0200\n"
-"Last-Translator: whe <heppew@yahoo.com>\n"
+"PO-Revision-Date: 2008-06-25 02:13-0400\n"
+"Last-Translator: Myckel Habets <myckel@sdf.lonestar.org>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
-"Language: nl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Pootle 2.0.3\n"
+"X-Generator: Pootle 1.1.0rc2\n"
#: ../src/sugar/mime.py:29
msgid "Text"
@@ -31,11 +25,11 @@ msgstr "Afbeelding"
#: ../src/sugar/mime.py:42
msgid "Audio"
-msgstr "Geluid"
+msgstr "Audio"
#: ../src/sugar/mime.py:47
msgid "Video"
-msgstr "Film"
+msgstr "Video"
#: ../src/sugar/mime.py:52
msgid "Link"
diff --git a/po/sugar-base.pot b/po/sugar-base.pot
new file mode 100644
index 0000000..21c2ab1
--- /dev/null
+++ b/po/sugar-base.pot
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-24 00:21+0530\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../src/sugar/mime.py:29
+msgid "Text"
+msgstr ""
+
+#: ../src/sugar/mime.py:37
+msgid "Image"
+msgstr ""
+
+#: ../src/sugar/mime.py:42
+msgid "Audio"
+msgstr ""
+
+#: ../src/sugar/mime.py:47
+msgid "Video"
+msgstr ""
+
+#: ../src/sugar/mime.py:52
+msgid "Link"
+msgstr ""
diff --git a/src/sugar/dispatch/__init__.py b/src/sugar/dispatch/__init__.py
index eecf049..776b1bc 100644
--- a/src/sugar/dispatch/__init__.py
+++ b/src/sugar/dispatch/__init__.py
@@ -1,7 +1,6 @@
"""Multi-consumer multi-producer dispatching mechanism
-Originally based on pydispatch (BSD)
-http://pypi.python.org/pypi/PyDispatcher/2.0.1
+Originally based on pydispatch (BSD) http://pypi.python.org/pypi/PyDispatcher/2.0.1
See license.txt for original license.
Heavily modified for Django's purposes.
diff --git a/src/sugar/dispatch/dispatcher.py b/src/sugar/dispatch/dispatcher.py
index dd6230b..6855a5b 100644
--- a/src/sugar/dispatch/dispatcher.py
+++ b/src/sugar/dispatch/dispatcher.py
@@ -1,25 +1,28 @@
import weakref
+try:
+ set
+except NameError:
+ from sets import Set as set # Python 2.3 fallback
+
from sugar.dispatch import saferef
WEAKREF_TYPES = (weakref.ReferenceType, saferef.BoundMethodWeakref)
-
def _make_id(target):
if hasattr(target, 'im_func'):
return (id(target.im_self), id(target.im_func))
return id(target)
-
class Signal(object):
"""Base class for all signals
-
+
Internal attributes:
receivers -- { receriverkey (id) : weakref(receiver) }
"""
-
+
def __init__(self, providing_args=None):
- """providing_args -- A list of the arguments this signal can pass along
- in a send() call.
+ """providing_args -- A list of the arguments this signal can pass along in
+ a send() call.
"""
self.receivers = []
if providing_args is None:
@@ -28,7 +31,7 @@ class Signal(object):
def connect(self, receiver, sender=None, weak=True, dispatch_uid=None):
"""Connect receiver to sender for signal
-
+
receiver -- a function or an instance method which is to
receive signals. Receivers must be
hashable objects.
@@ -36,7 +39,7 @@ class Signal(object):
if weak is True, then receiver must be weak-referencable
(more precisely saferef.safeRef() must be able to create
a reference to the receiver).
-
+
Receivers must be able to accept keyword arguments.
If receivers have a dispatch_uid attribute, the receiver will
@@ -51,21 +54,20 @@ class Signal(object):
By default, the module will attempt to use weak
references to the receiver objects. If this parameter
is false, then strong references will be used.
-
+
dispatch_uid -- an identifier used to uniquely identify a particular
instance of a receiver. This will usually be a string, though it
may be anything hashable.
returns None
- """
+ """
if dispatch_uid:
lookup_key = (dispatch_uid, _make_id(sender))
else:
lookup_key = (_make_id(receiver), _make_id(sender))
if weak:
- receiver = saferef.safeRef(receiver,
- onDelete=self._remove_receiver)
+ receiver = saferef.safeRef(receiver, onDelete=self._remove_receiver)
for r_key, _ in self.receivers:
if r_key == lookup_key:
@@ -73,16 +75,15 @@ class Signal(object):
else:
self.receivers.append((lookup_key, receiver))
- def disconnect(self, receiver=None, sender=None, weak=True,
- dispatch_uid=None):
+ def disconnect(self, receiver=None, sender=None, weak=True, dispatch_uid=None):
"""Disconnect receiver from sender for signal
-
+
receiver -- the registered receiver to disconnect. May be none if
dispatch_uid is specified.
sender -- the registered sender to disconnect
weak -- the weakref state to disconnect
dispatch_uid -- the unique identifier of the receiver to disconnect
-
+
disconnect reverses the process of connect.
If weak references are used, disconnect need not be called.
@@ -105,7 +106,7 @@ class Signal(object):
sender -- the sender of the signal
Either a specific object or None.
-
+
named -- named arguments which will be passed to receivers.
Returns a list of tuple pairs [(receiver, response), ... ].
@@ -139,9 +140,8 @@ class Signal(object):
Return a list of tuple pairs [(receiver, response), ... ],
may raise DispatcherKeyError
- if any receiver raises an error (specifically any subclass of
- Exception), the error instance is returned as the result for that
- receiver.
+ if any receiver raises an error (specifically any subclass of Exception),
+ the error instance is returned as the result for that receiver.
"""
responses = []
@@ -168,7 +168,7 @@ class Signal(object):
"""
none_senderkey = _make_id(None)
- for (receiverkey_, r_senderkey), receiver in self.receivers:
+ for (receiverkey, r_senderkey), receiver in self.receivers:
if r_senderkey == none_senderkey or r_senderkey == senderkey:
if isinstance(receiver, WEAKREF_TYPES):
# Dereference the weak reference.
diff --git a/src/sugar/dispatch/saferef.py b/src/sugar/dispatch/saferef.py
index bb73b5d..8bcfd8a 100644
--- a/src/sugar/dispatch/saferef.py
+++ b/src/sugar/dispatch/saferef.py
@@ -5,11 +5,9 @@ Provides a way to safely weakref any function, including bound methods (which
aren't handled by the core weakref module).
"""
-import weakref
-import traceback
+import weakref, traceback
-
-def safeRef(target, onDelete=None):
+def safeRef(target, onDelete = None):
"""Return a *safe* weak reference to a callable target
target -- the object to be weakly referenced, if it's a
@@ -24,18 +22,16 @@ def safeRef(target, onDelete=None):
if target.im_self is not None:
# Turn a bound method into a BoundMethodWeakref instance.
# Keep track of these instances for lookup by disconnect().
- if not hasattr(target, 'im_func'):
- raise TypeError("safeRef target %r has im_self, but no"
- " im_func, don't know how to create reference" %
- (target, ))
- reference = get_bound_method_weakref(target=target,
- onDelete=onDelete)
+ assert hasattr(target, 'im_func'), """safeRef target %r has im_self, but no im_func, don't know how to create reference"""%( target,)
+ reference = get_bound_method_weakref(
+ target=target,
+ onDelete=onDelete
+ )
return reference
if callable(onDelete):
return weakref.ref(target, onDelete)
else:
- return weakref.ref(target)
-
+ return weakref.ref( target )
class BoundMethodWeakref(object):
"""'Safe' and reusable weak references to instance methods
@@ -70,10 +66,10 @@ class BoundMethodWeakref(object):
same BoundMethodWeakref instance.
"""
-
+
_allInstances = weakref.WeakValueDictionary()
-
- def __new__(cls, target, onDelete=None, *arguments, **named):
+
+ def __new__( cls, target, onDelete=None, *arguments,**named ):
"""Create new instance or return current instance
Basically this method of construction allows us to
@@ -86,16 +82,16 @@ class BoundMethodWeakref(object):
of already-referenced methods.
"""
key = cls.calculateKey(target)
- current = cls._allInstances.get(key)
+ current =cls._allInstances.get(key)
if current is not None:
- current.deletionMethods.append(onDelete)
+ current.deletionMethods.append( onDelete)
return current
else:
- base = super(BoundMethodWeakref, cls).__new__(cls)
+ base = super( BoundMethodWeakref, cls).__new__( cls )
cls._allInstances[key] = base
- base.__init__(target, onDelete, *arguments, **named)
+ base.__init__( target, onDelete, *arguments,**named)
return base
-
+
def __init__(self, target, onDelete=None):
"""Return a weak-reference-like instance for a bound method
@@ -115,53 +111,56 @@ class BoundMethodWeakref(object):
methods = self.deletionMethods[:]
del self.deletionMethods[:]
try:
- # pylint: disable=W0212
- del self.__class__._allInstances[self.key]
+ del self.__class__._allInstances[ self.key ]
except KeyError:
pass
for function in methods:
try:
- if callable(function):
- function(self)
+ if callable( function ):
+ function( self )
except Exception, e:
try:
traceback.print_exc()
- except AttributeError:
- print ('Exception during saferef %s cleanup function'
- ' %s: %s' % (self, function, e))
+ except AttributeError, err:
+ print '''Exception during saferef %s cleanup function %s: %s'''%(
+ self, function, e
+ )
self.deletionMethods = [onDelete]
- self.key = self.calculateKey(target)
+ self.key = self.calculateKey( target )
self.weakSelf = weakref.ref(target.im_self, remove)
self.weakFunc = weakref.ref(target.im_func, remove)
self.selfName = str(target.im_self)
self.funcName = str(target.im_func.__name__)
-
- def calculateKey(cls, target):
+
+ def calculateKey( cls, target ):
"""Calculate the reference key for this reference
Currently this is a two-tuple of the id()'s of the
target object and the target function respectively.
"""
- return (id(target.im_self), id(target.im_func))
- calculateKey = classmethod(calculateKey)
-
+ return (id(target.im_self),id(target.im_func))
+ calculateKey = classmethod( calculateKey )
+
def __str__(self):
"""Give a friendly representation of the object"""
- return '%s( %s.%s )' % (self.__class__.__name__, self.selfName,
- self.funcName)
-
+ return """%s( %s.%s )"""%(
+ self.__class__.__name__,
+ self.selfName,
+ self.funcName,
+ )
+
__repr__ = __str__
-
- def __nonzero__(self):
+
+ def __nonzero__( self ):
"""Whether we are still a valid reference"""
return self() is not None
-
- def __cmp__(self, other):
+
+ def __cmp__( self, other ):
"""Compare with another reference"""
- if not isinstance(other, self.__class__):
- return cmp(self.__class__, type(other))
- return cmp(self.key, other.key)
-
+ if not isinstance (other,self.__class__):
+ return cmp( self.__class__, type(other) )
+ return cmp( self.key, other.key)
+
def __call__(self):
"""Return a strong reference to the bound method
@@ -180,18 +179,17 @@ class BoundMethodWeakref(object):
return function.__get__(target)
return None
-
class BoundNonDescriptorMethodWeakref(BoundMethodWeakref):
"""A specialized BoundMethodWeakref, for platforms where instance methods
are not descriptors.
It assumes that the function name and the target attribute name are the
same, instead of assuming that the function is a descriptor. This approach
- is equally fast, but not 100% reliable because functions can be stored on
- an attribute named differenty than the function's name such as in:
+ is equally fast, but not 100% reliable because functions can be stored on an
+ attribute named differenty than the function's name such as in:
class A: pass
- def foo(self): return 'foo'
+ def foo(self): return "foo"
A.bar = foo
But this shouldn't be a common use case. So, on platforms where methods
@@ -241,14 +239,12 @@ class BoundNonDescriptorMethodWeakref(BoundMethodWeakref):
return getattr(target, function.__name__)
return None
-
def get_bound_method_weakref(target, onDelete):
- """Instantiates the appropiate BoundMethodWeakRef, depending on the details
- of the underlying class method implementation"""
+ """Instantiates the appropiate BoundMethodWeakRef, depending on the details of
+ the underlying class method implementation"""
if hasattr(target, '__get__'):
# target method is a descriptor, so the default implementation works:
return BoundMethodWeakref(target=target, onDelete=onDelete)
else:
# no luck, use the alternative implementation:
- return BoundNonDescriptorMethodWeakref(target=target,
- onDelete=onDelete)
+ return BoundNonDescriptorMethodWeakref(target=target, onDelete=onDelete)
diff --git a/src/sugar/logger.py b/src/sugar/logger.py
index c242194..275c57d 100644
--- a/src/sugar/logger.py
+++ b/src/sugar/logger.py
@@ -25,7 +25,6 @@ import collections
import errno
import logging
import sys
-import traceback
import os
import repr as repr_
import decorator
@@ -65,7 +64,7 @@ def set_level(level):
logging.warning('Invalid log level: %r', level)
-# pylint: disable=E1101,F0401,W0621
+# pylint: disable-msg=E1101,F0401
def _except_hook(exctype, value, traceback):
# Attempt to provide verbose IPython tracebacks.
# Importing IPython is slow, so we import it lazily.
@@ -108,14 +107,9 @@ def start(log_filename=None):
if e.errno != errno.ENOSPC:
raise e
- def handleError(record):
- traceback.print_exc()
- traceback.print_stack()
-
logging.basicConfig(level=logging.WARNING,
- format='%(created)f %(levelname)s %(name)s: %(message)s',
+ format="%(created)f %(levelname)s %(name)s: %(message)s",
stream=SafeLogWrapper(sys.stderr))
- root_logger.handlers[0].handleError = handleError
if 'SUGAR_LOGGER_LEVEL' in os.environ:
set_level(os.environ['SUGAR_LOGGER_LEVEL'])
@@ -148,7 +142,7 @@ class TraceRepr(repr_.Repr):
def repr1(self, x, level):
for t in self._TYPES:
if isinstance(x, t):
- return getattr(self, 'repr_' + t.__name__)(x, level)
+ return getattr(self, 'repr_'+t.__name__)(x, level)
return repr_.Repr.repr1(self, x, level)
@@ -182,22 +176,22 @@ def trace(logger=None, logger_name=None, skip_args=None, skip_kwargs=None,
if not enabled:
return f(*args, **kwargs)
- params_formatted = ', '.join(
+ params_formatted = ", ".join(
[trace_repr.repr(a)
for (idx, a) in enumerate(args) if idx not in skip_args] + \
['%s=%s' % (k, trace_repr.repr(v))
for (k, v) in kwargs.items() if k not in skip_kwargs])
- trace_logger.log(TRACE, '%s(%s) invoked', f.__name__,
+ trace_logger.log(TRACE, "%s(%s) invoked", f.__name__,
params_formatted)
try:
res = f(*args, **kwargs)
except:
- trace_logger.exception('Exception occured in %s', f.__name__)
+ trace_logger.exception("Exception occured in %s", f.__name__)
raise
- trace_logger.log(TRACE, '%s(%s) returned %s', f.__name__,
+ trace_logger.log(TRACE, "%s(%s) returned %s", f.__name__,
params_formatted, trace_repr.repr(res))
return res
diff --git a/src/sugar/mime.py b/src/sugar/mime.py
index c4b847b..7f3f5ff 100644
--- a/src/sugar/mime.py
+++ b/src/sugar/mime.py
@@ -134,7 +134,6 @@ def get_mime_description(mime_type):
return generic_type['name']
import gio
- # pylint: disable=E1101
return gio.content_type_get_description(mime_type)