Ejemplo n.º 1
0
    def get_content(self, _id, revision=None):
        _id = _id.replace(' ', '_')
        content = Content(_id)
        page = _id
        rev = revision.id if revision else None
        data = self.browser.get_wiki_source(page, rev)

        content.content = data
        return content
Ejemplo n.º 2
0
    def get_content(self, _id):
        _id = _id.replace(' ', '_').encode('utf-8')
        content = Content(_id)
        page = _id
        with self.browser:
            data = self.browser.get_wiki_source(page)

        content.content = data
        return content
Ejemplo n.º 3
0
    def get_content(self, id):
        if isinstance(id, basestring):
            content = Content(id)
        else:
            content = id
            id = content.id

        with self.browser:
            data = self.browser.get_wiki_content(id)

        if data is None:
            return None

        content.content = data
        return content
Ejemplo n.º 4
0
    def get_content(self, id, revision=None):
        if isinstance(id, basestring):
            content = Content(id)
        else:
            content = id
            id = content.id

        try:
            _type, project, page = self.id2path(id)
        except ValueError:
            return None

        version = revision.id if revision else None
        data = self.browser.get_wiki_source(project, page, version)

        content.content = data
        return content
Ejemplo n.º 5
0
    def get_content(self, _id, revision=None):
        if isinstance(_id, basestring):
            content = Content(_id)
        else:
            content = _id
            _id = content.id

        if revision:
            raise NotImplementedError('Website does not provide access to older revisions sources.')
        with self.browser:
            data = self.browser.get_wiki_content(_id)

        if data is None:
            return None

        content.content = data
        return content
Ejemplo n.º 6
0
    def get_content(self, id, revision=None):
        if isinstance(id, basestring):
            content = Content(id)
        else:
            content = id
            id = content.id

        try:
            _type, project, page = self.id2path(id)
        except ValueError:
            return None

        version = revision.id if revision else None
        data = self.browser.get_wiki_source(project, page, version)

        content.content = data
        return content
Ejemplo n.º 7
0
    def get_content(self, id):
        if isinstance(id, basestring):
            content = Content(id)
        else:
            content = id
            id = content.id

        try:
            _type, project, page = self.id2path(id)
        except ValueError:
            return None

        with self.browser:
            data = self.browser.get_wiki_source(project, page)

        content.content = data
        return content
Ejemplo n.º 8
0
    def get_content(self, id):
        if isinstance(id, basestring):
            content = Content(id)
        else:
            content = id
            id = content.id

        try:
            _type, project, page = self.id2path(id)
        except ValueError:
            return None

        with self.browser:
            data = self.browser.get_wiki_source(project, page)

        content.content = data
        return content