FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
processing-contributions/scripts/utils.py at main · processing/processing-contributions · GitHub
processing
processing-contributions
Repository navigation
Code
Issues
20
(20)
Pull requests
12
(12)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
processing-contributions
/
scripts
/
utils.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
35 lines (24 loc) · 1.01 KB
Breadcrumbs
processing-contributions
/
scripts
/
utils.py
Copy path
File metadata and controls
35 lines (24 loc) · 1.01 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import
pathlib
from
ruamel
.
yaml
import
YAML
database_file
=
pathlib
.
Path
(
__file__
).
parent
.
parent
/
'contributions.yaml'
def
get_contributions
():
# read in database yaml file
yaml
=
YAML
()
with
open
(
database_file
,
'r'
)
as
db
:
data
=
yaml
.
load
(
db
)
contributions_list
=
data
[
'contributions'
]
# filter contributions list, remove contribution status == BROKEN
contributions_list
=
[
contribution
for
contribution
in
contributions_list
if
contribution
[
'status'
]
not
in
[
"BROKEN"
,
"DEPRECATED"
]
]
return
contributions_list
def
apply_override
(
contributions_list
):
# apply override. if field additional_category, add value to categories
for
contribution
in
contributions_list
:
if
'override'
in
contribution
.
keys
():
for
key
in
contribution
[
'override'
].
keys
():
contribution
[
key
]
=
contribution
[
'override'
][
key
]
def
get_valid_contributions
():
contributions
=
get_contributions
()
apply_override
(
contributions
)
return
contributions
Back
|
FazBrowse Home
|
New Git URL