Beispiel #1
0
    def __init__(self, insert_list):
        self.topic = insert_list["topic"]
        self.delonproc = bool(insert_list["delonproc"])
        self.deloncas = bool(insert_list["deloncas"])
        self.instantp = bool(insert_list["instantp"])

        #FOR nullable=True, use a the checkNull method
        self.description = r.checkNull(insert_list, "description")
        self.stordur = r.checkNull(insert_list, "stordur")
        self.onrecv = r.checkNull(insert_list, "onrecv")
Beispiel #2
0
 def __init__(self, insert_list):
     '''requirements in insert_list
     @param tlink - link to the mqtt sub record
     @param topic - the topic string (incase linking failed)
     @param msg - the msg content'''
     from pkg.msgapi.mqtt.models import MQTT_Sub
     from pkg.system.servlog import srvlog
     import datetime
     from datetime import timedelta
     # find links
     self.tlink = r.checkNull(insert_list, "tlink")
     self.topic = insert_list["topic"]
     self.msg = insert_list["msg"]
     self.timev0 = datetime.datetime.now()
     self.pflag0 = insert_list["pflag0"]
     self.pflag1 = insert_list["pflag1"]
     submaster = MQTT_Sub.query.filter(MQTT_Sub.id == self.tlink).first()
     if (submaster is not None):
         if (submaster.stordur is None):
             self.timed0 = None  #store forever
         else:
             self.timed0 = self.timev0 + timedelta(
                 seconds=submaster.stordur)
         self.delonproc = submaster.delonproc  #inherits from the topic master
     else:
         srvlog["oper"].warning(
             "MQTT message added to unknown link topic:" + self.topic +
             " id=" + int(self.tlink))
         self.timed0 = r.lim.DEF_MQTT_MSGST_DURA
         self.delonproc = True
Beispiel #3
0
    def __init__(self, insert_list):
        self.long = insert_list["long"]
        self.lati = insert_list["lati"]
        self.time = insert_list["time"]

        #FOR nullable=True, use a the checkNull method
        self.route_id = r.checkNull(insert_list, "route_id")
Beispiel #4
0
    def __init__(self, insert_list):

        self.timev0 = datetime.datetime.now()
        self.timev1 = r.checkNull(insert_list, "timev1")
        self.timev1 = r.checkNull(insert_list, "timev2")

        self.param0 = insert_list["param0"]
        self.param1 = r.checkNull(insert_list, "param1")
        self.param2 = r.checkNull(insert_list, "param2")

        self.ref0 = insert_list["ref0"]
        self.ref1 = r.checkNull(insert_list, "ref1")
        self.ref2 = r.checkNull(insert_list, "ref2")
Beispiel #5
0
 def __init__(self, insert_list):
     self.param0 = insert_list["param0"]
     self.param1 = r.checkNull(insert_list, "param1")
     self.param2 = r.checkNull(insert_list, "param2")
Beispiel #6
0
 def __init__(self, insert_list):
     self.filename = insert_list["filename"]
     self.mimetype = insert_list["mimetype"]
     self.uptime = datetime.datetime.now()
     self.fileown = r.checkNull(insert_list, "fileown")