}
+class ParseObject(object):
+ """ Parent class for all objects the parser can return """
+ pass
-class Formula(object):
+class Formula(ParseObject):
def __init__(self, formula, value):
self.formula = formula
self.value = value
-class Variables(object):
+class Variables(ParseObject):
"""
Contains system numeric variables (e.g., K0) and user numeric and string variables.
"""
len(self.uservar)+len(self.userstr),
len(self.depvar)+len(self.depstr))
-class History(object):
+class History(ParseObject):
"""
Contains the experiment's history as plain text.
"""
def format(self, indent=0):
return " "*indent+"<History>"
-class Wave(object):
+class Wave(ParseObject):
"""
Contains the data for a wave
"""
type,size = "data", "x".join(str(d) for d in self.data.shape)
return " "*indent+"%s %s (%s)"%(self.name, type, size)
-class Recreation(object):
+class Recreation(ParseObject):
"""
Contains the experiment's recreation procedures as plain text.
"""
def __init__(self, data, order): self.data = data
def format(self, indent=0):
return " "*indent + "<Recreation>"
-class Procedure(object):
+class Procedure(ParseObject):
"""
Contains the experiment's main procedure window text as plain text.
"""
def __init__(self, data, order): self.data = data
def format(self, indent=0):
return " "*indent + "<Procedure>"
-class GetHistory(object):
+class GetHistory(ParseObject):
"""
Not a real record but rather, a message to go back and read the history text.
def __init__(self, data, order): self.data = data
def format(self, indent=0):
return " "*indent + "<GetHistory>"
-class PackedFile(object):
+class PackedFile(ParseObject):
"""
Contains the data for a procedure file or notebook in packed form.
"""
def __init__(self, data, order): self.data = data
def format(self, indent=0):
return " "*indent + "<PackedFile>"
-class Unknown(object):
+class Unknown(ParseObject):
"""
Record type not documented in PTN003/TN003.
"""
def format(self, indent=0):
return " "*indent + "<Unknown type %s>"%self.type
-class _FolderStart(object):
+class _FolderStart(ParseObject):
"""
Marks the start of a new data folder.
"""
def __init__(self, data, order):
self.name = data[:data.find(chr(0))]
-class _FolderEnd(object):
+class _FolderEnd(ParseObject):
"""
Marks the end of a data folder.
"""