Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import --fetch-jars: allow direct link #303

Merged
merged 3 commits into from
Dec 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/omero/plugins/import.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import sys
import shlex
import requests
import re
from zipfile import ZipFile


Expand Down Expand Up @@ -334,7 +335,7 @@ def add_python_argument(*args, **kwargs):
" Default: etc/logback-cli.xml")
add_python_argument(
"--fetch-jars", type=str,
help="Download this version of OMERO.java jars and exit")
help="Download OMERO.java jars by version or URL, then exit")

# The following arguments are strictly passed to Java
name_group = parser.add_argument_group(
Expand Down Expand Up @@ -575,8 +576,11 @@ def _userdir_jars(self, parentonly=False):
else:
return None, omero_java_txt

def download_omero_java(self, version):
omero_java_zip = OMERO_JAVA_ZIP.format(version=version)
def download_omero_java(self, version_or_uri):
if re.match("^\w+://", version_or_uri):
omero_java_zip = version_or_uri
else:
omero_java_zip = OMERO_JAVA_ZIP.format(version=version_or_uri)
self.ctx.err("Downloading %s" % omero_java_zip)
jars_dir, omero_java_txt = self._userdir_jars(parentonly=True)
jars_dir.makedirs_p()
Expand Down