Allow omitting 'Save' action

Bug #270478 reported by Kent Tenney
2
Affects Status Importance Assigned to Milestone
Phatch
Fix Released
Low
Stani

Bug Description

Phatch will not allow a processing run if it's 'Save' action is not on the list.

A user may want to replace the default 'Save', or perform some operation
which doesn't require saving.

While useful as a reminder in the majority of cases, the ability to configure
Phatch to continue without 'Save' would be welcome.

Stani (stani)
Changed in phatch:
assignee: nobody → stani
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Stani (stani) wrote :

Can you describe a user scenario of both:
- replace default save
- operation which doesn't require saving

Changed in phatch:
status: Confirmed → Incomplete
Revision history for this message
Kent Tenney (ktenney) wrote : Re: [Bug 270478] Re: Allow omitting 'Save' action

On Fri, Jan 9, 2009 at 10:33 AM, stani <email address hidden> wrote:
> Can you describe a user scenario of both:
> - replace default save

 The default save discards tEXt chunk in png, user has provided an action
which preserves all chunks.

> - operation which doesn't require saving

using Phatch as to run an action that scans image files for tEXt chunks
and writes to a database. The image files are not modified, should not
be saved.

>
> ** Changed in: phatch
> Status: Confirmed => Incomplete
>
> --
> Allow omitting 'Save' action
> https://bugs.launchpad.net/bugs/270478
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Stani (stani) wrote :
Download full text (4.2 KiB)

Fix committed upstream in revision 550. Please test (bzr branch lp:phatch). You can only enable this option on the command line with the --no-save option.
$ phatch --no-save

Commit report:
$ bzr diff
=== modified file 'linux/phatch.1'
--- linux/phatch.1 2008-03-17 00:44:55 +0000
+++ linux/phatch.1 2009-02-17 01:25:44 +0000
@@ -1,4 +1,4 @@
-.TH PHATCH "1" "January 2008" "User Commands"
+.TH PHATCH "1" "February 2009" "User Commands"
 .SH NAME
 Phatch \- Photo Batch Processor
 .SH DESCRIPTION
@@ -44,6 +44,9 @@
 \fB\-m\fR, \fB\-\-metadata\fR
 Save metadata (requires exif & iptc plugin)
 .TP
+\fB\-\-no\-save\fR
+No save action required at the end
+.TP
 \fB\-o\fR, \fB\-\-overwrite\fR
 Overwrite existing images
 .TP

=== modified file 'phatch/app.py'
--- phatch/app.py 2008-11-08 17:48:36 +0000
+++ phatch/app.py 2009-02-17 00:45:53 +0000
@@ -80,6 +80,10 @@
         dest = "image_inspector",
         default = False,
         help = _("Inspect metadata (requires exif & iptc plugin)"))
