Beispiel #1
0
    def __init__(self, id="++conversation++default"):
        self.id = id

        # username -> count of comments; key is removed when count reaches 0
        self._commentators = OIBTree()

        # id -> comment - find comment by id
        self._comments = LOBTree()

        # id -> LLSet (children) - find all children for a given comment.
        # 0 signifies root.
        self._children = LOBTree()
Beispiel #2
0
    def __init__(self, database):
        self.db = database

        if "users" not in self.db.db_root:
            self.db.db_root["users"] = LOBTree()

        self.users = self.db.db_root["users"]
Beispiel #3
0
 def log_storage(self):
     try:
         return self.context.__log_storage__
     except AttributeError:
         #For speed
         self.context.__log_storage__ = LOBTree()
         return self.context.__log_storage__
Beispiel #4
0
    def __init__(self, database):
        self.db = database

        if "games" not in self.db.db_root:
            self.db.db_root["games"] = LOBTree()

        self.games = self.db.db_root["games"]
        self.user_manager = UserManager(database)
Beispiel #5
0
 def __init__(self, hostname, description='', connection=None):
     self.hostname = hostname
     self.description = description
     self.connection = connection
     self.jobs = LOBTree()
     self.archives = OOBTree()
     self.job_configs = PersistentList()
     data_root().clients[hostname] = self
Beispiel #6
0
 def __init__(self, chunk_size=None, max_chunk_size=None):
     """
     chunk_size (int, None)
         If non-None, aggregate consecutive writes up to this size.
         Overlaping or larger writes may exceed this size, though.
     max_chunk_size (int, None)
         If non-None, prevent chunks from exceeding this size.
     """
     self._tree = LOBTree()
     self.chunk_size = chunk_size
     self.max_chunk_size = max_chunk_size
Beispiel #7
0
 def __init__(self,
              name,
              url,
              description='',
              repository_id='',
              remote_borg='borg'):
     self.name = name
     self.url = url
     self.description = description
     self.repository_id = repository_id
     self.remote_borg = remote_borg
     self.jobs = LOBTree()
     self.archives = OOBTree()
     self.job_configs = PersistentList()
Beispiel #8
0
 def _makeOne(self):
     from BTrees.LOBTree import LOBTree
     return LOBTree()
Beispiel #9
0
 def __init__(self, username, created=None):
     self.data = LOBTree()
     self.username = username  # not inbox owner but other user
     if created is None:
         created = datetime.now(pytz.utc)
     self.created = created
Beispiel #10
0
 def __init__(self, username, created):
     self.data = LOBTree()
     self.username = username
     self.created = created
Beispiel #11
0
 def _rolesdata(self):
     return LOBTree()
 def __init__(self):
     self.data = LOBTree()
Beispiel #13
0
 def initIndexTree(self):
     """
   Initialize the Index Tree
 """
     self._long_index_tree = LOBTree()
Beispiel #14
0
    def _storage(self, create_if_missing=False):
        ann = IAnnotations(self.context)
        if self.ANNOTATION_KEY not in ann.keys() and create_if_missing:
            ann[self.ANNOTATION_KEY] = LOBTree()

        return ann.get(self.ANNOTATION_KEY, None)
Beispiel #15
0
 def numbered_jobs(self):
     self.jobs = NumberTree(self.jobs)
     for state in self.jobs_by_state:
         self.jobs_by_state[state] = LOBTree()
         for id, job in self.jobs.items():
             self.jobs_by_state[state][id] = job
Beispiel #16
0
 def __init__(self):
     self._tree = LOBTree()