Ejemplo n.º 1
0
            pass

        proc_args = tcl.eval('info args ' + func_name)

        for arg in proc_args.split():
            has_default = tcl.eval('info default %s %s vDefaultArg' %
                                   (func_name, arg))
            arg_fixed = fix_tcl_var(arg)

            # Args for executing
            tcl_args.append(arg)
            # Args for calling the TCL function
            pyc_args.append(arg_fixed)

            # If this argument has a default value
            if int(has_default) and tcl.getvar('vDefaultArg'):
                defaultArgFound = True
                # Args for comment
                tcl_args_long.append('%s {%s}' %
                                     (arg, str(tcl.getvar('vDefaultArg'))))
                # Args for defining Python functions
                pyc_args_long.append(
                    '%s=%s' % (arg_fixed, str(tcl_convert('vDefaultArg'))))
            else:
                tcl_args_long.append(arg)
                if not defaultArgFound:
                    pyc_args_long.append(arg_fixed)
                else:
                    defaultArgs.append(arg_fixed)
                    pyc_args_long.append('%s=None' % (arg_fixed))
Ejemplo n.º 2
0
        try: tcl.eval(func_name)
        except: pass

        proc_args = tcl.eval('info args ' + func_name)

        for arg in proc_args.split():
            has_default = tcl.eval('info default %s %s vDefaultArg' % (func_name, arg))
            arg_fixed = fix_tcl_var(arg)

            # Args for executing
            tcl_args.append(arg)
            # Args for calling the TCL function
            pyc_args.append(arg_fixed)

            # If this argument has a default value
            if int(has_default) and tcl.getvar('vDefaultArg'):
                defaultArgFound = True
                # Args for comment
                tcl_args_long.append('%s {%s}' % (arg, str(tcl.getvar('vDefaultArg'))))
                # Args for defining Python functions
                pyc_args_long.append('%s=%s' % (arg_fixed, str(tcl_convert('vDefaultArg'))))
            else:
                tcl_args_long.append(arg)
                if not defaultArgFound:
                    pyc_args_long.append(arg_fixed)
                else:
                    defaultArgs.append(arg_fixed)
                    pyc_args_long.append('%s=None' % (arg_fixed))

            # Reset variable for the next cycle
            tcl.eval('set vDefaultArg ""')