mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-06 23:09:55 +01:00
reduce cognitive complexity of _local_status
This commit is contained in:
+10
-6
@@ -10,14 +10,9 @@ from . import locked
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def _local_status(self, targets=None, with_deps=False):
|
||||
def _joint_status(stages):
|
||||
status = {}
|
||||
|
||||
if targets:
|
||||
stages = cat(self.collect(t, with_deps=with_deps) for t in targets)
|
||||
else:
|
||||
stages = self.collect(None, with_deps=with_deps)
|
||||
|
||||
for stage in stages:
|
||||
if stage.locked and not stage.is_repo_import:
|
||||
logger.warning(
|
||||
@@ -32,6 +27,15 @@ def _local_status(self, targets=None, with_deps=False):
|
||||
return status
|
||||
|
||||
|
||||
def _local_status(self, targets=None, with_deps=False):
|
||||
if targets:
|
||||
stages = cat(self.collect(t, with_deps=with_deps) for t in targets)
|
||||
else:
|
||||
stages = self.collect(None, with_deps=with_deps)
|
||||
|
||||
return _joint_status(stages)
|
||||
|
||||
|
||||
def _cloud_status(
|
||||
self,
|
||||
targets=None,
|
||||
|
||||
Reference in New Issue
Block a user