Skip to content

Commit

Permalink
misc minor style fixes & optimisations
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Aug 17, 2019
1 parent 093ad20 commit 3098460
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ innosetup/config.ini
*.exe

.coverage
.coverage.*

*.swp

Expand Down
16 changes: 8 additions & 8 deletions dvc/remote/local/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,8 @@ def status(

return ret

def _fill_statuses(self, checksum_info_dir, local_exists, remote_exists):
@staticmethod
def _fill_statuses(checksum_info_dir, local_exists, remote_exists):
# Using sets because they are way faster for lookups
local = set(local_exists)
remote = set(remote_exists)
Expand Down Expand Up @@ -436,18 +437,17 @@ def pull(self, checksum_infos, remote, jobs=None, show_checksums=False):
download=True,
)

def _log_missing_caches(self, checksum_info_dict):
@staticmethod
def _log_missing_caches(checksum_info_dict):
missing_caches = [
(md5, info)
for md5, info in checksum_info_dict.items()
if info["status"] == STATUS_MISSING
]
if missing_caches:
missing_desc = "".join(
[
"\nname: {}, md5: {}".format(info["name"], md5)
for md5, info in missing_caches
]
"\nname: {}, md5: {}".format(info["name"], md5)
for md5, info in missing_caches
)
msg = (
"Some of the cache files do not exist neither locally "
Expand Down Expand Up @@ -479,8 +479,8 @@ def _unprotect_file(path):
os.chmod(path, os.stat(path).st_mode | stat.S_IWRITE)

def _unprotect_dir(self, path):
for path in walk_files(path, self.repo.dvcignore):
RemoteLOCAL._unprotect_file(path)
for fname in walk_files(path, self.repo.dvcignore):
RemoteLOCAL._unprotect_file(fname)

def unprotect(self, path_info):
path = path_info.fspath
Expand Down
2 changes: 1 addition & 1 deletion dvc/remote/ssh/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def ssh_config_filename():
@staticmethod
def _load_user_ssh_config(hostname):
user_config_file = RemoteSSH.ssh_config_filename()
user_ssh_config = dict()
user_ssh_config = {}
if hostname and os.path.exists(user_config_file):
ssh_config = paramiko.SSHConfig()
with open(user_config_file) as f:
Expand Down

0 comments on commit 3098460

Please sign in to comment.