id = state["id"]
print(" url %s id %s" % (url, id))
q = """
- UPDATE new_site SET status = "got_url", data = %s where id = %s
+ UPDATE new_site SET status = 'got_url', data = %s where id = %s
"""
return self.dcm.runQuery(q, (simplejson.dumps(url), id))
self.state = state
q = """
- UPDATE new_site SET status = "done", site_id = %s where id = %s
+ UPDATE new_site SET status = 'done', site_id = %s where id = %s
"""
d = self.dcm.runQuery(q, (state["site_id"], state["id"]))
d.addCallback(self.done)
if failure.check(NeedsFeedPickError):
data = failure.value.data
q = """
- UPDATE new_site SET status = "pick_url", data = %s WHERE id = %s
+ UPDATE new_site SET status = 'pick_url', data = %s WHERE id = %s
"""
d = self.dcm.runQuery(q, (data, id))
else:
q = """
- UPDATE new_site SET status = "error", error = %s where id = %s
+ UPDATE new_site SET status = 'error', error = %s where id = %s
"""
if failure.check(PageNotFoundError):
data = simplejson.dumps(dict(feed=feed, current=current, type=state["type"]))
q = """
- UPDATE new_site SET status = "preview_done", data = %s where id = %s
+ UPDATE new_site SET status = 'preview_done', data = %s where id = %s
"""
d = self.dcm.runQuery(q, (data, state["id"]))
self.new_site_in_progress = True
q = """
- SELECT id, url FROM new_site WHERE status = "new" and id > %s
+ SELECT id, url FROM new_site WHERE status = 'new' and id > %s
"""
d = self.runQuery(q, self.new_site_last_id)
d.addCallback(self.gotNewSites)
self.picked_site_in_progress = True
q = """
- SELECT id, url FROM new_site WHERE status = "url_picked" and id > %s
+ SELECT id, url FROM new_site WHERE status = 'url_picked' and id > %s
"""
d = self.runQuery(q, self.picked_site_last_id)
d.addErrback(self.errorHandler)
q = """
SELECT site_refresh.id, site_refresh.site_id, site.type
FROM site_refresh, site WHERE
- site_refresh.site_id = site.id and site_refresh.status = "new" and site_refresh.id > %s
+ site_refresh.site_id = site.id and site_refresh.status = 'new' and site_refresh.id > %s
"""
d = self.runQuery(q, self.refresh_last_id)
d.addCallback(self.gotRefresh)
self.preview_site_in_progress = True
q = """
- SELECT id, url FROM new_site WHERE status = "preview" and id > %s
+ SELECT id, url FROM new_site WHERE status = 'preview' and id > %s
"""
d = self.runQuery(q, self.preview_site_last_id)