~osomon/pyexiv2/pyexiv2-0.3

« back to all changes in this revision

Viewing changes to src/pyexiv2.py

  • Committer: Olivier Tilloy
  • Date: 2009-01-12 19:34:21 UTC
  • Revision ID: olivier@tilloy.net-20090112193421-kl390qmzzj6emkkt
Retrieve XMP tag values (without python type conversion atm).

Show diffs side-by-side

added added

removed removed

Lines of Context:
416
416
 
417
417
    def __str__(self):
418
418
        """
419
 
        Return a string representation of the metadata tag.
 
419
        Return a string representation of the EXIF tag.
420
420
        """
421
421
        r = MetadataTag.__str__(self)
422
422
        r += os.linesep + 'Formatted value = ' + self.fvalue
454
454
 
455
455
    def __str__(self):
456
456
        """
457
 
        Return a string representation of the metadata tag.
 
457
        Return a string representation of the IPTC tag.
 
458
        """
 
459
        r = MetadataTag.__str__(self)
 
460
        return r.replace('Raw value = ', 'Raw values = ')
 
461
 
 
462
 
 
463
class XmpTag(MetadataTag):
 
464
 
 
465
    """
 
466
    An XMP metadata tag can have several values.
 
467
    """
 
468
 
 
469
    def __init__(self, key, name, label, description, type, values):
 
470
        """
 
471
        Constructor.
 
472
        """
 
473
        MetadataTag.__init__(self, key, name, label, description, type, values)
 
474
        self.__convert_values_to_python_type()
 
475
 
 
476
    def __convert_values_to_python_type(self):
 
477
        """
 
478
        Convert the stored values from strings to the matching Python type.
 
479
        """
 
480
        # TODO!
 
481
        pass
 
482
 
 
483
    def __str__(self):
 
484
        """
 
485
        Return a string representation of the XMP tag.
458
486
        """
459
487
        r = MetadataTag.__str__(self)
460
488
        return r.replace('Raw value = ', 'Raw values = ')