Exemplo n.º 1
0
def getArticleSource(siteName, pathName):
    articlePan = getArticlePan(siteName, pathName)
    if butil.fileExists(articlePan):
        src = butil.readFileUtf8(articlePan)
        return src
    else:
        return ""
Exemplo n.º 2
0
def getArticleSource(siteName, pathName):
    articlePan = getArticlePan(siteName, pathName)
    if butil.fileExists(articlePan):
        src = butil.readFileUtf8(articlePan)
        return src
    else:
        return ""
Exemplo n.º 3
0
def getArticleBody(siteName, pathName):
    """ given an article name, return the body of the article.
    @return ::(str,str) =title,html
    """
    articlePan = getArticlePan(siteName, pathName)
    #prvars()
    if butil.fileExists(articlePan):
        src = butil.readFileUtf8(articlePan)
        src = convertQuickLinks(src)
        contents = md(src)
        return pathName, contents
    else:
        h = form("<p>({pathName} does not exist; "
            "<a href='/{siteName}/wikiedit/{pathName}'>create it</a>)</p>\n",
            siteName = htmlEscape(siteName),
            pathName = htmlEscape(pathName))
        return (pathName, h)
Exemplo n.º 4
0
def getArticleBody(siteName, pathName):
    """ given an article name, return the body of the article.
    @return ::(str,str) =title,html
    """
    articlePan = getArticlePan(siteName, pathName)
    #prvars()
    if butil.fileExists(articlePan):
        src = butil.readFileUtf8(articlePan)
        src = convertQuickLinks(src)
        contents = md(src)
        return pathName, contents
    else:
        h = form(
            "<p>({pathName} does not exist; "
            "<a href='/{siteName}/wikiedit/{pathName}'>create it</a>)</p>\n",
            siteName=htmlEscape(siteName),
            pathName=htmlEscape(pathName))
        return (pathName, h)