Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
go
Commits
beb01d80
Commit
beb01d80
authored
Nov 09, 2013
by
Jean Michel Rouly
Browse files
Refactored header inclusion to use library function.
parent
eb67dd47
Changes
5
Hide whitespace changes
Inline
Side-by-side
wsgi/about.py
View file @
beb01d80
...
...
@@ -7,18 +7,14 @@ import goconfig
def
application
(
environ
,
start_response
):
f
=
open
(
goconfig
.
doc_root
+
"/site_data/top.part"
,
"r"
)
top
=
f
.
read
(
)
f
.
close
(
)
user_logged_in
=
library
.
user_logged_in
(
environ
)
top
=
library
.
get_top
(
user_logged_in
)
bottom
=
library
.
get_bottom
(
user_logged_in
)
f
=
open
(
goconfig
.
doc_root
+
"/site_data/about.part"
,
"r"
)
about
=
f
.
read
()
f
.
close
()
f
=
open
(
goconfig
.
doc_root
+
"/site_data/bottom.part"
,
"r"
)
bottom
=
f
.
read
()
f
.
close
()
response
=
top
+
about
+
bottom
status
=
'200 OK'
...
...
wsgi/index.py
View file @
beb01d80
...
...
@@ -137,12 +137,9 @@ def application(environ, start_response):
(
short_url
,
display_short
))
f
=
open
(
goconfig
.
doc_root
+
"/site_data/top.part"
,
"r"
)
top
=
f
.
read
()
f
.
close
()
f
=
open
(
goconfig
.
doc_root
+
"/site_data/bottom.part"
,
"r"
)
bottom
=
f
.
read
()
f
.
close
()
user_logged_in
=
library
.
user_logged_in
(
environ
)
top
=
library
.
get_top
(
user_logged_in
)
bottom
=
library
.
get_bottom
(
user_logged_in
)
body
=
''
.
join
(
body
)
response
=
top
+
body
+
bottom
...
...
wsgi/login.py
View file @
beb01d80
...
...
@@ -91,12 +91,9 @@ def application(environ, start_response):
body
=
[
"<p>Error: Invalid username or password.</p>"
]
f
=
open
(
goconfig
.
doc_root
+
"/site_data/top.part"
,
"r"
)
top
=
f
.
read
()
f
.
close
()
f
=
open
(
goconfig
.
doc_root
+
"/site_data/bottom.part"
,
"r"
)
bottom
=
f
.
read
()
f
.
close
()
user_logged_in
=
library
.
user_logged_in
(
environ
)
top
=
library
.
get_top
(
user_logged_in
)
bottom
=
library
.
get_bottom
(
user_logged_in
)
body
=
''
.
join
(
body
)
response
=
top
+
body
+
bottom
...
...
wsgi/redir.py
View file @
beb01d80
...
...
@@ -19,19 +19,13 @@ def application(environ, start_response):
target
=
library
.
get_redirect_target
(
short_url
)
if
target
is
None
:
f
=
open
(
goconfig
.
doc_root
+
"/site_data/top.part"
,
"r"
)
top
=
f
.
read
()
f
.
close
()
f
=
open
(
goconfig
.
doc_root
+
"/site_data/bottom.part"
,
"r"
)
bottom
=
f
.
read
()
f
.
close
()
response
=
[]
response
.
append
(
top
)
response
.
append
(
"<p>Nothing here.</p>"
)
response
.
append
(
bottom
)
response
=
''
.
join
(
response
)
user_logged_in
=
library
.
user_logged_in
(
environ
)
top
=
library
.
get_top
(
user_logged_in
)
bottom
=
library
.
get_bottom
(
user_logged_in
)
body
=
"<p>Nothing here.</p>"
response
=
top
+
body
+
bottom
status
=
'200 OK'
response_headers
=
[(
'Content-type'
,
'text/html'
),
...
...
wsgi/signup.py
View file @
beb01d80
...
...
@@ -68,12 +68,9 @@ def application(environ, start_response):
body
.
append
(
"<p>Please complete all forms before submitting.<br/><br/></p>"
)
f
=
open
(
goconfig
.
doc_root
+
"/site_data/top.part"
,
"r"
)
top
=
f
.
read
()
f
.
close
()
f
=
open
(
goconfig
.
doc_root
+
"/site_data/bottom.part"
,
"r"
)
bottom
=
f
.
read
()
f
.
close
()
user_logged_in
=
library
.
user_logged_in
(
environ
)
top
=
library
.
get_top
(
user_logged_in
)
bottom
=
library
.
get_bottom
(
user_logged_in
)
body
=
''
.
join
(
body
)
response
=
top
+
body
+
bottom
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment