class Cell(dexml.Model): x = fields.Float() x_random = fields.Float() y_random = fields.Float() width = fields.Float() height = fields.Integer() #n_words = fields.Integer() probability = fields.Float() type_text = fields.Integer() type_font = fields.Integer()
class Line(dexml.Model): #id = fields.Integer(attrname="id") height = fields.Integer() text_min_height_prob = fields.Float() y_space_step = fields.Integer() cells = fields.List(Cell) type = fields.String() probability = fields.Float() repeat = fields.Integer()
class Object(dexml.Model): command = fields.String() left = fields.Integer() top = fields.Integer() right = fields.Integer() bottom = fields.Integer() fill = fields.String() probability = fields.Float()
class TextAndSeparatorLine(dexml.Model): composite_line = fields.List(Line) repeat_lines = fields.Integer() def __init__(self, repeat_lines=None): self.lines = [] self.repeat_lines = repeat_lines
class junk(dexml.Model): class meta: order_sensitive = True name = fields.String(tagname=True) notes = fields.List(fields.String(tagname="note")) amount = fields.Integer(tagname=True)
class Frame(dexml.Model): """Store information about a frame to process: index in original stream, filename of extracted version, etc.""" class meta: tagname = "frame" index = fields.Integer(required=False) time = fields.Float(required=False) filename = fields.String() # can be relative to root given to a tool on command line
class nsc_decl(dexml.Model): class meta: tagname = "nsc" namespace = "test:" namespace_prefix = "t" f1 = fields.Integer(tagname=("test:", "f1"))
class FrameSegResult(dexml.Model): """Tracker output for a given frame. Only 1 object can be detected for now.""" class meta: tagname = "frame" index = fields.Integer(required=False) rejected = fields.Boolean() points = fields.Dict(Pt, key='name', unique=True)
class Document(dexml.Model): id = fields.String(attrname='id') rotate = fields.Integer() max_append_records = fields.Integer() probability = fields.Float() height = fields.Integer() width = fields.Integer() corpus_top = fields.Integer() corpus_left = fields.Integer() corpus_width = fields.Integer() corpus_min_height = fields.Integer() corpus_max_height = fields.Integer() #record_type = fields.String() header = fields.List(GroupTextLine, tagname='header') record = fields.List(GroupTextLine, tagname='record') background = fields.List(Object, tagname='background')
class Update(dexml.Model): class meta: tagname = "update" order_sensitive = False version = fields.Integer() targetVersion = fields.String(tagname="targetVersion") platform = fields.String(tagname="platform") dependencies = fields.List(fields.String(tagname="file"), tagname="dependencies") pathprefix = fields.String(tagname="pathprefix", required=False) install = fields.List(FileElement, tagname="install", required=False) patches = fields.List(PatchElement, tagname="patches", required=False) manifest = fields.List(FileElement, tagname="manifest") packages = fields.List(PackageElement, tagname="packages") def get_filemap(self): return {a.name: a for a in self.manifest}
class Waypoint(dexml.Model): class meta: tagname = 'Waypoints' name = fields.String(tagname="Name") latitude = fields.Float(tagname='Latitude') # radians longitude = fields.Float(tagname='Longitude') # radians track_limit = fields.Float(tagname='TrackLimit', default=0) course_limit = fields.Float(tagname='CourseLimit', default=0) economy = fields.Float(tagname='Economy', default=0) max_speed = fields.Float(tagname='MaximalSpeed', default=0) controller_type = fields.String(tagname='ControllerType', default='') notes = fields.String(tagname="Notes", default='') is_parameter_point = fields.Boolean(tagname="IsParameterPoint", default=False) is_arrival_point = fields.Boolean(tagname="IsArrivalPoint", default=False) # 0 great circle, 1 rhumb # latter sailmode corresponds to leg's sailmode sail_mode = fields.Integer(tagname="SailMode") radius = fields.Float(tagname='Radius') # meters
class sr(dexml.Model): rlsid = fields.String() team = fields.String(tagname='team') fmt = fields.String(tagname='fmt') hits = fields.Integer(tagname='hits') duration_string = fields.String(tagname='duration') dur = None def get_duration(self): if self.dur is None: try: timet1 = datetime.strptime(self.duration_string, "%H:%M:%S") except ValueError: timet1 = datetime.strptime(self.duration_string, "%M:%S") delta1 = timedelta(hours=timet1.time().hour, minutes=timet1.time().minute, seconds=timet1.time().second) self.dur = delta1.total_seconds() * 1000 return self.dur duration = property(get_duration)
class bacon(dexml.Model): num_rashers = fields.Integer()
class SaneChoice(dexml.Model): item = fields.Choice(fields.String(),fields.Integer())
class person(dexml.Model): name = fields.String() age = fields.Integer()
class person(petbase): name = fields.String() age = fields.Integer() status = fields.String(tagname=("S:","status"),required=False)
class hello(dexml.Model): recipient = fields.String() sentby = fields.String(attrname="sender") strength = fields.Integer(default=1) message = fields.String(tagname="msg")
class course(dexml.Model): #nazov = fields.String() nazov = fields.String(tagname="name") priorita = fields.Integer(tagname="priority") termin = fields.Integer(tagname="date")
class Dictonary(dexml.Model): path = fields.String() number_words = fields.Integer()
class nsa(dexml.Model): f1 = fields.Integer(attrname=("test:","f1"))
class folder_info(dexml.Model): id = fields.String(tagname="id") name = fields.String(tagname="name") total_files = fields.Integer(tagname='total_files') total_folders = fields.Integer(tagname='total_folders')
class nsc(dexml.Model): f1 = fields.Integer(tagname=("test:","f1"))
class Person(dexml.Model): name = fields.String() age = fields.Integer(tagname='age')
class record(dexml.Model): name = fields.String() interval = fields.Float(tagname="interval") row_index = fields.Integer(tagname="row_index") col_index = fields.Integer(tagname="col_index")
class TextLine(dexml.Model): text_line = fields.Integer() separator_line = fields.Integer() number_lines = fields.Integer()