def read_properties_core(xml_source):
 properties = DocumentProperties()
 root = fromstring(xml_source)
 creator_node = root.find(QName(NAMESPACES['dc'], 'creator').text)
 if (creator_node is not None):
  properties.creator = creator_node.text
 else:
  properties.creator = ''
 last_modified_by_node = root.find(QName(NAMESPACES['cp'], 'lastModifiedBy').text)
 if (last_modified_by_node is not None):
  properties.last_modified_by = last_modified_by_node.text
 else:
  properties.last_modified_by = ''
 created_node = root.find(QName(NAMESPACES['dcterms'], 'created').text)
 if (created_node is not None):
  properties.created = W3CDTF_to_datetime(created_node.text)
 else:
  properties.created = datetime.datetime.now()
 modified_node = root.find(QName(NAMESPACES['dcterms'], 'modified').text)
 if (modified_node is not None):
  properties.modified = W3CDTF_to_datetime(modified_node.text)
 else:
  properties.modified = properties.created
 return properties

def read_properties_core ( xml_source ) : properties = DocumentProperties ( ) root = fromstring ( xml_source ) creator_node = root . find ( QName ( NAMESPACES [ 'dc' ] , 'creator' ) . text ) if ( creator_node is not None ) : properties . creator = creator_node . text else : properties . creator = '' last_modified_by_node = root . find ( QName ( NAMESPACES [ 'cp' ] , 'lastModifiedBy' ) . text ) if ( last_modified_by_node is not None ) : properties . last_modified_by = last_modified_by_node . text else : properties . last_modified_by = '' created_node = root . find ( QName ( NAMESPACES [ 'dcterms' ] , 'created' ) . text ) if ( created_node is not None ) : properties . created = W3CDTF_to_datetime ( created_node . text ) else : properties . created = datetime . datetime . now ( ) modified_node = root . find ( QName ( NAMESPACES [ 'dcterms' ] , 'modified' ) . text ) if ( modified_node is not None ) : properties . modified = W3CDTF_to_datetime ( modified_node . text ) else : properties . modified = properties . created return properties
read assorted file properties .