Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Python example of ReflectFunctionHandler, etc

Mike Wolfe
2010-12-17
2013-04-17
  • Mike Wolfe
    Mike Wolfe
    2010-12-17

    First off, awesome work.

    I'm trying to get some things working using the native Python server.  The Java example shows examples for the following handlers: ReflectFunctionHandler(), FunctionInformationFunctionHandler(), and CompositeFunctionHandler().   The included python example files don't seem to show these (unless I'm just missing something).  Is this functionality available using Python and if so could someone provide a brief example?

    Thanks,
    Mike

            // Create a reflection function handler and add the Math methods
            ReflectFunctionHandler rfh = new ReflectFunctionHandler();
            rfh.addMethods("Math.", Math.class);
            rfh.addMethods("Math.", Maths.class);
            rfh.addMethods("CSV.", CSV.class);
            rfh.addMethods("Reflect.", Reflect.class);
            // Create a function information handler to register our functions
            FunctionInformationFunctionHandler firh = new FunctionInformationFunctionHandler();
            firh.add(rfh.getFunctions());
            // Set the handlers
            CompositeFunctionHandler cfh = new CompositeFunctionHandler();
            cfh.add(rfh);
            cfh.add(firh);
            fs.setFunctionHandler(new DebugFunctionHandler(cfh));
    
     
  • Mike Wolfe
    Mike Wolfe
    2010-12-23

    That worked! Thanks.