mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-01 05:08:05 -06:00
Fix trailing whitespace in multiple files
Also fix formatting of CODING_GUIDELINES.md
This commit is contained in:
@@ -48,7 +48,7 @@ private slots:
|
||||
void preferencesAction();
|
||||
void setPreferencesAction();
|
||||
void defaultSavePathAction();
|
||||
|
||||
|
||||
void networkInterfaceListAction();
|
||||
void networkInterfaceAddressListAction();
|
||||
};
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
# modify file(s), you may extend this exception to your version of the file(s),
|
||||
# but you are not obligated to do so. If you do not wish to do so, delete this
|
||||
# exception statement from your version.
|
||||
|
||||
|
||||
import argparse
|
||||
import copy
|
||||
import os
|
||||
@@ -62,7 +62,7 @@ def processTranslation(filename, sources):
|
||||
except Exception:
|
||||
print('\tFailed to parse %s!' % (os.path.normpath(filename)))
|
||||
return
|
||||
|
||||
|
||||
root = tree.getroot()
|
||||
for context in root.findall('context'):
|
||||
context_name = context.find('name').text
|
||||
@@ -70,16 +70,16 @@ def processTranslation(filename, sources):
|
||||
if not has_context and no_obsolete:
|
||||
root.remove(context)
|
||||
continue
|
||||
|
||||
|
||||
for message in context.findall('message'):
|
||||
for location in message.findall('location'):
|
||||
message.remove(location)
|
||||
|
||||
|
||||
source = message.find('source').text
|
||||
translation = message.find('translation')
|
||||
if has_context and source in sources[context_name]:
|
||||
sources[context_name].remove(source)
|
||||
|
||||
|
||||
trtype = translation.attrib.get('type')
|
||||
if (trtype == 'obsolete') or (trtype == 'vanished'):
|
||||
del translation.attrib['type'] # i.e. finished
|
||||
@@ -107,7 +107,7 @@ def processTranslation(filename, sources):
|
||||
for source in sources[context_name]:
|
||||
message = ET.SubElement(context, 'message')
|
||||
ET.SubElement(message, 'source').text = source
|
||||
ET.SubElement(message, 'translation', {'type': 'unfinished'})
|
||||
ET.SubElement(message, 'translation', {'type': 'unfinished'})
|
||||
|
||||
# prettify output xml
|
||||
indent = ' ' * 4
|
||||
@@ -118,13 +118,13 @@ def processTranslation(filename, sources):
|
||||
context.find('./name').tail = '\n' + indent
|
||||
messages = context.findall('./message')
|
||||
if len(messages) == 0: continue
|
||||
|
||||
|
||||
for message in messages:
|
||||
message.text = '\n' + (indent * 2)
|
||||
message.tail = '\n' + indent
|
||||
elems = message.findall('./')
|
||||
if len(elems) == 0: continue
|
||||
|
||||
|
||||
for elem in elems:
|
||||
elem.tail = '\n' + (indent * 2)
|
||||
elems[-1:][0].tail = '\n' + indent
|
||||
|
||||
Reference in New Issue
Block a user