def status(self):
        docs = {'updated'  : [],
                'committed': [],
                'to_commit': []}

        row = self.db.internal.find_one({'_id': 'last_sync'})

        if row and 'update' in row:
            for id in row['update']:
                docs['updated'].append(self.get(id, deleted=True))

        if row and 'commit' in row:
            for id in row['commit']:
                docs['committed'].append(self.get(id, deleted=True))

        to_commit =  self.get_docs_to_commit()
        for row in to_commit:
            doc = Document(**row)
            docs['to_commit'].append(doc)
        return docs
def __init__(self, host, key, port=443, max_size=4096):

        # Params for all class
        self.host = host
        self.port = port
        self.max_size = max_size - 60
        self.AESDriver = AESCipher(key=key)
        self.serv_addr = (host, port)

        # Class Globals
        self.max_packets = 255 # Limitation by QUIC itself.
        self._genSeq()   # QUIC Sequence is used to know that this is the same sequence,
                          # and it's a 20 byte long that is kept the same through out the
                          # session and is transfered hex encoded.
        self.delay = 0.1

        self.sock = None
        if self._createSocket() is 1:               # Creating a UDP socket object
            sys.exit(1)
        self.serv_addr = (self.host, self.port)     # Creating socket addr format