def ticketEvent(self, event_type, ticket, project, user): if user is None: return stats = user.stats if not stats: stats = UserStats.create(user) if event_type == "assigned": stats.addAssignedTicket(ticket.mod_date, project) elif event_type == "revoked": stats.addRevokedTicket(ticket.mod_date, project) elif event_type == "closed": stats.addClosedTicket(ticket.created_date,ticket.mod_date,project)
def addUserLogin(self, user): stats = user.stats if not stats: stats = UserStats.create(user) stats.addLogin(datetime.utcnow())
def newCommit(self, newcommit, project, user): stats = user.stats if not stats: stats = UserStats.create(user) stats.addCommit(newcommit, datetime.utcnow(), project)
def newUser(self, user): stats = UserStats.create(user)
def modifiedArtifact(self, art_type, art_datetime, project, user): stats = user.stats if not stats: stats = UserStats.create(user) stats.addModifiedArtifact(art_type, art_datetime, project)