Model of the Model View Controller external link

Contains the classes for the

  • Hierarchy
  • Schemas
class model.schema.Hierarchy

Class: Hierarchy

Goal: Get the whole hierarchy of

  • _schemas contains the actual schemas
  • _hierarchy contains a list of lists to maintain the same order as
  • _property_types contains the input types
  • _version check to see whether a new version of has been published

Public function to obtain one schema

Parameters:thing – string, name of the schema to retrieve

Public function to obtain the hierarchy

Returns:hierarchy- list
class model.schema.SchemaClass(thing, callback=None)

Class: SchemaClass

Goal: Get the properties and property types of a schema

  • _html (can) contain the html of the schema
  • parent contains a list of parents (complete with hierarchy)
  • properties contains the properties and property types
  • name
  • _callback optional callback function for thread-safety (used by the Schema bot)
  • is_alive indicator for the Schema bot

Class method used before dump to reduce the size of the pickle file


Method called by the SchemaClassGenerator after finishing

  • is_alive becomes False
  • the html gets analyzed
  • if there is a callback, it’s called (from Schema bot)
Parameters:s_gen – the SchemaClassGenerator or nothing

Class method to get all parents of one schema used by Schema bot to create the hierarchy

Returns:list of lists

Method called by SchemaView.show_schema_properties


Tries to get Schema from file

Otherwise, tries to get it from Internet

Parameters:b_immediate – Optional, if True will force join() on the Thread
class model.schema.SchemaClassGenerator(thing, generator_callback)

Class: SchemaClassGenerator

Goal: Get the markup of a schema thread-safe. This class can be started concurrently by the Schema bot

  • html from URL after decode("utf-8")
  • name of the schema
  • callback from SchemaClass

Start the thread

Get the schema markup from the Internet

Call the SchemaClass back when done