Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
librestash
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nik | Klampfradler
librestash
Commits
045b04ea
Verified
Commit
045b04ea
authored
7 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Pass db object everywhere.
parent
0b6b6e63
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
librestash/lib/stats/__init__.py
+1
-1
1 addition, 1 deletion
librestash/lib/stats/__init__.py
librestash/lib/stats/basic.py
+9
-9
9 additions, 9 deletions
librestash/lib/stats/basic.py
with
10 additions
and
10 deletions
librestash/lib/stats/__init__.py
+
1
−
1
View file @
045b04ea
...
...
@@ -11,7 +11,7 @@ def all_stats(db, geocacher_name):
res
=
{}
for
plugin
in
STATS_PLUGINS
:
res
[
plugin
.
__name__
]
=
plugin
(
geocacher
)
res
[
plugin
.
__name__
]
=
plugin
(
db
,
geocacher
)
return
res
from
.basic
import
*
This diff is collapsed.
Click to expand it.
librestash/lib/stats/basic.py
+
9
−
9
View file @
045b04ea
from
.
import
stats_plugin
def
_field_count
(
geocacher
,
field
):
def
_field_count
(
db
,
geocacher
,
field
):
res
=
{}
for
cache
in
geocacher
.
found_geocaches
:
...
...
@@ -12,14 +12,14 @@ def _field_count(geocacher, field):
return
res
@stats_plugin
def
type_count
(
geocacher
):
return
_field_count
(
geocacher
,
'
type
'
)
def
type_count
(
db
,
geocacher
):
return
_field_count
(
db
,
geocacher
,
'
type
'
)
@stats_plugin
def
size_count
(
geocacher
):
return
_field_count
(
geocacher
,
'
size
'
)
def
size_count
(
db
,
geocacher
):
return
_field_count
(
db
,
geocacher
,
'
size
'
)
@stats_plugin
def
difficulty_count
(
geocacher
):
return
_field_count
(
geocacher
,
'
difficulty
'
)
def
difficulty_count
(
db
,
geocacher
):
return
_field_count
(
db
,
geocacher
,
'
difficulty
'
)
@stats_plugin
def
terrain_count
(
geocacher
):
return
_field_count
(
geocacher
,
'
terrain
'
)
def
terrain_count
(
db
,
geocacher
):
return
_field_count
(
db
,
geocacher
,
'
terrain
'
)
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