Exemplo n.º 1
0
    def post_create(self):
        base.Base.post_create(self)

        pusher = quorum.get_pusher()
        pusher.trigger("global", "conversation.new", {
            "contents" : self.get_event()
        })
Exemplo n.º 2
0
    def tick(self):
        api = self.get_api()
        config = models.GithubConfig.singleton()

        activity = self.activity(api, config)
        contrib = self.contrib(api, config)
        issues = self.issues(api, config)

        commits_total = self.commits_total(api, activity)
        commits_data = self.commits_data(api, activity)
        issues_users = self.issues_users(api, issues)
        commits_users = self.commits_users(api, contrib)

        _github = models.Github.get(raise_e = False)
        if not _github: _github = models.Github()
        _github.commits_total = commits_total
        _github.commits_data = commits_data
        _github.issues_users = issues_users
        _github.commits_users = commits_users
        _github.save()

        pusher = quorum.get_pusher()
        pusher.trigger("global", "github.commits_total", {
            "commits_total" : commits_total
        })
        pusher.trigger("global", "github.commits_data", {
            "commits_data" : commits_data
        })
        pusher.trigger("global", "github.issues_users", {
            "issues_users" : issues_users
        })
        pusher.trigger("global", "github.commits_users", {
            "commits_users" : commits_users
        })
Exemplo n.º 3
0
    def tick(self):
        pendings = self.get_pendings()
        if not pendings: return

        pusher = quorum.get_pusher()
        pusher.trigger("global", "pending.update", {
            "pendings" : pendings
        })
Exemplo n.º 4
0
    def post_create(self):
        base.Base.post_create(self)

        from . import conversation
        conversation.Conversation.try_create(self)

        pusher = quorum.get_pusher()
        pusher.trigger("global", "mail.new", {
            "contents" : self.get_event()
        })
Exemplo n.º 5
0
    def tick(self):
        api = self.get_api()

        self.register_callback(api)
        sales_total = self.sales_total(api)
        sales_data = self.sales_data(api)
        sales_stores = self.sales_stores(api)
        entries_stores = self.entries_stores(api)
        top_stores = self.top_stores(api)
        top_employees = self.top_employees(api)

        _omni = models.Omni.get(raise_e = False)
        if not _omni: _omni = models.Omni()
        _omni.sales_total = sales_total
        _omni.sales_data = sales_data
        _omni.sales_stores = sales_stores
        _omni.entries_stores = entries_stores
        _omni.top_stores = top_stores
        _omni.top_employees = top_employees
        _omni.save()

        pusher = quorum.get_pusher()
        pusher.trigger("global", "omni.sales_total", {
            "sales_total" : sales_total
        })
        pusher.trigger("global", "omni.sales_data", {
            "sales_data" : sales_data
        })
        pusher.trigger("global", "omni.sales_stores", {
            "sales_stores" : sales_stores
        })
        pusher.trigger("global", "omni.entries_stores", {
            "entries_stores" : entries_stores
        })
        pusher.trigger("global", "omni.top_stores", {
            "top_stores" : top_stores
        })
        pusher.trigger("global", "omni.top_employees", {
            "top_employees" : top_employees
        })