mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-23 16:58:06 -06:00
Reformat python code to be compliant with PEP8
The following command is used: `pycodestyle --ignore=E265,E722 --max-line-length=100 <py files>`
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#VERSION: 1.45
|
||||
#VERSION: 1.46
|
||||
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
@@ -24,9 +24,12 @@
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
def prettyPrinter(dictionary):
|
||||
dictionary['size'] = anySizeToBytes(dictionary['size'])
|
||||
outtext = "|".join((dictionary["link"], dictionary["name"].replace("|", " "), str(dictionary["size"]), str(dictionary["seeds"]), str(dictionary["leech"]), dictionary["engine_url"]))
|
||||
outtext = "|".join((dictionary["link"], dictionary["name"].replace("|", " "),
|
||||
str(dictionary["size"]), str(dictionary["seeds"]),
|
||||
str(dictionary["leech"]), dictionary["engine_url"]))
|
||||
if 'desc_link' in dictionary:
|
||||
outtext = "|".join((outtext, dictionary["desc_link"]))
|
||||
|
||||
@@ -34,6 +37,7 @@ def prettyPrinter(dictionary):
|
||||
with open(1, 'w', encoding='utf-8', closefd=False) as utf8stdout:
|
||||
print(outtext, file=utf8stdout)
|
||||
|
||||
|
||||
def anySizeToBytes(size_string):
|
||||
"""
|
||||
Convert a string like '1 KB' to '1024' (bytes)
|
||||
|
||||
Reference in New Issue
Block a user