Skip to content

Sourcery Starbot ⭐ refactored jefftriplett/kindlestrip #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions kindlestrip.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def utf8_argv():
argvencoding = sys.stdin.encoding
if argvencoding == None:
argvencoding = sys.getfilesystemencoding()
if argvencoding == None:
if argvencoding is None:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function utf8_argv refactored with the following changes:

  • Use x is None rather than x == None (none-compare)

argvencoding = 'utf-8'
for arg in sys.argv:
if type(arg) == unicode:
Expand Down Expand Up @@ -187,16 +187,11 @@ class StripException(Exception):


def patchdata(datain, off, new):
dout=[]
dout.append(datain[:off])
dout.append(new)
dout.append(datain[off+len(new):])
dout = [datain[:off], new, datain[off+len(new):]]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function patchdata refactored with the following changes:

  • Merge append into list declaration (merge-list-append)

return ''.join(dout)

def joindata(datain, new):
dout=[]
dout.append(datain)
dout.append(new)
dout = [datain, new]
Comment on lines -197 to +194
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function joindata refactored with the following changes:

  • Merge append into list declaration (merge-list-append)

return ''.join(dout)


Expand Down