Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
f264fb37
Commit
f264fb37
authored
6 years ago
by
yvesn
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-7140: code cleanup
parent
d4fa3862
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
obis/src/python/obis/dm/data_mgmt.py
+5
-5
5 additions, 5 deletions
obis/src/python/obis/dm/data_mgmt.py
obis/src/python/obis/dm/git.py
+2
-3
2 additions, 3 deletions
obis/src/python/obis/dm/git.py
obis/src/python/obis/scripts/cli.py
+1
-1
1 addition, 1 deletion
obis/src/python/obis/scripts/cli.py
with
8 additions
and
9 deletions
obis/src/python/obis/dm/data_mgmt.py
+
5
−
5
View file @
f264fb37
...
...
@@ -83,7 +83,7 @@ class AbstractDataMgmt(metaclass=abc.ABCMeta):
return
@abc.abstractmethod
def
init_data
(
self
,
path
,
desc
=
None
,
create
=
True
):
def
init_data
(
self
,
desc
=
None
,
create
=
True
):
"""
Initialize a data repository at the path with the description.
:param path: Path for the repository.
:param desc: An optional short description of the repository (used by git-annex)
...
...
@@ -183,7 +183,7 @@ class NoGitDataMgmt(AbstractDataMgmt):
def
get_settings_resolver
(
self
):
self
.
error_raise
(
"
get settings resolver
"
,
"
No git command found.
"
)
def
init_data
(
self
,
path
,
desc
=
None
,
create
=
True
):
def
init_data
(
self
,
desc
=
None
,
create
=
True
):
self
.
error_raise
(
"
init data
"
,
"
No git command found.
"
)
def
init_analysis
(
self
,
path
,
parent
,
desc
=
None
,
create
=
True
,
apply_config
=
False
):
...
...
@@ -284,12 +284,12 @@ class GitDataMgmt(AbstractDataMgmt):
with
cd
(
relative_path
):
return
self
.
settings_resolver
.
repository
.
config_dict
().
get
(
'
id
'
)
def
init_data
(
self
,
relative_path
,
desc
=
None
,
create
=
True
,
apply_config
=
False
):
result
=
self
.
git_wrapper
.
git_init
(
relative_path
)
def
init_data
(
self
,
desc
=
None
,
create
=
True
,
apply_config
=
False
):
result
=
self
.
git_wrapper
.
git_init
()
if
result
.
failure
():
return
result
git_annex_backend
=
self
.
settings_resolver
.
config
.
config_dict
().
get
(
'
git_annex_backend
'
)
result
=
self
.
git_wrapper
.
git_annex_init
(
relative_path
,
desc
,
git_annex_backend
)
result
=
self
.
git_wrapper
.
git_annex_init
(
desc
,
git_annex_backend
)
if
result
.
failure
():
return
result
result
=
self
.
git_wrapper
.
initial_commit
()
...
...
This diff is collapsed.
Click to expand it.
obis/src/python/obis/dm/git.py
+
2
−
3
View file @
f264fb37
...
...
@@ -39,9 +39,8 @@ class GitWrapper(object):
return
True
# TODO remove path
def
git_init
(
self
,
path
):
def
git_init
(
self
):
return
self
.
_git
([
"
init
"
])
# return self._git(["init", path])
def
git_status
(
self
,
path
=
None
):
if
path
is
None
:
...
...
@@ -49,7 +48,7 @@ class GitWrapper(object):
else
:
return
self
.
_git
([
"
annex
"
,
"
status
"
,
path
],
strip_leading_whitespace
=
False
)
def
git_annex_init
(
self
,
path
,
desc
,
git_annex_backend
=
None
):
def
git_annex_init
(
self
,
desc
,
git_annex_backend
=
None
):
cmd
=
[
"
annex
"
,
"
init
"
,
"
--version=5
"
]
if
desc
is
not
None
:
cmd
.
append
(
desc
)
...
...
This diff is collapsed.
Click to expand it.
obis/src/python/obis/scripts/cli.py
+
1
−
1
View file @
f264fb37
...
...
@@ -59,7 +59,7 @@ def init_data_impl(ctx, repository, desc):
repository
=
"
.
"
click_echo
(
"
init_data {}
"
.
format
(
repository
))
desc
=
desc
if
desc
!=
""
else
None
return
ctx
.
obj
[
'
runner
'
].
run
(
"
init_data
"
,
lambda
dm
:
dm
.
init_data
(
repository
,
desc
,
create
=
True
),
repository
)
return
ctx
.
obj
[
'
runner
'
].
run
(
"
init_data
"
,
lambda
dm
:
dm
.
init_data
(
desc
,
create
=
True
),
repository
)
def
init_analysis_impl
(
ctx
,
parent
,
repository
,
description
):
...
...
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