pylint fixes

This commit is contained in:
Chris Jones 2009-10-09 00:30:03 +01:00
parent 7605957efa
commit c1c81d3a91
2 changed files with 89 additions and 88 deletions

View File

@ -26,92 +26,93 @@ This list is taken from gnome-terminal's src/terminal-encoding.c
from translation import _ from translation import _
class TerminatorEncoding: class TerminatorEncoding:
"""Class to store encoding details""" """Class to store encoding details"""
# The commented out entries below are so marked because gnome-terminal has done # The commented out entries below are so marked because gnome-terminal has done
# the same. # the same.
encodings = [ encodings = [
[True, None, _("Current Locale")], [True, None, _("Current Locale")],
[False, "ISO-8859-1", _("Western")], [False, "ISO-8859-1", _("Western")],
[False, "ISO-8859-2", _("Central European")], [False, "ISO-8859-2", _("Central European")],
[False, "ISO-8859-3", _("South European") ], [False, "ISO-8859-3", _("South European") ],
[False, "ISO-8859-4", _("Baltic") ], [False, "ISO-8859-4", _("Baltic") ],
[False, "ISO-8859-5", _("Cyrillic") ], [False, "ISO-8859-5", _("Cyrillic") ],
[False, "ISO-8859-6", _("Arabic") ], [False, "ISO-8859-6", _("Arabic") ],
[False, "ISO-8859-7", _("Greek") ], [False, "ISO-8859-7", _("Greek") ],
[False, "ISO-8859-8", _("Hebrew Visual") ], [False, "ISO-8859-8", _("Hebrew Visual") ],
[False, "ISO-8859-8-I", _("Hebrew") ], [False, "ISO-8859-8-I", _("Hebrew") ],
[False, "ISO-8859-9", _("Turkish") ], [False, "ISO-8859-9", _("Turkish") ],
[False, "ISO-8859-10", _("Nordic") ], [False, "ISO-8859-10", _("Nordic") ],
[False, "ISO-8859-13", _("Baltic") ], [False, "ISO-8859-13", _("Baltic") ],
[False, "ISO-8859-14", _("Celtic") ], [False, "ISO-8859-14", _("Celtic") ],
[False, "ISO-8859-15", _("Western") ], [False, "ISO-8859-15", _("Western") ],
[False, "ISO-8859-16", _("Romanian") ], [False, "ISO-8859-16", _("Romanian") ],
# [False, "UTF-7", _("Unicode") ], # [False, "UTF-7", _("Unicode") ],
[False, "UTF-8", _("Unicode") ], [False, "UTF-8", _("Unicode") ],
# [False, "UTF-16", _("Unicode") ], # [False, "UTF-16", _("Unicode") ],
# [False, "UCS-2", _("Unicode") ], # [False, "UCS-2", _("Unicode") ],
# [False, "UCS-4", _("Unicode") ], # [False, "UCS-4", _("Unicode") ],
[False, "ARMSCII-8", _("Armenian") ], [False, "ARMSCII-8", _("Armenian") ],
[False, "BIG5", _("Chinese Traditional") ], [False, "BIG5", _("Chinese Traditional") ],
[False, "BIG5-HKSCS", _("Chinese Traditional") ], [False, "BIG5-HKSCS", _("Chinese Traditional") ],
[False, "CP866", _("Cyrillic/Russian") ], [False, "CP866", _("Cyrillic/Russian") ],
[False, "EUC-JP", _("Japanese") ], [False, "EUC-JP", _("Japanese") ],
[False, "EUC-KR", _("Korean") ], [False, "EUC-KR", _("Korean") ],
[False, "EUC-TW", _("Chinese Traditional") ], [False, "EUC-TW", _("Chinese Traditional") ],
[False, "GB18030", _("Chinese Simplified") ], [False, "GB18030", _("Chinese Simplified") ],
[False, "GB2312", _("Chinese Simplified") ], [False, "GB2312", _("Chinese Simplified") ],
[False, "GBK", _("Chinese Simplified") ], [False, "GBK", _("Chinese Simplified") ],
[False, "GEORGIAN-PS", _("Georgian") ], [False, "GEORGIAN-PS", _("Georgian") ],
[False, "HZ", _("Chinese Simplified") ], [False, "HZ", _("Chinese Simplified") ],
[False, "IBM850", _("Western") ], [False, "IBM850", _("Western") ],
[False, "IBM852", _("Central European") ], [False, "IBM852", _("Central European") ],
[False, "IBM855", _("Cyrillic") ], [False, "IBM855", _("Cyrillic") ],
[False, "IBM857", _("Turkish") ], [False, "IBM857", _("Turkish") ],
[False, "IBM862", _("Hebrew") ], [False, "IBM862", _("Hebrew") ],
[False, "IBM864", _("Arabic") ], [False, "IBM864", _("Arabic") ],
[False, "ISO-2022-JP", _("Japanese") ], [False, "ISO-2022-JP", _("Japanese") ],
[False, "ISO-2022-KR", _("Korean") ], [False, "ISO-2022-KR", _("Korean") ],
[False, "ISO-IR-111", _("Cyrillic") ], [False, "ISO-IR-111", _("Cyrillic") ],
# [False, "JOHAB", _("Korean") ], # [False, "JOHAB", _("Korean") ],
[False, "KOI8-R", _("Cyrillic") ], [False, "KOI8-R", _("Cyrillic") ],
[False, "KOI8-U", _("Cyrillic/Ukrainian") ], [False, "KOI8-U", _("Cyrillic/Ukrainian") ],
[False, "MAC_ARABIC", _("Arabic") ], [False, "MAC_ARABIC", _("Arabic") ],
[False, "MAC_CE", _("Central European") ], [False, "MAC_CE", _("Central European") ],
[False, "MAC_CROATIAN", _("Croatian") ], [False, "MAC_CROATIAN", _("Croatian") ],
[False, "MAC-CYRILLIC", _("Cyrillic") ], [False, "MAC-CYRILLIC", _("Cyrillic") ],
[False, "MAC_DEVANAGARI", _("Hindi") ], [False, "MAC_DEVANAGARI", _("Hindi") ],
[False, "MAC_FARSI", _("Persian") ], [False, "MAC_FARSI", _("Persian") ],
[False, "MAC_GREEK", _("Greek") ], [False, "MAC_GREEK", _("Greek") ],
[False, "MAC_GUJARATI", _("Gujarati") ], [False, "MAC_GUJARATI", _("Gujarati") ],
[False, "MAC_GURMUKHI", _("Gurmukhi") ], [False, "MAC_GURMUKHI", _("Gurmukhi") ],
[False, "MAC_HEBREW", _("Hebrew") ], [False, "MAC_HEBREW", _("Hebrew") ],
[False, "MAC_ICELANDIC", _("Icelandic") ], [False, "MAC_ICELANDIC", _("Icelandic") ],
[False, "MAC_ROMAN", _("Western") ], [False, "MAC_ROMAN", _("Western") ],
[False, "MAC_ROMANIAN", _("Romanian") ], [False, "MAC_ROMANIAN", _("Romanian") ],
[False, "MAC_TURKISH", _("Turkish") ], [False, "MAC_TURKISH", _("Turkish") ],
[False, "MAC_UKRAINIAN", _("Cyrillic/Ukrainian") ], [False, "MAC_UKRAINIAN", _("Cyrillic/Ukrainian") ],
[False, "SHIFT-JIS", _("Japanese") ], [False, "SHIFT-JIS", _("Japanese") ],
[False, "TCVN", _("Vietnamese") ], [False, "TCVN", _("Vietnamese") ],
[False, "TIS-620", _("Thai") ], [False, "TIS-620", _("Thai") ],
[False, "UHC", _("Korean") ], [False, "UHC", _("Korean") ],
[False, "VISCII", _("Vietnamese") ], [False, "VISCII", _("Vietnamese") ],
[False, "WINDOWS-1250", _("Central European") ], [False, "WINDOWS-1250", _("Central European") ],
[False, "WINDOWS-1251", _("Cyrillic") ], [False, "WINDOWS-1251", _("Cyrillic") ],
[False, "WINDOWS-1252", _("Western") ], [False, "WINDOWS-1252", _("Western") ],
[False, "WINDOWS-1253", _("Greek") ], [False, "WINDOWS-1253", _("Greek") ],
[False, "WINDOWS-1254", _("Turkish") ], [False, "WINDOWS-1254", _("Turkish") ],
[False, "WINDOWS-1255", _("Hebrew") ], [False, "WINDOWS-1255", _("Hebrew") ],
[False, "WINDOWS-1256", _("Arabic") ], [False, "WINDOWS-1256", _("Arabic") ],
[False, "WINDOWS-1257", _("Baltic") ], [False, "WINDOWS-1257", _("Baltic") ],
[False, "WINDOWS-1258", _("Vietnamese") ] [False, "WINDOWS-1258", _("Vietnamese") ]
] ]
def __init__(self): def __init__(self):
pass pass
def get_list(): def get_list():
"""Return a list of supported encodings""" """Return a list of supported encodings"""
return TerminatorEncoding.encodings return TerminatorEncoding.encodings
get_list = staticmethod(get_list)
get_list = staticmethod(get_list)

View File

@ -76,9 +76,9 @@ class Terminator(Borg):
def do_enumerate(self, widget, pad): def do_enumerate(self, widget, pad):
"""Insert the number of each terminal in a group, into that terminal""" """Insert the number of each terminal in a group, into that terminal"""
if pad: if pad:
numstr='%0'+str(len(str(len(self.terminals))))+'d' numstr = '%0'+str(len(str(len(self.terminals))))+'d'
else: else:
numstr='%d' numstr = '%d'
for term in self.get_target_terms(widget): for term in self.get_target_terms(widget):
idx = self.terminals.index(term) idx = self.terminals.index(term)
@ -89,12 +89,12 @@ class Terminator(Borg):
if self.groupsend == self.groupsend_type['all']: if self.groupsend == self.groupsend_type['all']:
return(self.terminals) return(self.terminals)
elif self.groupsend == self.groupsend_type['group']: elif self.groupsend == self.groupsend_type['group']:
set = [] termset = []
for term in self.terminals: for term in self.terminals:
if term == widget or (term.group != None and term.group == if term == widget or (term.group != None and term.group ==
widget.group): widget.group):
set.append(term) termset.append(term)
return(set) return(termset)
else: else:
return([widget]) return([widget])