Skip to content

Commit

Permalink
Merge pull request #5956 from sbesson/cli_upload_deprecation
Browse files Browse the repository at this point in the history
Deprecate the CLI upload module and plugin
  • Loading branch information
jburel authored Jun 7, 2019
2 parents 4f16aa2 + f510560 commit b81e660
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion components/tools/OmeroPy/src/omero/plugins/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import sys
import re
import path
import os
import warnings
import mimetypes

from omero.cli import BaseControl, CLI
Expand Down Expand Up @@ -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:
Expand All @@ -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()
Expand Down

0 comments on commit b81e660

Please sign in to comment.