Exemple #1
0
 def __init__(self,
              inst,
              tag,
              storage=None,
              keyspace=None,
              fqn="mg.core.applications.Application"):
     """
     inst - Instance object
     tag - Application tag
     """
     Loggable.__init__(self, fqn)
     if storage is None:
         if tag == "int" or tag == "main":
             storage = 1
         else:
             storage = 0
     self.storage = storage
     self.inst = inst
     self.tag = tag
     self.keyspace = keyspace
     self.hooks = Hooks(self)
     self.config = Config(self)
     self.modules = Modules(self)
     self.config_lock = Lock()
     self.hook_lock = Lock()
     self.dynamic = False
     self.protocol = "http"
Exemple #2
0
 def __init__(self, dispatcher, devname):
     "Constructor. devname - serial port devname"
     self.dispatcher = dispatcher
     self.stream = SerialStream(devname)
     self._next_pkt_id = 0
     self._devname = devname
     self._sendlock = Lock()
     self._calibrated = False
     Tasklet.new(self.auto_calibrate_baudrate)()
Exemple #3
0
 def __init__(self, app):
     self.app = weakref.ref(app)
     self.modules_lock = Lock()
     self.loaded_modules = dict()
     self.not_auto_loaded = set()
     self.modules_locked_by = None