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_images_first' : True, > 'save_metadata' : False,#bool(pil.exif), > #console > > === modified file 'phatch/pyWx/gui.py' > --- phatch/pyWx/gui.py 2008-06-06 22:24:14 +0000 > +++ phatch/pyWx/gui.py 2009-02-17 01:09:22 +0000 > @@ -827,13 +827,19 @@ > > def _loadSettings(self,settings): > self.settings = settings > + # settings which can be exclusively set through the terminal > + cli = {} > + for key in ['no_save']: > + cli[key] = settings[key] > if os.path.exists(ct.SETTINGS_PATH): > f = open(ct.SETTINGS_PATH,'rb') > self.settings.update(cPickle.load(f)) > f.close() > + self.settings.update(cli) > > def _saveSettings(self): > f = open(ct.SETTINGS_PATH,'wb') > + settings = self.settings.copy() > cPickle.dump(self.settings,f) > f.close() > > @@ -898,4 +904,4 @@ > > > if __name__ == "__main__": > - main() > \ No newline at end of file > + main() > > $ bzr commit -m "added --no-save option" > Committing to: /home/stani/sync/python/phatch/trunk/ > modified linux/phatch.1 > modified phatch/app.py > modified phatch/core/api.py > modified phatch/core/settings.py > modified phatch/pyWx/gui.py > Committed revision 550. > > ** Changed in: phatch > Importance: Wishlist => Low > Status: Incomplete => Fix Committed > > -- > Allow omitting 'Save' action > https://bugs.launchpad.net/bugs/270478 > You received this bug notification because you are a direct subscriber > of the bug. >
Stani,
Great! it checks out fine.
Thanks for this,
Kent
On Tue, Feb 17, 2009 at 7:41 PM, stani <email address hidden> wrote: add_option( "--no-save" , action= "store_ true", add_option( "-o", "--overwrite", action= "store_ true", existing_ images" , core/api. py' is_valid_ last_action( ) or file_only( actions) ): is_valid_ last_action( ) or file_only(actions)\ 'no_save' ]): append_ save_action( ) 'overwrite_ existing_ images_ forced' ] = \ -1].is_ overwrite_ existing_ images_ forced( ) 'no_save' ]) and actions[ -1].is_ overwrite_ existing_ images_ forced( ) images = not (settings[ 'overwrite_ existing_ images' ] or\ 'overwrite_ existing_ images_ forced' ]) 'overwrite_ existing_ images_ forced' ]) and\ 'save_metadata' ] 'stop_for_ errors' ], core/settings. py' core/settings. py 2008-02-04 04:39:01 +0000 core/settings. py 2009-02-17 00:45:14 +0000 existing_ images' : False, images_ first' : True, bool(pil. exif), pyWx/gui. py' self,settings) : exists( ct.SETTINGS_ PATH): SETTINGS_ PATH,'rb' ) update( cPickle. load(f) ) update( cli) self): SETTINGS_ PATH,'wb' ) copy() dump(self. settings, f) sync/python/ phatch/ trunk/ core/settings. py /bugs.launchpad .net/bugs/ 270478
> 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.
> + dest = "no_save",
> + default = False,
> + help = _("No save action required at the end"))
> parser.
> dest = "overwrite_
> default = False,
>
> === modified file 'phatch/
> --- 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.
> + if not (last_action.
> + or settings[
> send.frame_
> return None
>
> #Check if overwrite is forced
> settings[
> - actions[
> + (not settings[
>
> return actions
>
> @@ -330,7 +331,8 @@
>
> #Retrieve settings
> skip_existing_
> - settings[
> + settings[
> + not settings['no_save']
> save_metadata = settings[
> result = {
> 'stop_for_errors' : settings[
>
> === modified file 'phatch/
> --- phatch/
> +++ phatch/
> @@ -8,6 +8,7 @@
> 'recursive' : False,
> 'stop_for_errors' : True,
> 'overwrite_
> + 'no_save' : False,
> 'check_
> 'save_metadata' : False,#
> #console
>
> === modified file 'phatch/
> --- phatch/pyWx/gui.py 2008-06-06 22:24:14 +0000
> +++ phatch/pyWx/gui.py 2009-02-17 01:09:22 +0000
> @@ -827,13 +827,19 @@
>
> def _loadSettings(
> self.settings = settings
> + # settings which can be exclusively set through the terminal
> + cli = {}
> + for key in ['no_save']:
> + cli[key] = settings[key]
> if os.path.
> f = open(ct.
> self.settings.
> f.close()
> + self.settings.
>
> def _saveSettings(
> f = open(ct.
> + settings = self.settings.
> cPickle.
> f.close()
>
> @@ -898,4 +904,4 @@
>
>
> if __name__ == "__main__":
> - main()
> \ No newline at end of file
> + main()
>
> $ bzr commit -m "added --no-save option"
> Committing to: /home/stani/
> modified linux/phatch.1
> modified phatch/app.py
> modified phatch/core/api.py
> modified phatch/
> modified phatch/pyWx/gui.py
> Committed revision 550.
>
> ** Changed in: phatch
> Importance: Wishlist => Low
> Status: Incomplete => Fix Committed
>
> --
> Allow omitting 'Save' action
> https:/
> You received this bug notification because you are a direct subscriber
> of the bug.
>