Moved templates inside of the package to enable setuptools distribution via package_data.

This commit is contained in:
Michael Lazar
2015-10-15 01:44:33 -07:00
parent aa2f810069
commit 77a6c71119
6 changed files with 5 additions and 5 deletions

View File

@@ -44,7 +44,7 @@ class OAuthTool(object):
# Initialize Tornado webapp
routes = [('/', AuthHandler)]
self.callback_app = web.Application(routes, template_path='templates')
self.callback_app = web.Application(routes, template_path='rtv/templates')
self.reddit.set_oauth_app_info(config.oauth_client_id,
config.oauth_client_secret,

43
rtv/templates/index.html Normal file
View File

@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html>
<head>
<title>RTV OAuth2 Helper</title>
<!-- style borrowed from http://bettermotherfuckingwebsite.com/ -->
<style type="text/css">
body {
margin:40px auto;
max-width:650px;
line-height:1.6;
font-size:18px;
font-family:Arial, Helvetica, sans-serif;
color:#444;
padding:0 10px;
}
h1, h2, h3 {
line-height:1.2
}
#footer {
position: absolute;
bottom: 0px;
width: 100%;
font-size:14px;
}
</style>
</head>
<body>
{% if error == 'access_denied' %}
<h1 style="color: red">Access Denied</h1><hr>
<p><span style="font-weight: bold">Reddit Terminal Viewer</span> was denied access and will continue to operate in unauthenticated mode, you can close this window.
{% elif error != 'placeholder' %}
<h1 style="color: red">Error : {{ error }}</h1>
{% elif (state == 'placeholder' or code == 'placeholder') %}
<h1>Wait...</h1><hr>
<p>This page is supposed to be a Reddit OAuth callback. You can't just come here hands in your pocket!</p>
{% else %}
<h1 style="color: green">Access Granted</h1><hr>
<p><span style="font-weight: bold">Reddit Terminal Viewer</span> will now log in, you can close this window.</p>
{% end %}
<div id="footer">View the <a href="http://www.github.com/michael-lazar/rtv">Documentation</a></div>
</body>
</html>

View File

@@ -0,0 +1,40 @@
.TH "RTV" "1" "{release_date}" "Version {version}" "Usage and Commands"
.SH NAME
RTV - Reddit Terminal Viewer
.SH SYNOPSIS
{synopsis}
.SH DESCRIPTION
{description}
.SH OPTIONS
{options}
.SH CONTROLS
Navigate between posts by using the arrow keys or vim-style `hjkl` movement.
You can view the full list of commands by pressing the \fB?\fR key inside of the program.
.SH FILES
.TP
.BR $XDG_CONFIG_HOME/rtv/rtv.cfg
The configuration file can be used to customize default program settings, see
README.rst for more information.
.TP
.BR $XDG_CONFIG_HOME/rtv/refresh-token
After you login to reddit, your most recent OAuth refresh token will be stored
for future sessions. You can disable this behavior by setting the option
\fBpersistent=False\fR in your configuration file.
.SH ENVIRONMENT
.TP
.BR RTV_EDITOR
Specifies which text editor RTV will attempt to use when editing comments and
posts. RTV will fallback to \fI$EDITOR\fR if the editor is unspecified.
.TP
.BR BROWSER
Specifies which webbrowser RTV will attempt to use when opening links.
This can be set to a terminal browser (w3m, lynx, elinks, etc.) for a true
terminal experience. RTV will fallback to the system's default browser.
.SH AUTHOR
Man page written by Johnathan "ShaggyTwoDope" Jenkins <twodopeshaggy@gmail.com> (2015).
.SH BUGS
Report bugs to \fIhttps://github.com/michael-lazar/rtv/issues\fR
.SH LICENSE
{license}
.PP
{copyright}