def registerModel(self, model): 
   if model in self.__models.values():
     utils.logger.error("The model "+str(model)+" is allready register")
     return
   modelID = utils.nextID()
   model.setID(modelID)
   self.__models[modelID] = model
   utils.logger.debug("Registered the model " + str(model) + " with id "+str(modelID))
Esempio n. 2
0
 def registerModel(self, model):
     if model in self.__models.values():
         utils.logger.error("The model " + str(model) +
                            " is allready register")
         return
     modelID = utils.nextID()
     model.setID(modelID)
     self.__models[modelID] = model
     utils.logger.debug("Registered the model " + str(model) + " with id " +
                        str(modelID))
 def setup(self): 
   utils.logger.debug("Conect client "+str(self.client_address))
   self.__sessionID = utils.nextID()
   self.fragmentCommand = {}
   self.__commandsQueue = Queue.Queue()
   self.__asyncCommandQueue = Queue.Queue()
   thread.start_new(self.__sendCommandQueue, ())
   self.__sendInitialData()
   dMVC.getRServer().registerHandler(self)
   handler = dMVC.getRServer()._onConnection
   if handler:
     handler(self)
Esempio n. 4
0
 def setup(self):
     utils.logger.debug("Conect client " + str(self.client_address))
     self.__sessionID = utils.nextID()
     self.fragmentCommand = {}
     self.__commandsQueue = Queue.Queue()
     self.__asyncCommandQueue = Queue.Queue()
     thread.start_new(self.__sendCommandQueue, ())
     self.__sendInitialData()
     dMVC.getRServer().registerHandler(self)
     handler = dMVC.getRServer()._onConnection
     if handler:
         handler(self)
Esempio n. 5
0
 def sendAsyncCommand(self, command, callback):
   serializedCommand = pickle.dumps(command)
   sizeCommand = len(serializedCommand)
   total = sizeCommand / 10000 
   if not sizeCommand % 10000 == 0:
     total += 1
   lenProcess = 0
   sequence = 0
   asyncCommandID = utils.nextID()
   self.__asyncCallback[asyncCommandID] = callback
   while lenProcess < sizeCommand:
     sequence += 1
     fragmentCommand = serializedCommand[lenProcess : lenProcess + 10000]
     fragment = remotecommand.RFragment(asyncCommandID, sequence, total, fragmentCommand)
     print "Apilando ",fragment," ",sequence,"/",total
     self.__asyncCommandQueue.put(fragment)
     lenProcess += 10000
 def __sendAsyncObject(self, obj, commandID): 
   toSerialize = dMVC.objectToSerialize(obj, dMVC.getRServer())
   serialized = pickle.dumps(toSerialize)
   sizeSerialized = len(serialized)
   total = sizeSerialized / 10000
   if not sizeSerialized % 10000 == 0:
     total += 1
   lenProcess = 0
   sequence = 0
   asyncCommandID = utils.nextID()
   while lenProcess < sizeSerialized:
     sequence += 1
     fragmentCommand = serialized[lenProcess : lenProcess + 10000]
     fragment = remotecommand.RFragment(asyncCommandID, sequence, total, fragmentCommand, commandID)
     self.__asyncCommandQueue.put(fragment)
     lenProcess += 10000
   print "Ya tenemos todos los fragmentos puestos en la cola"
Esempio n. 7
0
 def __sendAsyncObject(self, obj, commandID):
     toSerialize = dMVC.objectToSerialize(obj, dMVC.getRServer())
     serialized = pickle.dumps(toSerialize)
     sizeSerialized = len(serialized)
     total = sizeSerialized / 10000
     if not sizeSerialized % 10000 == 0:
         total += 1
     lenProcess = 0
     sequence = 0
     asyncCommandID = utils.nextID()
     while lenProcess < sizeSerialized:
         sequence += 1
         fragmentCommand = serialized[lenProcess:lenProcess + 10000]
         fragment = remotecommand.RFragment(asyncCommandID, sequence, total,
                                            fragmentCommand, commandID)
         self.__asyncCommandQueue.put(fragment)
         lenProcess += 10000
     print "Ya tenemos todos los fragmentos puestos en la cola"
Esempio n. 8
0
 def __init__(self, modelID, methodName, args): 
   RCommand.__init__(self)
   self._executionID = utils.nextID() 
   self._modelID    = modelID
   self._methodName = methodName
   self._args       = args
Esempio n. 9
0
 def registerRemoteSuscription(self, suscription): 
   utils.logger.debug("RClient.registerRemoteSuscription suscription: "+str(suscription))
   suscriptionID = utils.nextID()
   self.__remoteSuscriptions[suscriptionID] = suscription
   return suscriptionID