Skip to content
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

strip trailing whitespace #35

Merged
merged 1 commit into from
Mar 15, 2017
Merged
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions cropgtk.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def key(self, w, e):

def image_set(self):
self.render()

def render(self):
if self.idle is None:
self.idle = gobject.idle_add(self.do_render)
Expand Down Expand Up @@ -267,7 +267,7 @@ def run(self):
if v == 0:
self.log("Skipped %s" % os.path.basename(image_name))
continue # user hit "next" / escape

t, l, r, b = drag.top, drag.left, drag.right, drag.bottom
cropspec = "%dx%d+%d+%d" % (r-l, b-t, l, t)

Expand All @@ -287,7 +287,7 @@ def run(self):
if not rotation == "none": command.extend(['-rotate', rotation])
command.extend(['-copy', 'all', '-crop', cropspec,'-outfile', target, image_name])
# All other images use imagemagic convert.
else:
else:
command = ['nice', 'convert']
if not rotation == "none": command.extend(['-rotate', rotation])
command.extend([image_name, '-crop', cropspec, target])
Expand All @@ -308,7 +308,7 @@ def output_name(self, image_name, image_type):
image_name = os.path.abspath(image_name)
d = os.path.dirname(image_name)
i = os.path.basename(image_name)
j = os.path.splitext(i)[0].lower()
j = os.path.splitext(i)[0].lower()
if j.endswith('-crop'): j += os.path.splitext(i)[1]
else: j += "-crop" + os.path.splitext(i)[1]
if os.access(d, os.W_OK): return os.path.join(d, j)
Expand All @@ -323,7 +323,7 @@ def output_name(self, image_name, image_type):
if not r: return ''
r = r[0]
e = os.path.splitext(r)[1]
if image_type == "jpeg":
if image_type == "jpeg":
if e.lower() in ['.jpg', '.jpeg']: return r
return e + ".jpg"
elif e.lower() == image_type: return r
Expand Down
2 changes: 1 addition & 1 deletion cropgui_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def set_stdsize(self, x, y):
if (bottom > self.h):
bottom = self.h
top = bottom - y

self.set_crop (top, left, right, bottom)

def set_crop(self, top, left, right, bottom):
Expand Down
2 changes: 1 addition & 1 deletion filechooser.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def update_preview_cb(file_chooser, preview):
image_data = i.tostring()
except:
image_data = i.tobytes()
pixbuf = gtk.gdk.pixbuf_new_from_data(image_data,
pixbuf = gtk.gdk.pixbuf_new_from_data(image_data,
gtk.gdk.COLORSPACE_RGB, 0, 8, i.size[0], i.size[1],
i.size[0]*3)
preview.set_from_pixbuf(pixbuf)
Expand Down
2 changes: 1 addition & 1 deletion log.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def progress(message, *args):
message += " " * (last_width - width)
sys.stderr.write(message + "\r")
sys.stderr.flush()
last_width = width
last_width = width

@locked
def log(message, *args):
Expand Down