Fix pep8 errors

pep8 1.6.4 detects more issues
This commit is contained in:
Daniel Narvaez 2013-07-04 18:48:33 +02:00
parent b65be8d44b
commit 6d2b97daec
4 changed files with 196 additions and 205 deletions

View File

@ -93,8 +93,8 @@ class NormalizedVersion(object):
""" """
if len(version_string) > 1 and version_string[0] == '0': if len(version_string) > 1 and version_string[0] == '0':
raise InvalidVersionError("Can not have leading zero in segment" raise InvalidVersionError("Can not have leading zero in segment"
" %s in %r" % (version_string, " %s in %r" %
self._activity_version)) (version_string, self._activity_version))
return int(version_string) return int(version_string)
@ -112,8 +112,8 @@ class NormalizedVersion(object):
for n in extraversion_string.split("."): for n in extraversion_string.split("."):
if len(n) > 1 and n[0] == '0': if len(n) > 1 and n[0] == '0':
raise InvalidVersionError("Can not have leading zero in " raise InvalidVersionError("Can not have leading zero in "
"segment %s in %r" % (n, "segment %s in %r"
self._activity_version)) % (n, self._activity_version))
nums.append(int(n)) nums.append(int(n))
while nums and nums[-1] == 0: while nums and nums[-1] == 0:

View File

@ -24,8 +24,7 @@ import logging
from gi.repository import GConf from gi.repository import GConf
colors = [ colors = [['#B20008', '#FF2B34'],
['#B20008', '#FF2B34'],
['#FF2B34', '#B20008'], ['#FF2B34', '#B20008'],
['#E6000A', '#FF2B34'], ['#E6000A', '#FF2B34'],
['#FF2B34', '#E6000A'], ['#FF2B34', '#E6000A'],
@ -204,8 +203,7 @@ colors = [
['#AC32FF', '#00588C'], ['#AC32FF', '#00588C'],
['#005FE4', '#AC32FF'], ['#005FE4', '#AC32FF'],
['#AC32FF', '#005FE4'], ['#AC32FF', '#005FE4'],
['#BCCDFF', '#AC32FF'], ['#BCCDFF', '#AC32FF']]
]
def _parse_string(color_string): def _parse_string(color_string):

View File

@ -49,31 +49,26 @@ def _get_supported_image_mime_types():
_extensions = {} _extensions = {}
_globs_timestamps = [] _globs_timestamps = []
_generic_types = [ _generic_types = [{
{
'id': GENERIC_TYPE_TEXT, 'id': GENERIC_TYPE_TEXT,
'name': _('Text'), 'name': _('Text'),
'icon': 'text-x-generic', 'icon': 'text-x-generic',
'types': [ 'types': ['text/plain', 'text/rtf', 'application/pdf', 'application/x-pdf',
'text/plain', 'text/rtf', 'application/pdf', 'application/x-pdf',
'text/html', 'application/vnd.oasis.opendocument.text', 'text/html', 'application/vnd.oasis.opendocument.text',
'application/rtf', 'text/rtf', 'application/epub+zip'], 'application/rtf', 'text/rtf', 'application/epub+zip'],
}, }, {
{
'id': GENERIC_TYPE_IMAGE, 'id': GENERIC_TYPE_IMAGE,
'name': _('Image'), 'name': _('Image'),
'icon': 'image-x-generic', 'icon': 'image-x-generic',
'types': _get_supported_image_mime_types(), 'types': _get_supported_image_mime_types(),
}, }, {
{
'id': GENERIC_TYPE_AUDIO, 'id': GENERIC_TYPE_AUDIO,
'name': _('Audio'), 'name': _('Audio'),
'icon': 'audio-x-generic', 'icon': 'audio-x-generic',
'types': [ 'types': [
'audio/ogg', 'audio/x-wav', 'audio/wav', 'audio/x-vorbis+ogg', 'audio/ogg', 'audio/x-wav', 'audio/wav', 'audio/x-vorbis+ogg',
'audio/x-mpegurl', 'audio/mpegurl', 'audio/mpeg', 'audio/x-scpls'], 'audio/x-mpegurl', 'audio/mpegurl', 'audio/mpeg', 'audio/x-scpls'],
}, }, {
{
'id': GENERIC_TYPE_VIDEO, 'id': GENERIC_TYPE_VIDEO,
'name': _('Video'), 'name': _('Video'),
'icon': 'video-x-generic', 'icon': 'video-x-generic',
@ -84,8 +79,7 @@ _generic_types = [
'video/mp4', 'video/x-matroska', 'video/x-msvideo', 'video/mp4', 'video/x-matroska', 'video/x-msvideo',
'application/x-ogm-video', 'video/quicktime', 'video/x-quicktime' 'application/x-ogm-video', 'video/quicktime', 'video/x-quicktime'
'video/avi'], 'video/avi'],
}, }, {
{
'id': GENERIC_TYPE_LINK, 'id': GENERIC_TYPE_LINK,
'name': _('Link'), 'name': _('Link'),
'icon': 'text-uri-list', 'icon': 'text-uri-list',

View File

@ -643,8 +643,7 @@ class _JoinCommand(_BaseCommand):
group.AddMembers([self_handle], '', group.AddMembers([self_handle], '',
reply_handler=lambda: None, reply_handler=lambda: None,
error_handler=lambda e: self._join_failed_cb( error_handler=lambda e: self._join_failed_cb(
e, e, 'got_all_members AddMembers'))
'got_all_members AddMembers'))
if members: if members:
self.__text_channel_members_changed_cb('', members, (), self.__text_channel_members_changed_cb('', members, (),