예제 #1
0
def show_text(filePath, title=""):
    if title == "":
        title = "show_text"
    buf = """<!doctype html>
<html>
<head>
 <meta charset="utf-8" />
 <title>"""
    buf += title
    buf += """</title>
</head>
<body>
<h1 style='text-align:center;'>"""
    buf += title
    buf += """</h1>
<br />
<pre style='margin-left:5%;'>
  """
    buf += escape(fs.readAllText(filePath))
    buf += """</pre>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>
</html>
  """
    return buf
예제 #2
0
def showSource(filePath, style="default"):
    text = fs.readAllText(filePath)
    source = WebPage.WebPage.escape(text)
    title = fs.getFileName(filePath)
    return render_template("showSource.html",
                           source=source,
                           title=title,
                           style=style)
예제 #3
0
def index():
    home_folder = '"' + fs.getHomeDirectory() + '"'
    orderby = request.args.get("orderby")
    hiddenfile = request.args.get("hiddenfile")
    textview = request.args.get("textview")
    favarray = fs.readAllText("fav_folders.csv")
    return render_template('index.html',
                           version='1.0',
                           home=home_folder,
                           fav_folder=favarray)
예제 #4
0
def text_content():
    path = request.args.get("path")
    s = fs.readAllText(path)
    return s