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
#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'],
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)
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' add_option( "--no-save" , action= "store_ true", add_option( "-o", "--overwrite", action= "store_ true", existing_ images" ,
--- 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/ 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 is_valid_ last_action( ) or file_only( actions) ): is_valid_ last_action( ) or file_only(actions)\ 'no_save' ]):
send. frame_append_ save_action( )
last_action = actions[-1]
- if not (last_action.
+ if not (last_action.
+ or settings[
return None
#Check if overwrite is forced 'overwrite_ existing_ images_ forced' ] = \ -1].is_ overwrite_ existing_ images_ forced( ) 'no_save' ]) and actions[ -1].is_ overwrite_ existing_ images_ forced( )
settings[
- actions[
+ (not settings[
return actions
@@ -330,7 +331,8 @@
#Retrieve settings existing_ images = not (settings[ 'overwrite_ existing_ images' ] or\ 'overwrite_ existing_ images_ forced' ]) 'overwrite_ existing_ images_ forced' ]) and\ 'save_metadata' ]
'stop_ for_errors' : settings[ 'stop_for_ errors' ],
skip_
- settings[
+ settings[
+ not settings['no_save']
save_metadata = settings[
result = {
=== modified file 'phatch/ core/settings. py' core/settings. py 2008-02-04 04:39:01 +0000 core/settings. py 2009-02-17 00:45:14 +0000
'recursive' : False,
'stop_ for_errors' : True,
'overwrite_ existing_ images' : False,
'check_ images_ first' : True,
'save_ metadata' : False,# bool(pil. exif),
--- phatch/
+++ phatch/
@@ -8,6 +8,7 @@
+ 'no_save' : False,
#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 exists( ct.SETTINGS_ PATH): SETTINGS_ PATH,'rb' )
self. settings. update( cPickle. load(f) )
f. close() update( cli)
+ # 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.
def _saveSettings( self): SETTINGS_ PATH,'wb' ) copy()
cPickle. dump(self. settings, f)
f = open(ct.
+ settings = self.settings.
f.close()
@@ -898,4 +904,4 @@
if __name__ == "__main__":
- main()
\ No newline at end of file
+ main()
$ bzr commit -m "added --no-save option" sync/python/ phatch/ trunk/ core/settings. py
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.