From a697dc4747993583176484df1599bbb758343b12 Mon Sep 17 00:00:00 2001 From: Jakub Wilk Date: Wed, 15 Mar 2017 14:29:34 +0100 Subject: [PATCH] strip trailing whitespace --- cropgtk.py | 10 +++++----- cropgui_common.py | 2 +- filechooser.py | 2 +- log.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cropgtk.py b/cropgtk.py index f7723ee..6ba198a 100755 --- a/cropgtk.py +++ b/cropgtk.py @@ -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) @@ -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) @@ -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]) @@ -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) @@ -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 diff --git a/cropgui_common.py b/cropgui_common.py index 100522c..0025b07 100644 --- a/cropgui_common.py +++ b/cropgui_common.py @@ -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): diff --git a/filechooser.py b/filechooser.py index 09f55a0..eb36194 100644 --- a/filechooser.py +++ b/filechooser.py @@ -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) diff --git a/log.py b/log.py index 3008aee..d010bea 100644 --- a/log.py +++ b/log.py @@ -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):