Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
Base Worker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Workers
Base Worker
Merge requests
!57
Add list_element_children function
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add list_element_children function
add-list-element-children
into
master
Overview
0
Commits
2
Pipelines
1
Changes
2
Merged
Eva Bardou
requested to merge
add-list-element-children
into
master
4 years ago
Overview
0
Commits
2
Pipelines
1
Changes
2
Expand
Closes
#37 (closed)
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
a3a2af5f
2 commits,
4 years ago
2 files
+
271
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
arkindex_worker/worker.py
+
66
−
0
Options
@@ -716,3 +716,69 @@ class ElementsWorker(BaseWorker):
)
return
transcriptions
def
list_element_children
(
self
,
element
,
best_class
=
None
,
folder
=
None
,
name
=
None
,
recursive
=
None
,
type
=
None
,
with_best_classes
=
None
,
with_corpus
=
None
,
with_has_children
=
None
,
with_zone
=
None
,
worker_version
=
None
,
):
"""
List children of an element
"""
assert
element
and
isinstance
(
element
,
Element
),
"
element shouldn
'
t be null and should be of type Element
"
query_params
=
{}
if
best_class
is
not
None
:
assert
isinstance
(
best_class
,
str
)
or
isinstance
(
best_class
,
bool
),
"
best_class should be of type str or bool
"
query_params
[
"
best_class
"
]
=
best_class
if
folder
is
not
None
:
assert
isinstance
(
folder
,
bool
),
"
folder should be of type bool
"
query_params
[
"
folder
"
]
=
folder
if
name
:
assert
isinstance
(
name
,
str
),
"
name should be of type str
"
query_params
[
"
name
"
]
=
name
if
recursive
is
not
None
:
assert
isinstance
(
recursive
,
bool
),
"
recursive should be of type bool
"
query_params
[
"
recursive
"
]
=
recursive
if
type
:
assert
isinstance
(
type
,
str
),
"
type should be of type str
"
query_params
[
"
type
"
]
=
type
if
with_best_classes
is
not
None
:
assert
isinstance
(
with_best_classes
,
bool
),
"
with_best_classes should be of type bool
"
query_params
[
"
with_best_classes
"
]
=
with_best_classes
if
with_corpus
is
not
None
:
assert
isinstance
(
with_corpus
,
bool
),
"
with_corpus should be of type bool
"
query_params
[
"
with_corpus
"
]
=
with_corpus
if
with_has_children
is
not
None
:
assert
isinstance
(
with_has_children
,
bool
),
"
with_has_children should be of type bool
"
query_params
[
"
with_has_children
"
]
=
with_has_children
if
with_zone
is
not
None
:
assert
isinstance
(
with_zone
,
bool
),
"
with_zone should be of type bool
"
query_params
[
"
with_zone
"
]
=
with_zone
if
worker_version
:
assert
isinstance
(
worker_version
,
str
),
"
worker_version should be of type str
"
query_params
[
"
worker_version
"
]
=
worker_version
children
=
self
.
api_client
.
paginate
(
"
ListElementChildren
"
,
id
=
element
.
id
,
**
query_params
)
return
children
Loading