summaryrefslogtreecommitdiff
path: root/rapid/generatename.py
diff options
context:
space:
mode:
authorJulien Valroff <julien@kirya.net>2011-05-23 21:05:08 +0200
committerJulien Valroff <julien@kirya.net>2011-05-23 21:05:08 +0200
commit85952027591c5da285f924e4d2d013a4493c1845 (patch)
treed234ed0ee5e97c29f666d0d9580584efb5c8441e /rapid/generatename.py
parent18c39a3fad0f9bf92840f79bcea5d72ed396403d (diff)
parentb494e83efd647b035c6bee2fa09a33fa383ef4a3 (diff)
Merge commit 'upstream/0.4.1'
Diffstat (limited to 'rapid/generatename.py')
-rw-r--r--rapid/generatename.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/rapid/generatename.py b/rapid/generatename.py
index e904a70..1c95478 100644
--- a/rapid/generatename.py
+++ b/rapid/generatename.py
@@ -199,10 +199,15 @@ class PhotoName:
elif self.L1 == OWNER_NAME:
v = self.rpd_file.metadata.owner_name()
+ elif self.L1 == ARTIST:
+ v = self.rpd_file.metadata.artist()
+ elif self.L1 == COPYRIGHT:
+ v = self.rpd_file.metadata.copyright()
else:
raise TypeError("Invalid metadata option specified")
if self.L1 in [CAMERA_MAKE, CAMERA_MODEL, SHORT_CAMERA_MODEL,
- SHORT_CAMERA_MODEL_HYPHEN, OWNER_NAME]:
+ SHORT_CAMERA_MODEL_HYPHEN, OWNER_NAME, ARTIST,
+ COPYRIGHT]:
if self.L2 == UPPERCASE:
v = v.upper()
elif self.L2 == LOWERCASE:
@@ -296,6 +301,9 @@ class PhotoName:
v = self._get_component()
if v:
name += v
+
+ # remove any null characters - they are bad news in filenames
+ name = name.replace('\x00', '')
if self.rpd_file.strip_characters:
for c in r'\:*?"<>|':