hound fixes

This commit is contained in:
Ondrej Samohel 2020-10-09 16:14:59 +02:00
parent da3c0d73f4
commit a5c8b24988
No known key found for this signature in database
GPG key ID: 8A29C663C672C2B7
6 changed files with 10 additions and 10 deletions

View file

@ -75,12 +75,13 @@ class BootstrapRepos:
self._log.info(f"creating zip: {temp_zip}")
BootstrapRepos._create_pype_zip(
temp_zip, self.live_repo_dir, progress_callback=progress_callback)
temp_zip, self.live_repo_dir,
progress_callback=progress_callback)
if not os.path.exists(temp_zip):
self._log.error("make archive failed.")
return None
destination = self.data_dir / temp_zip.name
destination = self.data_dir / temp_zip.name
if destination.exists():
self._log.warning(
@ -255,4 +256,6 @@ class BootstrapRepos:
def process_entered_path(self, location: str) -> str:
pype_path = None
if location.startswith("mongodb"):
self._get_pype_from_mongo(location)
pype_path = self._get_pype_from_mongo(location)
return pype_path

View file

@ -2,7 +2,6 @@
"""Show dialog for choosing central pype repository."""
import sys
import os
import re
from Qt import QtCore, QtGui, QtWidgets
from Qt.QtGui import QValidator

View file

@ -1,9 +1,7 @@
# -*- coding: utf-8 -*-
"""Working thread for installer."""
import sys
import os
from Qt.QtCore import QThread, Signal
from pype import settings
from igniter.tools import load_environments
from .bootstrap_repos import BootstrapRepos

View file

@ -58,7 +58,7 @@ def validate_path_string(path: str) -> (bool, str):
# test for uuid
try:
uuid.UUID(path)
except ValueError as e:
except ValueError:
# not uuid
if not os.path.exists(path):
return False, "Path doesn't exist or invalid token"

View file

@ -40,7 +40,6 @@ import sys
import os
import re
import traceback
from pathlib import Path
from igniter.tools import load_environments
try:
@ -55,7 +54,7 @@ def set_environments() -> None:
env = load_environments()
env = acre.merge(env, dict(os.environ))
os.environ.clear()
os.environ = env
os.environ.update(env)
def boot():
@ -192,4 +191,5 @@ def print_info() -> None:
t.echo("... {}:{}[ {} ]".format(info[0], " " * padding, info[1]))
print('\n')
boot()

View file

@ -8,6 +8,7 @@ import appdirs
from igniter.bootstrap_repos import BootstrapRepos
from pype.lib import PypeSettingsRegistry
@pytest.fixture
def fix_bootstrap(tmp_path):
bs = BootstrapRepos()
@ -117,4 +118,3 @@ def test_find_pype(fix_bootstrap, tmp_path_factory, monkeypatch, printer):
assert list(result.values())[-1] == Path(
r_path / test_versions_2[0]
), "not a latest version of Pype 2"