Cleanup
This commit is contained in:
parent
e293289a55
commit
9090c19c62
@ -51,7 +51,7 @@ def sanitize(text, kana=True, wildcards=False):
|
||||
text = re.sub(u'[\??]', u'_', text)
|
||||
overrides = [u'%', u'_']
|
||||
else:
|
||||
overrides = list()
|
||||
overrides = []
|
||||
|
||||
result = u''
|
||||
for c in text:
|
||||
|
@ -24,7 +24,7 @@ import sqlite3
|
||||
|
||||
def decodeContent(content):
|
||||
encodings = ['utf-8', 'shift_jis', 'euc-jp', 'utf-16']
|
||||
errors = dict()
|
||||
errors = {}
|
||||
|
||||
for encoding in encodings:
|
||||
try:
|
||||
@ -89,6 +89,8 @@ def formatFields(fields, markup):
|
||||
result[field] = value.format(**markup)
|
||||
except KeyError:
|
||||
pass
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
return result
|
||||
|
||||
@ -126,16 +128,9 @@ def markupVocabReading(definition):
|
||||
def copyVocabDef(definition):
|
||||
glossary = '; '.join(definition['glossary'])
|
||||
if definition['reading']:
|
||||
result = u'{0}\t{1}\t{2}\n'.format(
|
||||
definition['expression'],
|
||||
definition['reading'],
|
||||
glossary
|
||||
)
|
||||
result = u'{0}\t{1}\t{2}\n'.format(definition['expression'], definition['reading'], glossary)
|
||||
else:
|
||||
result = u'{0}\t{1}\n'.format(
|
||||
definition['expression'],
|
||||
glossary
|
||||
)
|
||||
result = u'{0}\t{1}\n'.format(definition['expression'], glossary)
|
||||
|
||||
QtGui.QApplication.clipboard().setText(result)
|
||||
|
||||
|
@ -57,7 +57,7 @@ class UpdateFinder(QtCore.QThread):
|
||||
|
||||
def run(self):
|
||||
latest = constants.c['appVersion']
|
||||
updates = list()
|
||||
updates = []
|
||||
|
||||
try:
|
||||
fp = urllib2.urlopen('https://foosoft.net/projects/yomichan/dl/updates.json')
|
||||
|
Loading…
Reference in New Issue
Block a user