← Back to team overview

phatch-dev team mailing list archive

[Bug 383889] Re: Save or rename files with new prefix fails with error

 

This has been fixed upstream in the bazaar repository. Thanks for
reporting this bug. Basically replacing 'Filename' with 'Name' fixes the
issue. This issue will only be really fixed when the translations are
updated in rosetta. I'll upload the new pot soon.

=== modified file 'phatch/actions/copy.py'
--- phatch/actions/copy.py	2009-06-05 00:29:01 +0000
+++ phatch/actions/copy.py	2009-06-05 13:10:01 +0000
@@ -35,7 +35,7 @@
     flush_metadata_before   = True
     
     def interface(self,fields):
-        fields[_t('Filename')]     = self.FileNameField(choices=self.FILENAMES)
+        fields[_t('Name')]     = self.FileNameField(choices=self.FILENAMES)
         fields[_t('In')]           = self.FilePathField(self.DEFAULT_FOLDER,
                                         choices=self.FOLDERS)
         
@@ -57,14 +57,14 @@
             
     def is_done_info(self,info):
         folder      = self.get_field('In',info)
-        filename    = self.get_field('Filename',info)
+        filename    = self.get_field('Name',info)
         typ         = info['type']
         return folder, os.path.join(folder,'%s.%s'%(filename,typ)), typ
         
     def is_overwrite_existing_images_forced(self):
         """Force overwrite when copying in place."""
         return (self.get_field_string('In') == self.FOLDER) and\
-            (self.get_field_string('Filename') == self.FILENAME)
+            (self.get_field_string('Name') == self.FILENAME)
     
     icon = \
 'x\xda\x15\x97\x078\xd4\x7f\x1c\xc7\xef$\x9b\xb2"+\xe3H\xc8&\xc9J\x88\xcbv\

=== modified file 'phatch/actions/rename.py'
--- phatch/actions/rename.py	2009-06-05 00:29:01 +0000
+++ phatch/actions/rename.py	2009-06-05 13:10:01 +0000
@@ -35,7 +35,7 @@
     flush_metadata_before   = True
     
     def interface(self,fields):
-        fields[_t('Filename')]     = self.FileNameField(choices=self.FILENAMES)
+        fields[_t('Name')]         = self.FileNameField(choices=self.FILENAMES)
         fields[_t('In')]           = self.FilePathField(self.DEFAULT_FOLDER,
                                         choices=self.FOLDERS)
         
@@ -57,14 +57,14 @@
             
     def is_done_info(self,info):
         folder      = self.get_field('In',info)
-        filename    = self.get_field('Filename',info)
+        filename    = self.get_field('Name',info)
         typ         = info['type']
         return folder, os.path.join(folder,'%s.%s'%(filename,typ)), typ
         
     def is_overwrite_existing_images_forced(self):
         """Force overwrite when using default values."""
         return (self.get_field_string('In') == self.FOLDER) and\
-            (self.get_field_string('Filename') == self.FILENAME)
+            (self.get_field_string('Name') == self.FILENAME)
     
     icon = \
 'x\xda\x01\x9c\x04c\xfb\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x000\x00\

=== modified file 'phatch/actions/save.py'
--- phatch/actions/save.py	2009-06-05 00:29:01 +0000
+++ phatch/actions/save.py	2009-06-05 13:10:01 +0000
@@ -49,7 +49,7 @@
     flush_metadata_before   = True
     
     def interface(self,fields):
-        fields[_t('Filename')]      = self.FileNameField(choices=self.FILENAMES)
+        fields[_t('Name')]          = self.FileNameField(choices=self.FILENAMES)
         fields[_t('As')]            = self.ImageWriteTypeField(self.TYPE)
         fields[_t('In')]            = self.FilePathField(self.DEFAULT_FOLDER,
                                         choices=self.FOLDERS)
@@ -125,13 +125,13 @@
     
     def is_done_info(self,info):
         folder      = self.get_field('In',info)
-        filename    = self.get_field('Filename',info)
+        filename    = self.get_field('Name',info)
         typ         = self.get_field('As',info)
         return folder, os.path.join(folder,'%s.%s'%(filename,typ)), typ
 
     def is_overwrite_existing_images_forced(self):
         return (self.get_field_string('In') == self.FOLDER) and\
-            (self.get_field_string('Filename') == self.FILENAME) and\
+            (self.get_field_string('Name') == self.FILENAME) and\
             (self.get_field_string('As') == self.TYPE)
     
     icon = \

=== modified file 'phatch/templates/action.py'
--- phatch/templates/action.py	2009-05-21 03:04:27 +0000
+++ phatch/templates/action.py	2009-06-05 13:10:01 +0000
@@ -52,7 +52,7 @@
         fields[_t('Color')]     = self.ColorField('#FFFFFF')
         fields[_t('Resolution')]= self.DpiField('<dpi>')
         fields[_t('File')]      = self.FileField('/home/images/logo.jpg')
-        fields[_t('Filename')]  = self.FileNameField('<filename>')
+        fields[_t('Name')]      = self.FileNameField('<filename>')
         fields[_t('In')]        = self.FilePathField('<folder>') #folder
         fields[_t('Float')]     = self.FloatField(3.14)
         fields[_t('As')]        = self.ImageTypeField('<type>')#png, jpg


** Changed in: phatch
       Status: In Progress => Fix Committed

-- 
Save or rename files with new prefix fails with error
https://bugs.launchpad.net/bugs/383889
You received this bug notification because you are a member of Phatch
Developers, which is subscribed to Phatch.

Status in Phatch = Photo & Batch!: Fix Committed

Bug description:
(Phatch 0.1.3 on Ubuntu Hardy Heron with backports enabled, amd64-bit version, German language)

My task was to resize Images and save them with prefix "t_".


How to reproduce:

With action "save" or "rename"...
Clicking in the value field "Dateiname:" (german for "Filename:")
and adding "t_" as prefix to "<Dateiname>" (german for "<filename>")
results in this error message:

"Filename: the variable 'u'Filename'' doesn't exist."


=> Therefore i can't add prefixes to generated image's filenames.


Perhaps somehow german language-set interferes with Variable names here?



Workaround:
Save the actions list and re-open it with a text-editor.
Then change variable for filename manually.


'Filename': u'<filename>',

could e.g. become

'Filename': u't_<filename>',


Renaming then works in this action list as expected and is displayed correctly in Phatch's action list.



References