1
2 """
3 download plugin
4
5 Plugin read by omero.cli.Cli during initialization. The method(s)
6 defined here will be added to the Cli class for later use.
7
8 Copyright 2007 Glencoe Software, Inc. All rights reserved.
9 Use is subject to license terms supplied in LICENSE.txt
10
11 """
12
13 import sys
14 from omero.cli import BaseControl, CLI
15
16 HELP = """Download the given file id to the given filename"""
17
19
24
26 from omero_model_OriginalFileI import OriginalFileI as OFile
27
28 orig_file = OFile(long(args.id))
29 target_file = str(args.filename)
30
31 client = self.ctx.conn(args)
32 client.download(orig_file, target_file)
33
34 try:
35 register("download", DownloadControl, HELP)
36 except NameError:
37 if __name__ == "__main__":
38 cli = CLI()
39 cli.register("download", DownloadControl, HELP)
40 cli.invoke(sys.argv[1:])
41