Exemplo n.º 1
0
    def delete(self, skey):
        Params.del_queueall(skey)
        sinform.sinform_unset(skey, "CONFIGUP")

        msg = {
            "message": "cfg_upd",
            "skey": skey
        }
        self.application.publisher.send(msg)
Exemplo n.º 2
0
    def onget(self):

        cmd = self.get_argument('cmd', '')

        if cmd == "params":
            empty = True
            params = Params.get(self.skey).all()
            for (k, v) in params.iteritems():
                if v.has_key("queue"):
                    self.write("PARAM %s %s\r\n" % (k, v["queue"]))
                    empty = False

            self.write("FINISH\r\n")
            if empty:
                sinform.sinform_unset(self.skey, "CONFIGUP")

        elif cmd == 'cancel':
            Params.del_queueall(self.skey)
            sinform.sinform_unset(self.skey, "CONFIGUP")
            self.write("DELETED\r\n")

            msg = {
                "message": "cfg_upd",
                "skey": self.skey
            }
            self.application.publisher.send(msg)

        elif cmd == 'confirm':
            Params.confirm_queueall(self.skey)
            sinform.sinform_unset(self.skey, "CONFIGUP")
            self.write("CONFIRM")

            msg = {
                "message": "cfg_upd",
                "skey": self.skey
            }
            self.application.publisher.send(msg)

        elif cmd == 'check':
            empty = True
            params = Params.get(self.skey).all()
            for (k, v) in params.iteritems():
                if v.has_key("queue"):
                    empty = False

            if empty:
                sinform.sinform_unset(self.skey, "CONFIGUP")
                self.write('NODATA\r\n')
            else:
                sinform.sinform_set(self.skey, "CONFIGUP")
                self.write("CONFIGUP\r\n")
Exemplo n.º 3
0
    def onget(self):

        cmd = self.get_argument('cmd', '')

        if cmd == "params":
            empty = True
            params = Params.get(self.skey).all()
            for (k, v) in params.iteritems():
                if v.has_key("queue"):
                    self.write("PARAM %s %s\r\n" % (k, v["queue"]))
                    empty = False

            self.write("FINISH\r\n")
            if empty:
                sinform.sinform_unset(self.skey, "CONFIGUP")

        elif cmd == 'cancel':
            Params.del_queueall(self.skey)
            sinform.sinform_unset(self.skey, "CONFIGUP")
            self.write("DELETED\r\n")

            msg = {"message": "cfg_upd", "skey": self.skey}
            self.application.publisher.send(msg)

        elif cmd == 'confirm':
            Params.confirm_queueall(self.skey)
            sinform.sinform_unset(self.skey, "CONFIGUP")
            self.write("CONFIRM")

            msg = {"message": "cfg_upd", "skey": self.skey}
            self.application.publisher.send(msg)

        elif cmd == 'check':
            empty = True
            params = Params.get(self.skey).all()
            for (k, v) in params.iteritems():
                if v.has_key("queue"):
                    empty = False

            if empty:
                sinform.sinform_unset(self.skey, "CONFIGUP")
                self.write('NODATA\r\n')
            else:
                sinform.sinform_set(self.skey, "CONFIGUP")
                self.write("CONFIGUP\r\n")