def SetBroken(self, _id, broken): if (broken): q = set_broken_query % (_id,) else: q = unset_broken_query % (_id,) logger.debug('query in SetBroken: %s' % (q,)) self.worker.execute(q)
def parse(self): dbData = self.worker.execute(get_note_state_query) logger.debug("DB data in SQLParser:\n%s" % (str(dbData), ) ) #print self.noteNames #self.noteNames = self.parser.sections() self.notes = {} for noteState in dbData: currNote = {} currNote["last_ping"] = int( time.mktime( noteState[3].timetuple() ) ) currNote["batt"] = noteState[2] currNote["state"] = noteState[4] currNote["ip"] = noteState[1] currNote["name"] = IP2Name(currNote["ip"]) # last number in IP currNote["broken"] = noteState[5] currNote["id"] = noteState[0] self.notes[currNote["name"]] = currNote self.noteNames = self.notes.keys()