Home | Trees | Indices | Help |
|
---|
|
builtins.object --+ | SimpleSerializer --+ | SimpleXMLSerializer
This class is a simple interface to get and store data in XML files.
Usage:
from fife.extensions.serializers.simplexml import SimpleXMLSerializer serializer = SimpleXMLSerializer(filename="somefile.xml") serializer.set("module_name", "variable_name", "value") somevariable = serializer.get("module_name", "variable_name", "default_value")
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|
Loads the XML file into memory and validates it. Raises a SerializerError exception if the file is not specified.
Note: If the file does not exist it will automatically create a blank file for you. |
Saves the XML file.
Note: This Overwrites the file if it exists. |
Gets the value of a specified variable
|
Sets a variable to specified value.
|
Removes a variable
|
@return A list of the names of the modules in the XML file as strings.
|
|
Iterates the XML tree and prints warning when an invalid tag is found. Raises an InvalidFormat exception if there is a format error. |
Returns a module element from the XML tree. If no module with the specified name exists, a new element will be created.
|
Adds whitespace, so the resulting XML-file is properly indented. Shamelessly stolen from http://effbot.org/zone/element-lib.htm |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sun Feb 5 07:00:22 2023 | http://epydoc.sourceforge.net |