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

Source Code for Module omero.plugins.prefs

 1  #!/usr/bin/env python 
 2  """ 
 3     prefs 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     The pref plugin makes use of prefs.class from the common component. 
 9   
10     Copyright 2007 Glencoe Software, Inc. All rights reserved. 
11     Use is subject to license terms supplied in LICENSE.txt 
12   
13  """ 
14   
15  from exceptions import Exception 
16  from omero.cli import BaseControl 
17  from omero_ext.strings import shlex 
18  import omero.java 
19   
20 -def getprefs(args, dir):
21 if not isinstance(args,list): 22 raise Exception("Not a list") 23 cmd = ["prefs"]+list(args) 24 return omero.java.run(cmd, chdir=dir)
25
26 -class PrefsControl(BaseControl):
27
28 - def help(self, args = None):
29 self.ctx.out( """ 30 Syntax: %(program_name)s prefs 31 Access to java properties 32 """ )
33
34 - def __call__(self, *args):
35 args = Arguments(*args) 36 dir = self.ctx.dir / "lib" 37 self.ctx.out(getprefs(args.args, str(dir)))
38 39 try: 40 register("config", PrefsControl) 41 except NameError: 42 PrefsControl()._main() 43