Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
website
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jannik Hellenkamp
website
Commits
bc5e4397
Commit
bc5e4397
authored
7 years ago
by
Julian Rother
Browse files
Options
Downloads
Patches
Plain Diff
Revert "fixed import errors for stats"
This reverts commit
9231e1cb
.
parent
9231e1cb
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
stats.py
+6
-6
6 additions, 6 deletions
stats.py
with
6 additions
and
6 deletions
stats.py
+
6
−
6
View file @
bc5e4397
...
@@ -2,7 +2,7 @@ from server import *
...
@@ -2,7 +2,7 @@ from server import *
import
json
import
json
from
jobs
import
date_json_handler
from
jobs
import
date_json_handler
from
hashlib
import
md5
from
hashlib
import
md5
import
datetime
from
datetime
import
datetime
@app.route
(
'
/internal/stats
'
)
@app.route
(
'
/internal/stats
'
)
@app.route
(
'
/internal/stats/<semester>
'
)
@app.route
(
'
/internal/stats/<semester>
'
)
...
@@ -13,11 +13,11 @@ def stats():
...
@@ -13,11 +13,11 @@ def stats():
for
s
in
semester
:
for
s
in
semester
:
year
=
int
(
s
[
'
semester
'
][
0
:
4
])
year
=
int
(
s
[
'
semester
'
][
0
:
4
])
if
s
[
'
semester
'
].
endswith
(
'
ss
'
):
if
s
[
'
semester
'
].
endswith
(
'
ss
'
):
s
[
'
from
'
]
=
datetime
.
datetime
(
year
,
4
,
1
)
s
[
'
from
'
]
=
datetime
(
year
,
4
,
1
)
s
[
'
to
'
]
=
datetime
.
datetime
(
year
,
10
,
1
)
s
[
'
to
'
]
=
datetime
(
year
,
10
,
1
)
if
s
[
'
semester
'
].
endswith
(
'
ws
'
):
if
s
[
'
semester
'
].
endswith
(
'
ws
'
):
s
[
'
from
'
]
=
datetime
.
datetime
(
year
,
10
,
1
)
s
[
'
from
'
]
=
datetime
(
year
,
10
,
1
)
s
[
'
to
'
]
=
datetime
.
datetime
(
year
+
1
,
4
,
1
)
s
[
'
to
'
]
=
datetime
(
year
+
1
,
4
,
1
)
return
render_template
(
'
stats.html
'
,
semester
=
semester
,
filter
=
request
.
args
.
get
(
'
filter
'
))
return
render_template
(
'
stats.html
'
,
semester
=
semester
,
filter
=
request
.
args
.
get
(
'
filter
'
))
statsqueries
=
{}
statsqueries
=
{}
...
@@ -117,7 +117,7 @@ def stats_viewsperday(req, param=""):
...
@@ -117,7 +117,7 @@ def stats_viewsperday(req, param=""):
expr
=
queries
[
req
].
replace
(
'
%T
'
,
'"'
+
query
(
date_subexpr
%
(
'
viewsperday.
'
+
req
),
param
)[
0
][
'
t
'
]
+
'"'
)
expr
=
queries
[
req
].
replace
(
'
%T
'
,
'"'
+
query
(
date_subexpr
%
(
'
viewsperday.
'
+
req
),
param
)[
0
][
'
t
'
]
+
'"'
)
params
=
[
param
]
*
expr
.
count
(
'
?
'
)
params
=
[
param
]
*
expr
.
count
(
'
?
'
)
try
:
try
:
modify
(
update_expr
%
(
'
viewsperday.
'
+
req
,
expr
),
param
,
*
(
params
+
[
datetime
.
datetime
.
combine
(
datetime
.
date
.
today
(),
datetime
.
time
())]))
modify
(
update_expr
%
(
'
viewsperday.
'
+
req
,
expr
),
param
,
*
(
params
+
[
datetime
.
combine
(
date
.
today
(),
time
())]))
modify
(
'
COMMIT
'
)
modify
(
'
COMMIT
'
)
except
Exception
:
except
Exception
:
traceback
.
print_exc
()
traceback
.
print_exc
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment