Example #1
0
    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
Example #2
0
    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
Example #3
0
    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
Example #4
0
 def url(self, size="M"):
     return "%s/%s/id/%s-%s.jpg" % (h.get_coverstore_url(), self.category, self.id, size.upper())
Example #5
0
 def url(self, size="M"):
     return "%s/%s/id/%s-%s.jpg" % (h.get_coverstore_url(), self.category,
                                    self.id, size.upper())