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:
Chocobo1
2018-09-18 12:33:09 +08:00
parent bdc788c824
commit bbe76231cf
8 changed files with 122 additions and 79 deletions

View File

@@ -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)