def save(self):
   date=now()
   for s in SCRIPTS:
     changed=(self.last[s]!=self.current[s]) #Check the last dict
     d={"date":date,"file":s,"changed":changed}
     if changed:
       d["contents"]=self.last[s]
     swsave([],d,'scripts')
     self.last[s]=self.current[s] #Overwrite the last dict now that we've checked it
 def save(self):
     date = now()
     for s in SCRIPTS:
         changed = (self.last[s] != self.current[s])  #Check the last dict
         d = {"date": date, "file": s, "changed": changed}
         if changed:
             d["contents"] = self.last[s]
         swsave([], d, 'scripts')
         self.last[s] = self.current[
             s]  #Overwrite the last dict now that we've checked it
def dsp(url, save=True):
    html = urlopen(url).read()
    if save:
        swsave([], {"url": url, "html": html, "time": time()}, "raw_pages")
    xml = fromstring(html)
    return xml
Exemple #4
0
def save(uniques=None, d=None, table_name=None):
    for row in d:
        row["date_extracted"] = t
    swsave(uniques, d, table_name)
def save(uniques=None,d=None,table_name=None):
  for row in d:
    row["date_extracted"]=t
  swsave(uniques,d,table_name)
def dsp(url, save=True):
    html = urlopen(url).read()
    if save:
        swsave([], {"url": url, "html": html, "time": time()}, 'raw_pages')
    xml = fromstring(html)
    return xml