diff --git a/src/omero/cli.py b/src/omero/cli.py index 976e56413..e6503fd25 100755 --- a/src/omero/cli.py +++ b/src/omero/cli.py @@ -1646,7 +1646,7 @@ def loadplugins(self): def loadpath(self, pathobj): if pathobj.isdir(): - for plugin in pathobj.walkfiles("*.py"): + for plugin in sorted(pathobj.walkfiles("*.py")): if -1 == plugin.find("#"): # Omit emacs files self.loadpath(path(plugin)) else: diff --git a/src/omero/plugins/metadata.py b/src/omero/plugins/_metadata_deprecated.py similarity index 96% rename from src/omero/plugins/metadata.py rename to src/omero/plugins/_metadata_deprecated.py index b5a2ca290..496337aa3 100755 --- a/src/omero/plugins/metadata.py +++ b/src/omero/plugins/_metadata_deprecated.py @@ -40,6 +40,10 @@ GUI clients. """ +DEPRECATION_MESSAGE = ( + "This plugin is deprecated as of OMERO 5.4.8. Use the plugin" + " available from https://pypi.org/project/omero-metadata/" + " instead.") ANNOTATION_TYPES = [t for t in dir(omero.model) if re.match(r'[A-Za-z0-9]+Annotation$', t)] @@ -285,6 +289,7 @@ def _format_ann(self, md, obj, indent=None): def summary(self, args): "Provide a general summary of available metadata" + self.ctx.err(DEPRECATION_MESSAGE, DeprecationWarning) md = self._load(args) name = md.get_name() line = "-" * len(name) @@ -332,6 +337,7 @@ def summary(self, args): def original(self, args): "Print the original metadata in ini format" + self.ctx.err(DEPRECATION_MESSAGE, DeprecationWarning) md = self._load(args) try: source, global_om, series_om = md.get_original() @@ -370,6 +376,7 @@ def _output_ann(self, mdobj, func, parents, indent): def bulkanns(self, args): ("Provide a list of the NSBULKANNOTATION tables linked " "to the given object") + self.ctx.err(DEPRECATION_MESSAGE, DeprecationWarning) md = self._load(args) indent = None if args.report: @@ -380,6 +387,7 @@ def bulkanns(self, args): def measures(self, args): ("Provide a list of the NSMEASUREMENT tables linked " "to the given object") + self.ctx.err(DEPRECATION_MESSAGE, DeprecationWarning) md = self._load(args) indent = None if args.report: @@ -394,7 +402,7 @@ def get_anns(md): if args.nsre and not re.match(args.nsre, a.get_ns()): continue yield a - + self.ctx.err(DEPRECATION_MESSAGE, DeprecationWarning) md = self._load(args) indent = None if args.report: @@ -408,7 +416,7 @@ def get_anns(md): if args.nsre and not re.match(args.nsre, a.get_ns()): continue yield a - + self.ctx.err(DEPRECATION_MESSAGE, DeprecationWarning) md = self._load(args) indent = None if args.report: @@ -417,6 +425,7 @@ def get_anns(md): def testtables(self, args): "Tests whether tables can be created and initialized" + self.ctx.err(DEPRECATION_MESSAGE, DeprecationWarning) client, conn = self._clientconn(args) sf = client.getSession() @@ -449,6 +458,7 @@ def testtables(self, args): def populate(self, args): "Add metadata (bulk-annotations) to an object" + self.ctx.err(DEPRECATION_MESSAGE, DeprecationWarning) md = self._load(args) client, conn = self._clientconn(args) # TODO: Configure logging properly @@ -500,6 +510,7 @@ def populate(self, args): def rois(self, args): "Manage ROIs" + self.ctx.err(DEPRECATION_MESSAGE, DeprecationWarning) md = self._load(args) if args.delete: graphspec = "/%s/Roi:%d" % (md.get_type(), md.get_id()) @@ -545,6 +556,7 @@ def rois(self, args): def populateroi(self, args): "Add ROIs to an object" + self.ctx.err(DEPRECATION_MESSAGE, DeprecationWarning) md = self._load(args) client = self.ctx.conn(args) # TODO: Configure logging properly @@ -574,6 +586,7 @@ def populateroi(self, args): def pixelsize(self, args): "Set physical pixel size" + self.ctx.err(DEPRECATION_MESSAGE, DeprecationWarning) if not args.x and not args.y and not args.z: self.ctx.die(100, "No pixel sizes specified.") @@ -635,11 +648,7 @@ def pixelsize(self, args): try: if "OMERO_DEV_PLUGINS" in os.environ: - warnings.warn( - "This module is deprecated as of OMERO 5.4.8. Use the metadata" - " CLI plugin available from" - " https://pypi.org/project/omero-metadata/ instead.", - DeprecationWarning) + warnings.warn(DEPRECATION_MESSAGE, DeprecationWarning) register("metadata", MetadataControl, HELP) except NameError: if __name__ == "__main__": diff --git a/src/omero/plugins/upload.py b/src/omero/plugins/_upload_deprecated.py similarity index 94% rename from src/omero/plugins/upload.py rename to src/omero/plugins/_upload_deprecated.py index 022085afd..94e0ded1e 100755 --- a/src/omero/plugins/upload.py +++ b/src/omero/plugins/_upload_deprecated.py @@ -53,7 +53,7 @@ def _configure(self, parser): 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/" + " available from https://pypi.org/project/omero-upload/" " instead.", DeprecationWarning) client = self.ctx.conn(args) objIds = [] @@ -76,7 +76,7 @@ def upload(self, args): 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.", + " https://pypi.org/project/omero-upload/ instead.", DeprecationWarning) register("upload", UploadControl, HELP) except NameError: