Hi there Does anyone know why this works fine using zshell: find Control_Panel --type "DataSkin Attribute Property Sheet" while this (from a Script (Python)) returns nothing? objs = context.ZopeFind( context.Control_Panel.Products.ZCrm, obj_metatypes=['DataSkin Attribute Property Sheet', ], search_sub=1) -- Jean Jordaan Upfront Systems http://www.upfrontsystems.co.za
On Thu, Jun 13, 2002 at 02:46:00PM +0200, Jean Jordaan wrote:
Does anyone know why this works fine using zshell:
find Control_Panel --type "DataSkin Attribute Property Sheet"
if this is a ZClass, then ZClasses have callable meta types, so maybe ZopeFind doesn't take care of that. see ZShell's getMetaType() method, and check with what ZopeFind does. hth. Jerome Alet
Hi Jerome I'm very happy with the following, which calls 'lsprop' on a list of propertysheets:: commands = {} for ps in propertysheets: commands[ps] = 'lsprop %s'%ps results = {} for key in commands.keys(): xmlrpcstuff = { 'path': '/', 'result_type': 'text', 'command': commands[key] } out = context.zshell(xmlrpcstuff=xmlrpcstuff) results[key] = out['data'].split('\n')[:-1] It seems that zshell's 'text' output format is less rich than its HTML output -- the difference between 'MyShell.get_stdout()' (returns only property names) and 'MyShell.get_HTML()' (returns type and value as well). I made this change (assuming that stdout can be parsed tab-seperated-value-like), in case you want to consider it: --- /tmp/zshell.py.orig Thu Jun 13 15:53:14 2002 +++ zshell.py Thu Jun 13 15:51:38 2002 @@ -3407,7 +3407,8 @@ propvalue = repr(object.getProperty(prop["id"], 'Error')) results.append({"Property": propid, "Type": proptype, "Value": propvalue, "Mode": propmode}) - self.printf("%s" % propid) + self.printf("%s\t%s\t%s\t%s\n" % (propid, proptype, propvalue, propmode)) + self.tableDisplay("lsprop", ["Property", "Type", "Value", "Mode"], results) return status -- Jean Jordaan Upfront Systems http://www.upfrontsystems.co.za
participants (2)
-
Jean Jordaan -
Jerome Alet