def __init__(self, rpc):
     BaseHandler.__init__(self, rpc)
     self.conn = rpc.conn
     self.cur = self.conn.cursor()
     #TODO hay que arreglar el curname, sino fallara!
     self.scur = self.conn.cursor(self.curname,
                                  cursor_factory=psycopg2.extras.DictCursor)
Beispiel #2
0
 def __init__(self, rpc, prjmanager):
     BaseHandler.__init__(self,rpc)
     self.pm = prjmanager
     cursornumber = self.globaldata['cursornumber']
     self.globaldata['cursornumber'] += 1
     self.curname = "rpccursor_%04x" % cursornumber
     self.cur = self.pm.conn.cursor()
     self.rlock = threading.RLock()
 def __init__(self, rpc):
     BaseHandler.__init__(self,rpc)
     self.hashlist = []
     self.index = {}
     self.index_maxdepth = 2
     self.b64tr1 = "+/0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
     self.b64tr2 = {}
     for n,c in enumerate(list(self.b64tr1)):
         self.b64tr2[c] = n/8
 def _shutdown(self):
     """ función que se llama automáticamente cuando un cliente se desconecta.
         Se envía un mensaje y se limpian algunos listados.
     """
     self._post(u" -*- User '%s' has quit -*- " % self._username)
     self._clients.remove(self)
     if self._username:
         self._usernames.remove(self._username)
         self._update()
     BaseHandler._shutdown(self) # hay que recordar llamar a la función superior
 def _shutdown(self):
     """ función que se llama automáticamente cuando un cliente se desconecta.
         Se envía un mensaje y se limpian algunos listados.
     """
     self._post(u" -*- User '%s' has quit -*- " % self._username)
     self._clients.remove(self)
     if self._username:
         self._usernames.remove(self._username)
         self._update()
     BaseHandler._shutdown(
         self)  # hay que recordar llamar a la función superior
Beispiel #6
0
    def __init__(self, connection, config, database, sessions, prefixes):
        BaseHandler.__init__(self, connection)

        self.crypt = crypto.TBCrypt()
        self.database = database
        self.sessions = sessions
        self.prefixes = prefixes
        self.config = config
        self.thread = None
        if (config.ipc.db_key):
            self.db_key = base64.b64decode(config.ipc.db_key)
        else:
            self.db_key = None
    def __init__(self, connection, config, database, sessions, prefixes):
        BaseHandler.__init__(self,connection)

        self.crypt    = crypto.TBCrypt()
        self.database = database
        self.sessions = sessions
        self.prefixes = prefixes
        self.config   = config
        self.thread   = None
        if (config.ipc.db_key):
          self.db_key = base64.b64decode(config.ipc.db_key)
        else:
          self.db_key = None
 def __init__(self, rpc, prj, user, conn):
     BaseHandler.__init__(self,rpc)
     self.data = prj
     self.path = prj.path
     self.user = user
     self.conn = conn
     self.rpc = rpc
     self.cachehashsize = 4
     self.cachehashoffset = 0
     self.filelist = {}
     #self.filehash = {}
     #self.filecache = {}
     #self.treecache = {}
     self.b64list = HashTable(self.rpc)
     self.is_loaded = False
     self.load_thread = threading.Thread(target=self._load)
     self.load_thread.start()
     self.cursors = []
Beispiel #9
0
 def __init__(self, connection, *args, **kwargs):
     BaseHandler.__init__(self, connection)
     print args
     print kwargs
Beispiel #10
0
 def __init__(self, connection, *args, **kwargs):
     BaseHandler.__init__(self,connection)
     print(args)
     print(kwargs)
 def __init__(self, rpc):
     BaseHandler.__init__(self,rpc)
 def __init__(self, rpc):
     BaseHandler.__init__(self, rpc)
Beispiel #13
0
 def close(self):
     "Closes the cursor."
     self.cur.close()
     self.pm.cursors.remove(self)
     self.cur = None
     BaseHandler.close(self)
 def __init__(self, rpc):
     BaseHandler.__init__(self, rpc)
     self.conn = rpc.conn
     self.cur = self.conn.cursor()
     # TODO hay que arreglar el curname, sino fallara!
     self.scur = self.conn.cursor(self.curname, cursor_factory=psycopg2.extras.DictCursor)