Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-fuse
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
Package 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
Antoine Lambert
swh-fuse
Commits
2b688f8f
Commit
2b688f8f
authored
4 years ago
by
Thibault Allançon
Browse files
Options
Downloads
Patches
Plain Diff
cli: use SWHIDParamType from swh.model.cli
See D4139.
parent
f7194e5a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
requirements-swh.txt
+1
-1
1 addition, 1 deletion
requirements-swh.txt
swh/fuse/cli.py
+1
-19
1 addition, 19 deletions
swh/fuse/cli.py
with
2 additions
and
20 deletions
requirements-swh.txt
+
1
−
1
View file @
2b688f8f
# Add here internal Software Heritage dependencies, one per line.
swh.core
swh.model
swh.model
>=0.7.0
swh.web.client
This diff is collapsed.
Click to expand it.
swh/fuse/cli.py
+
1
−
19
View file @
2b688f8f
...
...
@@ -16,7 +16,7 @@ from daemon import DaemonContext
# from swh.core import config
from
swh.core.cli
import
CONTEXT_SETTINGS
from
swh.model.
identifiers
import
SWHID
from
swh.model.
cli
import
SWHID
ParamType
# All generic config code should reside in swh.core.config
DEFAULT_CONFIG_PATH
=
os
.
environ
.
get
(
...
...
@@ -44,24 +44,6 @@ DEFAULT_CONFIG: Dict[str, Tuple[str, Any]] = {
}
class
SWHIDParamType
(
click
.
ParamType
):
"""
Click argument that accepts SWHID and return them as
:class:`swh.model.identifiers.SWHID` instances
"""
name
=
"
SWHID
"
def
convert
(
self
,
value
,
param
,
ctx
)
->
SWHID
:
from
swh.model.exceptions
import
ValidationError
from
swh.model.identifiers
import
parse_swhid
try
:
return
parse_swhid
(
value
)
except
ValidationError
:
self
.
fail
(
f
'"
{
value
}
"
is not a valid SWHID
'
,
param
,
ctx
)
@click.group
(
name
=
"
fuse
"
,
context_settings
=
CONTEXT_SETTINGS
)
# XXX conffile logic temporarily commented out due to:
# XXX https://forge.softwareheritage.org/T2632
...
...
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