diff --git a/components/tools/OmeroPy/src/omero/plugins/upload.py b/components/tools/OmeroPy/src/omero/plugins/upload.py index 762245f0691..3bb81cf9913 100755 --- a/components/tools/OmeroPy/src/omero/plugins/upload.py +++ b/components/tools/OmeroPy/src/omero/plugins/upload.py @@ -14,6 +14,8 @@ import sys import re import path +import os +import warnings import mimetypes from omero.cli import BaseControl, CLI @@ -49,6 +51,10 @@ def _configure(self, parser): parser.add_login_arguments() def upload(self, args): + self.ctx.err( + "This module is deprecated as of OMERO 5.5.0. Use the module" + " available from https://pypi.org/project/omero-cli-upload/" + " instead.", DeprecationWarning) client = self.ctx.conn(args) objIds = [] for file in args.file: @@ -66,7 +72,13 @@ def upload(self, args): self.ctx.out("OriginalFile:%s" % objIds) try: - register("upload", UploadControl, HELP) + if "OMERO_NO_DEPRECATED_PLUGINS" not in os.environ: + warnings.warn( + "This plugin is deprecated as of OMERO 5.5.0. Use the upload" + " CLI plugin available from" + " https://pypi.org/project/omero-cli-upload/ instead.", + DeprecationWarning) + register("upload", UploadControl, HELP) except NameError: if __name__ == "__main__": cli = CLI()