Exemplo n.º 1
0
    def parse_post(self):
        if hasattr(self, 'post'):
            return self.post
        parts = MarkdownParser(self.filepath).read()

        post = NameSpace(parts)
        tags = post.get('tags', None)
        if tags:
            post.tags = [tag.strip() for tag in tags.split(',')]
        self.post = post
        return post
Exemplo n.º 2
0
    def parse_post(self):
        if hasattr(self, 'post'):
            return self.post
        parts = MarkdownParser(self.filepath).read()

        post = NameSpace(parts)
        tags = post.get('tags', None)
        if tags:
            post.tags = [tag.strip() for tag in tags.split(',')]
        self.post = post
        return post
Exemplo n.º 3
0
    def parse_post(self):
        if hasattr(self, 'post'):
            return self.post
        parts = rstParser(self.filepath).read()

        docinfo = dict(parts['docinfo'])

        post = NameSpace()
        for k, v in docinfo.items():
            post[k] = v
        post.title = parts['title']
        post.content = parts['body']
        self.post = post
        return post
Exemplo n.º 4
0
    def parse_post(self):
        if hasattr(self, 'post'):
            return self.post
        parts = rstParser(self.filepath).read()

        docinfo = dict(parts['docinfo'])

        post = NameSpace()
        for k, v in docinfo.items():
            post[k] = v
        post.title = parts['title']
        post.content = parts['body']
        self.post = post
        return post
Exemplo n.º 5
0
 def calc_tagcloud(self):
     tagcloud = merge(self.calc_tag_posts())
     for k, v in tagcloud.iteritems():
         tag = NameSpace(
             name=k,
             count=len(v),
             size=100 + log(len(v) or 1) * 20,
         )
         yield tag