fcsxml.FCSXMLObject

class fcsxml.FCSXMLObject(entityID=0, entityType='asset')[source]

FCSXMLObject represents a Final Cut Server entity which uses Final Cut Server Read XML and Write XML watcher+response systems for RPC. This object can only perform a small subset of the tasks that fcsxml.FCSVRClient can perform.

Parameters:
  • entityID (int) – Provide the entity id
  • entityType (str) – Provide entity type, usually ‘asset’ or ‘project’ [default ‘asset’]
appendField(field)[source]

This method will add a new FCSXMLField to the objects field definition list. This function will raise an FCSDuplicate exception if a field object with same name already exists.

Parameters:field (fcsxml.FCSXMLField) – Provide an FCSXMLField object loaded with field name and value
Returns:(bool) True or False
Raises :fcsxml.FCSDuplicateError, RuntimeError
appendValueForField(fieldName, value, useTimestamp=False)

Appends a value to field, concatenating with the current field value.

Parameters:
  • fieldName (str) – Provide the field name
  • value (id) – Provide the value to append.
  • useTimeStamp (bool) – If set to true, we will prepend a timestamp to the data to be appended.
Raises :

fcsxml.FCSFieldNotFoundError

dataTypeForField(fieldName)[source]

This method returns the datatype for the passed field name.

Parameters:fieldName (str) – Provide the name of the field to query.
Raises :fcsxml.FCSFieldNotFoundError
Returns:(str) Datatype for the specified field
fieldWithName(fieldName)[source]

This method returns the fcsxml.FCSXMLField object for the passed field name.

Parameters:fieldName (str) – Provide the name of the field to query.
Raises :fcsxml.FCSFieldNotFoundError
Returns:(fcsxml.FCSXMLField) – The stored field object for the specified field
getXMLNodeText(nodes)[source]

This function accepts a list of xml.dom.minidom nodes and will return a collated text string comprised of each nodes value.

Parameters:nodes (list) –
Returns:(str) – Concatenated string of all passed nodes’ text values.
loadFromFCSVRClient(fcsvrClient)[source]

This function will load our object based upon values stored in the provided FCSVRClient object, this is limited to entityID, entityType and defined fields.

Parameters:fcsvrClient (fcsxml.FCSVRClient) – Provide a loaded FCSVRClient object
Raises :FCSObjectLoadError
loadFromFile(filePath)[source]

This function will load the object based upon values present in the XML file found at the provided filepath.

Parameters:filePath (str) – The path to the XML file to load.
Returns:(bool) True or False
loadXML(xml='')[source]

Method which loads our object based upon our stored xml.dom.minidom object, which is loaded by fcsxml.FCSXMLObject.loadFromFile() or :func: fcsxml.FCSXMLObject.loadXMLFromString

Parameters:xml (xml.dom.minidom) – Provide an XML dom.minidom object for which to load from.
Raises :FCSObjectLoadError
Returns:(bool) True
loadXMLFromString(xmlString='')[source]

This method allows our object to load based on the provided XML string. This method utilizes fcsxml.FCSXMLObject.loadXML() to initiate the object.

Parameters:xmlString (str) – Provide a string of XML data.
Raises :See mindom.parseString()
removeFieldWithName(fieldName)[source]

Remove FCSXMLField object registered with passed field name.

Parameters:fieldName (str or fcsxml.FCSXMLField) – Provide the field name (or an FCSXMLField object) to be removed from the current object’s field list.
Raises :fcsxml.FCSFieldNotFoundError, RuntimeError
setField(field)[source]

This method register’s the provided FCSXMLField object, replacing existing field object with same name if it should exist.

Parameters:field (fcsxml.FCSXMLField) – Provide an FCSXMLField object loaded with field name and value
Returns:(bool) True or False
setFile(filePath)[source]

Historical method, use loadFromFile()

valueForField(fieldName)[source]

This method returns the stored value for the passed database field name. (i.e. “My Field”)

param fieldName:
 Provide the name of the field to query.
type fieldName:str
raises:fcsxml.FCSFieldNotFoundError
returns:(str) Value for the specified field
xmlOut(filePath='')[source]

Write our XML out to a file at the provided path. The output format will be a Final Cut Server ReadXML compatable file.

Parameters:filePath (str) – Provide the (absolute) destination path for XML output
Raises :IOError
Returns:(bool) - True or False

Previous topic

fcsxml.FCSXMLField

Next topic

fcsxml.FCSVRClient

This Page