safe.metadata.property.base_property module

InaSAFE Disaster risk assessment tool developed by AusAid - metadata module.

Contact : ole.moller.nielsen@gmail.com

Note

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

class safe.metadata.property.base_property.BaseProperty(name, value, xml_path, allowed_python_types)[source]

Bases: object

Abstract Metadata Property class, this has to be subclassed.

This class represents the base for all properties. A property is a container with name, value, xml_path and allowed_python_types.

properties are instantiated by checking the xml_type in the xml_path in BaseMetadata.

Each property allows certain python data types and has to have an is_valid method to check if the passed value is ok.

cast_from_str and xml_value need also to be implemented in the subclasses

New in version 3.2.

allowed_python_types[source]
cast_from_str(value)[source]
dict[source]
is_allowed_type(value)[source]
is_valid(value)[source]
python_type[source]
value[source]
xml_path[source]
xml_value[source]