def info(self): url = "%s/%s/id/%s.json" % (h.get_coverstore_url(), self.category, self.id) try: d = simplejson.loads(urllib2.urlopen(url).read()) d["created"] = h.parse_datetime(d["created"]) if d["author"] == "None": d["author"] = None d["author"] = d["author"] and self._site.get(d["author"]) return web.storage(d) except IOError: # coverstore is down return None
def info(self): url = '%s/%s/id/%s.json' % (h.get_coverstore_url(), self.category, self.id) try: d = simplejson.loads(urllib2.urlopen(url).read()) d['created'] = h.parse_datetime(d['created']) if d['author'] == 'None': d['author'] = None d['author'] = d['author'] and self._site.get(d['author']) return web.storage(d) except IOError: # coverstore is down return None
def info(self): url = '%s/%s/id/%s.json' % (h.get_coverstore_url(), self.category, self.id) if url.startswith("//"): url = "http:" + url try: d = simplejson.loads(urllib2.urlopen(url).read()) d['created'] = h.parse_datetime(d['created']) if d['author'] == 'None': d['author'] = None d['author'] = d['author'] and self._site.get(d['author']) return web.storage(d) except IOError: # coverstore is down return None
def url(self, size="M"): return "%s/%s/id/%s-%s.jpg" % (h.get_coverstore_url(), self.category, self.id, size.upper())