Exemple #1
0
    def get_localized_text(self, schema_ns, alt_text_name, generic_lang,
                           specific_lang, **kwargs):
        """
		get_localized_text() returns information about a selected item in an alt-text array.

		:param schema_ns	The namespace URI for the alt-text array. Has the same usage as in GetProperty.
		:param alt_text_name	The name of the alt-text array. May be a general path expression, must not be null or the empty string. Has the same namespace prefix usage as propName in GetProperty.
		:param generic_lang	The name of the generic language as an RFC 3066 primary subtag. May be null or the empty string if no generic language is wanted.
		:param specific_lang	The name of the specific language as an RFC 3066 tag. Must not be null or the empty string.

		:return: The property's value if the property exists, None otherwise.
		"""
        value = None
        value_lang = None
        the_prop = _exempi.xmp_string_new()
        actual_lang = _exempi.xmp_string_new()
        options = c_int32()

        if _exempi.xmp_get_localized_text(self.xmpptr, schema_ns,
                                          alt_text_name, generic_lang,
                                          specific_lang, actual_lang, the_prop,
                                          byref(options)):
            value = _exempi.xmp_string_cstr(the_prop)
            value_lang = _exempi.xmp_string_cstr(actual_lang)

        _exempi.xmp_string_free(the_prop)
        _exempi.xmp_string_free(actual_lang)

        return value
	def get_localized_text(self, schema_ns, alt_text_name, generic_lang, specific_lang, **kwargs ):
		""" 
		get_localized_text() returns information about a selected item in an alt-text array.

		:param schema_ns	The namespace URI for the alt-text array. Has the same usage as in GetProperty.
		:param alt_text_name	The name of the alt-text array. May be a general path expression, must not be null or the empty string. Has the same namespace prefix usage as propName in GetProperty.
		:param generic_lang	The name of the generic language as an RFC 3066 primary subtag. May be null or the empty string if no generic language is wanted.
		:param specific_lang	The name of the specific language as an RFC 3066 tag. Must not be null or the empty string.
		
		:return: The property's value if the property exists, None otherwise.
		"""
		value = None
		value_lang = None
		the_prop = _exempi.xmp_string_new()
		actual_lang = _exempi.xmp_string_new()
		options = c_int32()
		
		if _exempi.xmp_get_localized_text( self.xmpptr, schema_ns, alt_text_name, generic_lang, specific_lang, actual_lang, the_prop, byref(options) ):
			value = _exempi.xmp_string_cstr(the_prop)
			value_lang = _exempi.xmp_string_cstr(actual_lang)

		_exempi.xmp_string_free(the_prop)
		_exempi.xmp_string_free(actual_lang)
			
		return value	
	def get_property(self, schema_ns, prop_name):
		"""
		get_property() reports whether a property exists, and retrieves its value.

		This is the simplest property accessor: use this to retrieve the values of top-level simple properties.

		:param schema_ns 	The namespace URI for the property; can be null or the empty string if the first component of the prop_name path contains a namespace prefix.
		:param prop_name 	The name of the property. Can be a general path expression, must not be null or the empty string. The first component can be a namespace prefix; if present without a schema_ns value, the prefix specifies the namespace. 

		:return: The property's value if the property exists, None otherwise.
		
		.. todo:: Make get_property optionally return keywords describing property's options
		"""
		value = None
		the_prop = _exempi.xmp_string_new()

		if _exempi.xmp_get_property( self.xmpptr, schema_ns, prop_name, the_prop, 0 ): #we're never returning options
			value = _exempi.xmp_string_cstr(the_prop)

		_exempi.xmp_string_free(the_prop)
		return value
Exemple #4
0
    def get_property(self, schema_ns, prop_name):
        """
		get_property() reports whether a property exists, and retrieves its value.

		This is the simplest property accessor: use this to retrieve the values of top-level simple properties.

		:param schema_ns 	The namespace URI for the property; can be null or the empty string if the first component of the prop_name path contains a namespace prefix.
		:param prop_name 	The name of the property. Can be a general path expression, must not be null or the empty string. The first component can be a namespace prefix; if present without a schema_ns value, the prefix specifies the namespace.

		:return: The property's value if the property exists, None otherwise.

		.. todo:: Make get_property optionally return keywords describing property's options
		"""
        value = None
        the_prop = _exempi.xmp_string_new()

        if _exempi.xmp_get_property(self.xmpptr, schema_ns, prop_name,
                                    the_prop,
                                    0):  # we're never returning options
            value = _exempi.xmp_string_cstr(the_prop)

        _exempi.xmp_string_free(the_prop)
        return value
Exemple #5
0
 def __del__(self):
     _exempi.xmp_string_free(self._ptr)
	def __del__(self):
		_exempi.xmp_string_free(self._ptr)