Skip to content
Snippets Groups Projects

Draft: ENH: file system: directory

Open Timm Fitschen requested to merge f-filesystem-directory into f-filesystem-core
2 files
+ 33
1
Compare changes
  • Side-by-side
  • Inline

Files

+ 32
0
@@ -2011,6 +2011,37 @@ class Record(Entity):
@@ -2011,6 +2011,37 @@ class Record(Entity):
return Entity.to_xml(self, xml, add_properties=ALL)
return Entity.to_xml(self, xml, add_properties=ALL)
 
class Directory(Record):
 
"""This class represents CaosDB's directory entities."""
 
 
def __init__(self, name=None, id=None, description=None, path=None):
 
Record.__init__(self, id=id, name=name, description=description)
 
self.role = "Directory"
 
self.datatype = None
 
 
# location in the fileserver
 
self.path = path
 
 
def to_xml(self, xml=None, add_properties=ALL, local_serialization=False):
 
"""Convert this Directory to an xml element.
 
 
@return: xml element
 
"""
 
 
if xml is None:
 
xml = etree.Element("Directory")
 
 
return Entity.to_xml(self, xml=xml, add_properties=add_properties,
 
local_serialization=local_serialization)
 
 
def add_property(self, property=None, id=None, name=None, description=None, datatype=None,
 
value=None, unit=None, importance=FIX, inheritance=FIX):
 
 
return super().add_property(
 
property=property, id=id, name=name, description=description, datatype=datatype,
 
value=value, unit=unit, importance=importance, inheritance=inheritance)
 
 
class File(Record):
class File(Record):
"""This class represents LinkAhead's file entities.
"""This class represents LinkAhead's file entities.
@@ -4685,6 +4716,7 @@ def _parse_single_xml_element(elem):
@@ -4685,6 +4716,7 @@ def _parse_single_xml_element(elem):
'recordtype': RecordType,
'recordtype': RecordType,
'property': Property,
'property': Property,
'file': File,
'file': File,
 
'directory': Directory,
'parent': Parent,
'parent': Parent,
'entity': Entity}
'entity': Entity}
Loading