+ parser.add_option("--no-save", action="store_true",
+ dest = "no_save",
+ default = False,
+ help = _("No save action required at the end"))
     parser.add_option("-o", "--overwrite", action="store_true",
         dest = "overwrite_existing_images",
         default = False,

=== modified file 'phatch/core/api.py'
--- phatch/core/api.py 2008-10-29 13:30:25 +0000
+++ phatch/core/api.py 2009-02-17 01:13:23 +0000
@@ -148,13 +148,14 @@

     #Check if there is a save statement
     last_action = actions[-1]
- if not (last_action.is_valid_last_action() or file_only(actions)):
+ if not (last_action.is_valid_last_action() or file_only(actions)\
+ or settings['no_save']):
         send.frame_append_save_action()
         return None

     #Check if overwrite is forced
     settings['overwrite_existing_images_forced'] = \
- actions[-1].is_overwrite_existing_images_forced()
+ (not settings['no_save']) and actions[-1].is_overwrite_existing_images_forced()

     return actions

@@ -330,7 +331,8 @@

     #Retrieve settings
     skip_existing_images = not (settings['overwrite_existing_images'] or\
- settings['overwrite_existing_images_forced'])
+ settings['overwrite_existing_images_forced']) and\
+ not settings['no_save']
     save_metadata = settings['save_metadata']
     result = {
         'stop_for_errors' : settings['stop_for_errors'],

=== modified file 'phatch/core/settings.py'
--- phatch/core/settings.py 2008-02-04 04:39:01 +0000
+++ phatch/core/settings.py 2009-02-17 00:45:14 +0000
@@ -8,6 +8,7 @@
         'recursive' : False,
         'stop_for_errors' : True,
         'overwrite_existing_images' : False,
+ 'no_save' : False,
         'check_images_first' : True,
         'save_metadata' : False,#bool(pil.exif),
         #console

=== modified file 'phatch/pyWx/gui.py'
--- phatch/pyWx/gui.py 2008-06-06...

Read more...

Changed in phatch:
importance: Wishlist → Low
status: Incomplete → Fix Committed
Revision history for this message
Kent Tenney (ktenney) wrote :
Download full text (4.7 KiB)

Stani,

Great! it checks out fine.

Thanks for this,
Kent

On Tue, Feb 17, 2009 at 7:41 PM, stani <email address hidden> wrote:
> Fix committed upstream in revision 550. Please test (bzr branch lp:phatch). You can only enable this option on the command line with the --no-save option.
> $ phatch --no-save
>
> Commit report:
> $ bzr diff
> === modified file 'linux/phatch.1'
> --- linux/phatch.1 2008-03-17 00:44:55 +0000
> +++ linux/phatch.1 2009-02-17 01:25:44 +0000
> @@ -1,4 +1,4 @@
> -.TH PHATCH "1" "January 2008" "User Commands"
> +.TH PHATCH "1" "February 2009" "User Commands"
> .SH NAME
> Phatch \- Photo Batch Processor
> .SH DESCRIPTION
> @@ -44,6 +44,9 @@
> \fB\-m\fR, \fB\-\-metadata\fR
> Save metadata (requires exif & iptc plugin)
> .TP
> +\fB\-\-no\-save\fR
> +No save action required at the end
> +.TP
> \fB\-o\fR, \fB\-\-overwrite\fR
> Overwrite existing images
> .TP
>
> === modified file 'phatch/app.py'
> --- phatch/app.py 2008-11-08 17:48:36 +0000
> +++ phatch/app.py 2009-02-17 00:45:53 +0000
> @@ -80,6 +80,10 @@
> dest = "image_inspector",
> default = False,
> help = _("Inspect metadata (requires exif & iptc plugin)"))
> + parser.add_option("--no-save", action="store_true",
> + dest = "no_save",
> + default = False,
> + help = _("No save action required at the end"))
> parser.add_option("-o", "--overwrite", action="store_true",
> dest = "overwrite_existing_images",
> default = False,
>
> === modified file 'phatch/core/api.py'
> --- phatch/core/api.py 2008-10-29 13:30:25 +0000
> +++ phatch/core/api.py 2009-02-17 01:13:23 +0000
> @@ -148,13 +148,14 @@
>
> #Check if there is a save statement
> last_action = actions[-1]
> - if not (last_action.is_valid_last_action() or file_only(actions)):
> + if not (last_action.is_valid_last_action() or file_only(actions)\
> + or settings['no_save']):
> send.frame_append_save_action()
> return None
>
> #Check if overwrite is forced
> settings['overwrite_existing_images_forced'] = \
> - actions[-1].is_overwrite_existing_images_forced()
> + (not settings['no_save']) and actions[-1].is_overwrite_existing_images_forced()
>
> return actions
>
> @@ -330,7 +331,8 @@
>
> #Retrieve settings
> skip_existing_images = not (settings['overwrite_existing_images'] or\
> - settings['overwrite_existing_images_forced'])
> + settings['overwrite_existing_images_forced']) and\
> + not settings['no_save']
> save_metadata = settings['save_metadata']
> result = {
> 'stop_for_errors' : settings['stop_for_errors'],
>
> === modified file 'phatch/core/settings.py'
> --- phatch/core/settings.py 2008-02-04 04:39:01 +0000
> +++ phatch/core/settings.py 2009-02-17 00:45:14 +0000
> @@ -8,6 +8,7 @@
> 'recursive' : False,
> 'stop_for_errors' : True,
> 'overwrite_existing_images' : False,
> + 'no_save' : False,
> 'check_...

Read more...

Stani (stani)
Changed in phatch:
milestone: none → 0.2.1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.