Commit e7965eec authored by Thibault Saunier's avatar Thibault Saunier

pitivi-flatpak: Handle new `flatpak remote-list -d` output

Spaces are now `\t` so handle them as if they were spaces when
looking for remotes urls.
parent ac08dad0
Pipeline #6341 passed with stage
in 105 minutes and 19 seconds
......@@ -198,22 +198,27 @@ class FlatpakRepos(FlatpakObject):
repo_defs = [rd for rd in
self.flatpak("remote-list", "-d").split("\n") if rd]
for repo in repo_defs:
components = repo.split(" ")
name = components[0]
desc = ""
url = None
for elem in components[1:]:
if not elem:
continue
parsed_url = urlparse(elem)
if parsed_url.scheme:
url = elem
for components in [repo.split(" "), repo.split("\t")]:
if len(components) == 1:
components = repo.split("\t")
name = components[0]
desc = ""
url = None
for elem in components[1:]:
if not elem:
continue
parsed_url = urlparse(elem)
if parsed_url.scheme:
url = elem
break
if desc:
desc += " "
desc += elem
if url:
break
if desc:
desc += " "
desc += elem
if not url:
Console.message("No valid URI found for: %s", repo)
continue
......@@ -442,7 +447,8 @@ class PitiviFlatpak: # pylint: disable=too-many-instance-attributes
if self.check:
self.run_in_sandbox("gst-validate-launcher",
os.path.join(self.topdir, "tests/ptv_testsuite.py"),
os.path.join(
self.topdir, "tests/ptv_testsuite.py"),
"--xunit-file", "xunit.xml", exit_on_failure=True,
cwd=self.topdir)
......@@ -527,13 +533,15 @@ class PitiviFlatpak: # pylint: disable=too-many-instance-attributes
def install_development_tools(self):
venv_path = os.path.join(self.scriptdir, "pyvenv")
Console.message("Setting up a Python virtual env for development: %s", venv_path)
Console.message(
"Setting up a Python virtual env for development: %s", venv_path)
if not os.path.isdir(venv_path):
venv.create(venv_path, with_pip=True)
activate_script = os.path.join(venv_path, "bin", "activate")
pip_modules = "pre-commit git-pylint-commit-hook git_pep8_commit_hook pylint"
Console.message("Installing development tools in the Python virtual env: %s", pip_modules)
Console.message(
"Installing development tools in the Python virtual env: %s", pip_modules)
subprocess.check_call(
". %s && pip install -U %s" % (activate_script, pip_modules),
shell=True)
......@@ -543,7 +551,8 @@ class PitiviFlatpak: # pylint: disable=too-many-instance-attributes
# installed in the development pyvenv which is outside the sandbox
# because git-pylint-commit-hook needs to import pylint.config.
pip_modules = ["pylint"]
Console.message("Installing development tools in the sandbox: %s", pip_modules)
Console.message(
"Installing development tools in the sandbox: %s", pip_modules)
self.run_in_sandbox("pip3", "install", "-U", "--user", *pip_modules,
exit_on_failure=True)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment