2009-02-17 01:41:52 |
Stani |
phatch: statusexplanation |
Can you describe a user scenario of both:
- replace default save
- operation which doesn't require saving |
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. |
|