Skip to content

Commit

Permalink
openage: pylint beautifications
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJJ committed May 9, 2020
1 parent c91d04c commit fe304b1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion buildsystem/compilepy.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def main():

if args.print_output_paths_only:
print(';'.join(all_output_files))
exit(0)
sys.exit(0)

maxwidth = len(str(len(to_compile)))
for idx, (module, outputfile) in enumerate(to_compile):
Expand Down
7 changes: 3 additions & 4 deletions openage/cabextract/cab.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,10 +524,9 @@ def read_blocks(self, size=-1):
discard -= len(block_data)
continue

else:
# discard the first few bytes of the block's data.
block_data = block_data[discard:]
discard = 0
# discard the first few bytes of the block's data.
block_data = block_data[discard:]
discard = 0

if len(block_data) > size:
# less than the entire block was requested.
Expand Down
9 changes: 4 additions & 5 deletions openage/convert/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ def set_custom_wineprefix():
# test if it probably is a wineprefix
if (Path(new_wineprefix) / "drive_c").is_dir(): # pylint: disable=no-member
break
else:
print("This does not appear to be a valid WINEPREFIX.")
print("Enter a valid one, or leave it empty to skip.")

print("This does not appear to be a valid WINEPREFIX.")
print("Enter a valid one, or leave it empty to skip.")

# store the updated env variable for the wine subprocess
if new_wineprefix:
Expand Down Expand Up @@ -311,8 +311,7 @@ def query_source_dir(proposals):
sourcedir = expand_relative_path(sourcedir)
if Path(sourcedir).is_dir():
break
else:
warn("No valid existing directory: %s", sourcedir)
warn("No valid existing directory: %s", sourcedir)

return sourcedir

Expand Down
4 changes: 2 additions & 2 deletions openage/util/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def read_nullterminated_string(fileobj, maxlen=255):

if char == 0:
break
else:
result.append(char)

result.append(char)

if len(result) > maxlen:
raise Exception("Null-terminated string too long.")
Expand Down

0 comments on commit fe304b1

Please sign in to comment.