Skip to content

Commit

Permalink
get_url
Browse files Browse the repository at this point in the history
  • Loading branch information
MarrekNozka committed Feb 28, 2014
1 parent 17504f0 commit b2b8425
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
3 changes: 1 addition & 2 deletions look/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ body {
position: relative;
top: -3ex;
left: 64%;
text-align: right;
background-color: #DD5756;
color: white; }
@media -sass-debug-info{filename{font-family:file\:\/\/\/home\/marek\/Programming\/webpwgen\/styles\.scss}line{font-family:\0000347}}
Expand All @@ -50,7 +49,7 @@ body {
@media -sass-debug-info{filename{font-family:file\:\/\/\/home\/marek\/Programming\/webpwgen\/styles\.scss}line{font-family:\0000355}}
.pswd {
font-family: monospace;
font-size: 130%;
font-size: 170%;
padding-left: 20px;
padding-right: 20px;
max-width: 80ex; }
4 changes: 2 additions & 2 deletions styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ body {
position: relative;
top: -3ex;
left: 64%;
text-align: right;
//text-align: right;
background-color: #DD5756;
color: white;

Expand All @@ -54,7 +54,7 @@ body {

.pswd {
font-family: monospace ;
font-size: 130%;
font-size: 170%;
padding-left: 20px;
padding-right: 20px;
max-width: 80ex;
Expand Down
4 changes: 2 additions & 2 deletions views/base.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html xmlns="http:https://www.w3.org/1999/xhtml">
<head>
<meta name="keywords" content="pwgen, password generátor, zapamatovatelné heslo"/>
<link href="look/styles.css" rel="stylesheet" type="text/css" />
<link href="{{root}}look/styles.css" rel="stylesheet" type="text/css" />
<link href="look/favico.png" rel="shortcut icon" type="image/png" />
<title>webPWgen</title>
</head>
Expand All @@ -26,7 +26,7 @@
</p>
</form>
<h2 class="sideL">Vyber si a zapamatuj si</h2>
<p class="sideR"><span class="sideR">... nebo se jen inspiruj.</span></p>
<p style="text-align:right;">... nebo se jen inspiruj.</p>
<p>Délka hesel je {{length}}:</p>
<p class="pswd"><kbd>
{{passwords}}
Expand Down
12 changes: 10 additions & 2 deletions webpwgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
############################################################################


from bottle import route, request, redirect, response, template, error, static_file
from bottle import route, request, redirect, response, template, error, static_file,\
default_app,BaseTemplate
import subprocess
############################################################################

app=default_app()
BaseTemplate.defaults['getURL'] = app.get_url

@route('/look/<filepath:path>')
def server_static(filepath):
return static_file(filepath, root='./look')
Expand All @@ -24,8 +28,11 @@ def pwgen():
except :
length=8
pswd= subprocess.check_output(['pwgen','-Ccn',str(length), ])
return template('base',passwords=pswd, length=length)
return template('base',passwords=pswd, length=length )

############################################################################
BaseTemplate.defaults['root'] = app.get_url('/')
############################################################################

############################################################################

Expand All @@ -37,6 +44,7 @@ def notFound(error):
return r



############################################################################
def accept_languages(browser_pref_langs):
"""Parses the request and return language list.
Expand Down

0 comments on commit b2b8425

Please sign in to comment.