Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-lister
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Platform
Development
swh-lister
Commits
b272a362
Verified
Commit
b272a362
authored
6 years ago
by
Antoine R. Dumont
Browse files
Options
Downloads
Patches
Plain Diff
core.lister_base: Refactor task creation
parent
3e3b4416
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
debian/control
+2
-2
2 additions, 2 deletions
debian/control
requirements-swh.txt
+1
-1
1 addition, 1 deletion
requirements-swh.txt
swh/lister/core/lister_base.py
+6
-13
6 additions, 13 deletions
swh/lister/core/lister_base.py
with
9 additions
and
16 deletions
debian/control
+
2
−
2
View file @
b272a362
...
...
@@ -12,7 +12,7 @@ Build-Depends: debhelper (>= 9),
python3-setuptools,
python3-sqlalchemy (>= 1.0),
python3-swh.core,
python3-swh.scheduler (>= 0.0.3
0
~),
python3-swh.scheduler (>= 0.0.3
1
~),
python3-swh.storage,
python3-swh.storage.schemata,
python3-testing.postgresql,
...
...
@@ -23,7 +23,7 @@ Homepage: https://forge.softwareheritage.org/source/swh-lister/
Package: python3-swh.lister
Architecture: all
Depends: python3-swh.scheduler (>= 0.0.3
0
~),
Depends: python3-swh.scheduler (>= 0.0.3
1
~),
${misc:Depends},
${python3:Depends}
Breaks: python3-swh.lister.github
...
...
This diff is collapsed.
Click to expand it.
requirements-swh.txt
+
1
−
1
View file @
b272a362
swh.core
swh.storage[schemata] >= 0.0.76
swh.scheduler >= 0.0.3
0
swh.scheduler >= 0.0.3
1
This diff is collapsed.
Click to expand it.
swh/lister/core/lister_base.py
+
6
−
13
View file @
b272a362
...
...
@@ -14,7 +14,7 @@ from sqlalchemy import create_engine, func
from
sqlalchemy.orm
import
sessionmaker
from
swh.core
import
config
from
swh.scheduler
import
get_scheduler
from
swh.scheduler
import
get_scheduler
,
utils
from
swh.storage
import
get_storage
from
.abstractattribute
import
AbstractAttribute
...
...
@@ -392,7 +392,7 @@ class SWHListerBase(abc.ABC, config.SWHConfig):
'
url
'
:
origin_url
,
}
def
task_dict
(
self
,
origin_type
,
origin_url
):
def
task_dict
(
self
,
origin_type
,
origin_url
,
**
kwargs
):
"""
Return special dict format for the tasks list
Args:
...
...
@@ -401,16 +401,9 @@ class SWHListerBase(abc.ABC, config.SWHConfig):
Returns:
the same information in a different form
"""
return
{
'
type
'
:
'
origin-update-%s
'
%
origin_type
,
'
arguments
'
:
{
'
args
'
:
[
origin_url
,
],
'
kwargs
'
:
{},
},
'
next_run
'
:
utcnow
(),
}
_type
=
'
origin-update-%s
'
%
origin_type
_policy
=
'
recurring
'
return
utils
.
create_task_dict
(
_type
,
_policy
,
origin_url
)
def
string_pattern_check
(
self
,
a
,
b
,
c
=
None
):
"""
When comparing indexable types in is_within_bounds, complex strings
...
...
@@ -473,7 +466,7 @@ class SWHListerBase(abc.ABC, config.SWHConfig):
)
if
not
ir
.
task_id
:
ir
.
task_id
=
self
.
scheduler
.
create_tasks
(
[
self
.
task_dict
(
m
[
'
origin_type
'
],
m
[
'
origin_url
'
]
)]
[
self
.
task_dict
(
**
m
)]
)[
0
][
'
id
'
]
def
ingest_data
(
self
,
identifier
,
checks
=
False
):
...
...
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