Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caucase
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
caucase
Commits
a9a134d0
Commit
a9a134d0
authored
7 years ago
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove useless functions
parent
90a3652b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
38 deletions
+0
-38
caucase/utils.py
caucase/utils.py
+0
-24
caucase/web.py
caucase/web.py
+0
-14
No files found.
caucase/utils.py
View file @
a9a134d0
...
...
@@ -252,27 +252,3 @@ def unwrap(wrapped, getCertificate, digest_list):
raise
BadSignature
(
'Signature mismatch: %s'
%
str
(
e
))
return
payload
def
tail
(
path
,
lines
=
100
):
"""
Returns the last `lines` lines of file `path`.
"""
f
=
open
(
path
).
read
()
BUFSIZ
=
1024
f
.
seek
(
0
,
2
)
bytes
=
f
.
tell
()
size
=
lines
+
1
block
=
-
1
data
=
[]
while
size
>
0
and
bytes
>
0
:
if
bytes
-
BUFSIZ
>
0
:
f
.
seek
(
block
*
BUFSIZ
,
2
)
data
.
insert
(
0
,
f
.
read
(
BUFSIZ
))
else
:
f
.
seek
(
0
,
0
)
data
.
insert
(
0
,
f
.
read
(
bytes
))
linesFound
=
data
[
0
].
count
(
'
\
n
'
)
size
-=
linesFound
bytes
-=
BUFSIZ
block
-=
1
return
'
\
n
'
.
join
(
''
.
join
(
data
).
splitlines
()[
-
lines
:])
This diff is collapsed.
Click to expand it.
caucase/web.py
View file @
a9a134d0
...
...
@@ -676,17 +676,3 @@ def user_profile():
return
render_template
(
'user_profile.html'
,
form
=
form
)
@
app
.
route
(
'/admin/logs'
,
methods
=
[
'GET'
])
@
login_required
def
view_logs
():
content
=
""
full_log
=
request
.
args
.
get
(
'full'
,
''
)
if
app
.
config
.
log_file
and
os
.
path
.
exists
(
app
.
config
.
log_file
):
if
full_log
==
'true'
:
with
open
(
app
.
config
.
log_file
)
as
f
:
content
=
f
.
read
()
else
:
content
=
utils
.
tail
(
app
.
config
.
log_file
,
500
)
return
render_template
(
"view_logs.html"
,
content
=
content
,
filename
=
app
.
config
.
log_file
)
This diff is collapsed.
Click to expand it.
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