Ejemplo n.º 1
0
    def onTaskCreation(self, task):
        # logger.info("  -- on task creation: %s" % task)

        if task.id is None:
            self.taskMaxId += 1
            task.id = self.taskMaxId
            self.toCreateElements.append(task)
        else:
            self.taskMaxId = max(self.taskMaxId, task.id, StatDB.getTasksMaxId(), StatDB.getTaskGroupsMaxId())
        self.tasks[task.id] = task
Ejemplo n.º 2
0
 def onNodeCreation(self, node):
     # logger.info("  -- on node creation: %s" % node)
     if node.id is None:
         self.nodeMaxId += 1
         node.id = self.nodeMaxId
         self.toCreateElements.append(node)
     else:
         self.nodeMaxId = max(self.nodeMaxId, node.id,
                              StatDB.getFolderNodesMaxId(),
                              StatDB.getTaskNodesMaxId())
     if node.parent is None:
         node.parent = self.root
Ejemplo n.º 3
0
    def onTaskCreation(self, task):
        # logger.info("  -- on task creation: %s" % task)

        if task.id is None:
            self.taskMaxId += 1
            task.id = self.taskMaxId
            self.toCreateElements.append(task)
        else:
            self.taskMaxId = max(self.taskMaxId, task.id,
                                 StatDB.getTasksMaxId(),
                                 StatDB.getTaskGroupsMaxId())
        self.tasks[task.id] = task
Ejemplo n.º 4
0
 def onPoolShareCreation(self, poolShare):
     if poolShare.id is None:
         self.poolShareMaxId += 1
         poolShare.id = self.poolShareMaxId
         self.toCreateElements.append(poolShare)
     else:
         self.poolShareMaxId = max(self.poolShareMaxId, poolShare.id, StatDB.getPoolSharesMaxId())
     self.poolShares[poolShare.id] = poolShare
Ejemplo n.º 5
0
 def onCommandCreation(self, command):
     if command.id is None:
         self.commandMaxId += 1
         command.id = self.commandMaxId
         self.toCreateElements.append(command)
     else:
         self.commandMaxId = max(self.commandMaxId, command.id, StatDB.getCommandsMaxId())
     self.commands[command.id] = command
Ejemplo n.º 6
0
 def onPoolCreation(self, pool):
     if pool.id is None:
         self.poolMaxId += 1
         pool.id = self.poolMaxId
         self.toCreateElements.append(pool)
     else:
         self.poolMaxId = max(self.poolMaxId, pool.id, StatDB.getPoolsMaxId())
     self.pools[pool.name] = pool
Ejemplo n.º 7
0
 def onRenderNodeCreation(self, renderNode):
     if renderNode.id is None:
         self.renderNodeMaxId += 1
         renderNode.id = self.renderNodeMaxId
         self.toCreateElements.append(renderNode)
     else:
         self.renderNodeMaxId = max(self.renderNodeMaxId, renderNode.id, StatDB.getRenderNodesMaxId())
     self.renderNodes[renderNode.name] = renderNode
Ejemplo n.º 8
0
 def onPoolShareCreation(self, poolShare):
     if poolShare.id is None:
         self.poolShareMaxId += 1
         poolShare.id = self.poolShareMaxId
         self.toCreateElements.append(poolShare)
     else:
         self.poolShareMaxId = max(self.poolShareMaxId, poolShare.id,
                                   StatDB.getPoolSharesMaxId())
     self.poolShares[poolShare.id] = poolShare
Ejemplo n.º 9
0
 def onCommandCreation(self, command):
     if command.id is None:
         self.commandMaxId += 1
         command.id = self.commandMaxId
         self.toCreateElements.append(command)
     else:
         self.commandMaxId = max(self.commandMaxId, command.id,
                                 StatDB.getCommandsMaxId())
     self.commands[command.id] = command
Ejemplo n.º 10
0
 def onPoolCreation(self, pool):
     if pool.id is None:
         self.poolMaxId += 1
         pool.id = self.poolMaxId
         self.toCreateElements.append(pool)
     else:
         self.poolMaxId = max(self.poolMaxId, pool.id,
                              StatDB.getPoolsMaxId())
     self.pools[pool.name] = pool
Ejemplo n.º 11
0
 def onRenderNodeCreation(self, renderNode):
     if renderNode.id is None:
         self.renderNodeMaxId += 1
         renderNode.id = self.renderNodeMaxId
         self.toCreateElements.append(renderNode)
     else:
         self.renderNodeMaxId = max(self.renderNodeMaxId, renderNode.id,
                                    StatDB.getRenderNodesMaxId())
     self.renderNodes[renderNode.name] = renderNode
Ejemplo n.º 12
0
 def onNodeCreation(self, node):
     # logger.info("  -- on node creation: %s" % node)
     if node.id is None:
         self.nodeMaxId += 1
         node.id = self.nodeMaxId
         self.toCreateElements.append(node)
     else:
         self.nodeMaxId = max(self.nodeMaxId, node.id, StatDB.getFolderNodesMaxId(), StatDB.getTaskNodesMaxId())
     if node.parent is None:
         node.parent = self.root
Ejemplo n.º 13
0
 def recomputeMaxIds(self):
     self.nodeMaxId = max([n.id for n in self.nodes.values()]) if self.nodes else 0
     self.nodeMaxId = max(self.nodeMaxId, StatDB.getFolderNodesMaxId(), StatDB.getTaskNodesMaxId())
     self.poolMaxId = max([p.id for p in self.pools.values()]) if self.pools else 0
     self.poolMaxId = max(self.poolMaxId, StatDB.getPoolsMaxId())
     self.renderNodeMaxId = max([rn.id for rn in self.renderNodes.values()]) if self.renderNodes else 0
     self.renderNodeMaxId = max(self.renderNodeMaxId, StatDB.getRenderNodesMaxId())
     self.taskMaxId = max([t.id for t in self.tasks.values()]) if self.tasks else 0
     self.taskMaxId = max(self.taskMaxId, StatDB.getTasksMaxId(), StatDB.getTaskGroupsMaxId())
     self.commandMaxId = max([c.id for c in self.commands.values()]) if self.commands else 0
     self.commandMaxId = max(self.commandMaxId, StatDB.getCommandsMaxId())
     self.poolShareMaxId = max([ps.id for ps in self.poolShares.values()]) if self.poolShares else 0
     self.poolShareMaxId = max(self.poolShareMaxId, StatDB.getPoolSharesMaxId())
Ejemplo n.º 14
0
 def recomputeMaxIds(self):
     self.nodeMaxId = max([n.id for n in self.nodes.values()
                           ]) if self.nodes else 0
     self.nodeMaxId = max(self.nodeMaxId, StatDB.getFolderNodesMaxId(),
                          StatDB.getTaskNodesMaxId())
     self.poolMaxId = max([p.id for p in self.pools.values()
                           ]) if self.pools else 0
     self.poolMaxId = max(self.poolMaxId, StatDB.getPoolsMaxId())
     self.renderNodeMaxId = max([rn.id for rn in self.renderNodes.values()
                                 ]) if self.renderNodes else 0
     self.renderNodeMaxId = max(self.renderNodeMaxId,
                                StatDB.getRenderNodesMaxId())
     self.taskMaxId = max([t.id for t in self.tasks.values()
                           ]) if self.tasks else 0
     self.taskMaxId = max(self.taskMaxId, StatDB.getTasksMaxId(),
                          StatDB.getTaskGroupsMaxId())
     self.commandMaxId = max([c.id for c in self.commands.values()
                              ]) if self.commands else 0
     self.commandMaxId = max(self.commandMaxId, StatDB.getCommandsMaxId())
     self.poolShareMaxId = max([ps.id for ps in self.poolShares.values()
                                ]) if self.poolShares else 0
     self.poolShareMaxId = max(self.poolShareMaxId,
                               StatDB.getPoolSharesMaxId())