Package omero :: Package plugins :: Module download
[hide private]
[frames] | no frames]

Source Code for Module omero.plugins.download

 1  #!/usr/bin/env python 
 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  from omero.cli import BaseControl 
14   
15 -class DownloadControl(BaseControl):
16
17 - def help(self, args = None):
18 self.ctx.out( 19 """ 20 Syntax: %(program_name)s download <id> <filename> 21 Download the given file id to the given file name 22 """ )
23
24 - def __call__(self, *args):
25 id = 1 26 file = "foo" 27 28 client = self.ctx.conn() 29 session = client.getSession() 30 filePrx = session.createRawFileStore() 31 filePrx.setFileId(id) 32 fileSize = filePrx.getSize()
33 34 try: 35 register("download", DownloadControl) 36 except NameError: 37 DownloadControl()._main() 38