Module Import alias Import alias Import alias Import alias FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults body If UnaryOpNot Call AttributeLoad NameLoad attr Str body Raise Call NameLoad Str Assign NameStore ListLoad For NameStore NameLoad body Assign NameStore Call NameLoad NameLoad Str AugAssignAdd NameStore Call AttributeLoad Call AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Assign NameStore ListComp Call AttributeLoad NameLoad attr BinOpMod Str NameLoad comprehension NameStore NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore BoolOpOr NameLoad Str Assign NameStore IfExp NameLoad BinOpMod Str NameLoad Str Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad Assign NameStore Call NameLoad For NameStore NameLoad body If Call AttributeLoad NameLoad attr Str body AugAssignAdd NameStore BinOpAdd BinOpAdd Str NameLoad Str Continue orelse If Call AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr NameLoad Continue orelse If UnaryOpNot Call AttributeLoad NameLoad attr body AugAssignAdd NameStore Str Continue Assign NameStore Call AttributeLoad NameLoad attr NameLoad If BoolOpOr UnaryOpNot NameLoad CompareNotEq Call NameLoad SubscriptLoad NameLoad Index Num Num body Raise Call NameLoad BinOpMod Str NameLoad Assign NameStore Call NameLoad SubscriptLoad NameLoad Index Num Assign NameStore Call AttributeLoad SubscriptLoad NameLoad Index Num attr Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore IfExp Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str ListLoad Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore CompareEq Str SubscriptLoad NameLoad Index Num Assign NameStore BoolOpAnd UnaryOpNot NameLoad CompareEq NameLoad Str If NameLoad body Assign NameStore SubscriptLoad NameLoad Slice Num Assign NameStore BinOpMod Str TupleLoad NameLoad NameLoad orelse If NameLoad body Assign NameStore Str Assign NameStore BinOpMod Str NameLoad orelse If NameLoad body Assign NameStore BinOpMod Str NameLoad Assign NameStore BinOpMod Str NameLoad orelse Assign NameStore NameLoad Expr Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore ListLoad If BoolOpAnd UnaryOpNot NameLoad UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Assign NameStore ListLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body Assign NameStore BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpMod Str TupleLoad NameLoad Call AttributeLoad Str attr NameLoad If NameLoad body Assign NameStore BinOpMod Str TupleLoad NameLoad NameLoad orelse If NameLoad body Assign NameStore Str orelse If NameLoad body Assign NameStore BinOpMod Str NameLoad orelse Assign NameStore BinOpMod Str NameLoad If CompareEq NameLoad Str body Assign NameStore BinOpMod Str NameLoad orelse Assign NameStore BinOpMod Str NameLoad Assign NameStore Str Assign NameStore BinOpMod NameLoad TupleLoad NameLoad NameLoad Call AttributeLoad Str attr NameLoad NameLoad AugAssignAdd NameStore NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Str attr BinOpAdd ListComp BinOpMod Str NameLoad comprehension NameStore NameLoad NameLoad Assign NameStore Call AttributeLoad Str attr ListComp BinOpMod Str NameLoad comprehension NameStore NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad attr Str Str Assign NameStore Call NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list If CompareEq NameLoad Str body Expr Call NameLoad
N/A N/A os N/A re N/A sys N/A argparse wrap N/A N/A inFileNames outFileName exportSymbol exportHeader classNamePrefixes qtClassNamePrefixes moduleName N/A N/A N/A N/A N/A N/A outFileName endswith .h N/A N/A N/A Exception Error: output file extension must be .h N/A lines N/A N/A inFileName inFileNames N/A N/A inFile N/A open inFileName r N/A lines N/A N/A N/A N/A inFile read splitlines N/A N/A N/A inFile close N/A classNameRegexes N/A N/A N/A re compile N/A \b%s[a-zA-Z0-9]* prefix N/A prefix classNamePrefixes N/A qtClassNamePrefixes N/A tuple qtClassNamePrefixes N/A moduleName N/A moduleName PythonQt N/A exportInclude N/A exportHeader N/A #include "%s" exportHeader N/A generatedCode N/A str N/A rePattern N/A N/A re compile (?:(.+)\s+)?(\S+)::(\S+)\((.*)\).* N/A includeClasses N/A set N/A includeLines N/A list N/A line lines N/A N/A N/A N/A line startswith // N/A N/A generatedCode N/A N/A line N/A N/A N/A N/A N/A line startswith #include N/A N/A N/A N/A includeLines append line N/A N/A N/A N/A N/A N/A line strip N/A N/A generatedCode N/A N/A matchList N/A N/A rePattern findall line N/A N/A N/A matchList N/A N/A len N/A matchList N/A 0 4 N/A N/A N/A Exception N/A Failed to match: "%s" line N/A matchList N/A list N/A matchList N/A 0 N/A return_type N/A N/A N/A matchList N/A 0 strip N/A class_name N/A matchList N/A 1 N/A method_name N/A matchList N/A 2 N/A args N/A matchList N/A 3 N/A arg_list N/A N/A N/A args strip N/A N/A args split , N/A N/A is_static N/A N/A return_type startswith static  N/A is_destructor N/A ~ N/A method_name N/A 0 N/A is_constructor N/A N/A is_destructor N/A return_type N/A is_static N/A N/A return_type N/A return_type N/A 7 N/A decorator_method_name N/A static_%s_%s N/A class_name method_name N/A N/A is_destructor N/A N/A return_type void N/A decorator_method_name N/A delete_%s class_name N/A N/A is_constructor N/A N/A return_type N/A %s* class_name N/A decorator_method_name N/A new_%s class_name N/A N/A decorator_method_name method_name N/A N/A N/A includeClasses add class_name N/A regex classNameRegexes N/A N/A classname_matches N/A N/A regex findall return_type N/A classname classname_matches N/A N/A N/A N/A includeClasses add classname N/A wrap_args N/A N/A N/A N/A is_static N/A is_constructor N/A N/A N/A N/A wrap_args append N/A %s* inst class_name N/A wrap_args_call N/A N/A N/A i arg_type N/A enumerate arg_list N/A N/A arg_name N/A arg%d i N/A N/A N/A wrap_args append N/A %s %s N/A N/A N/A arg_type strip arg_name N/A N/A N/A wrap_args_call append arg_name N/A callStatement N/A %s(%s) N/A method_name N/A N/A ,  join wrap_args_call N/A is_static N/A N/A callStatement N/A %s::%s N/A class_name callStatement N/A N/A is_destructor N/A N/A callStatement delete inst N/A N/A is_constructor N/A N/A callStatement N/A new %s callStatement N/A N/A callStatement N/A inst->%s callStatement N/A N/A return_type void N/A N/A returnStatement N/A %s; callStatement N/A N/A returnStatement N/A return %s; callStatement N/A outStr 
  %s %s(%s)
    {
    %s
    }
 N/A outStr N/A outStr N/A return_type decorator_method_name N/A N/A ,  join wrap_args returnStatement N/A generatedCode outStr N/A sortedClasses N/A list includeClasses N/A N/A N/A sortedClasses sort N/A classIncludes N/A N/A join N/A N/A N/A #include "%s.h" className N/A className sortedClasses includeLines N/A classRegisters N/A N/A join N/A N/A     this->registerClassForPythonQt(&%s::staticMetaObject); className N/A className sortedClasses N/A N/A className startswith qtClassNamePrefixes N/A decoratorClassName N/A N/A N/A N/A N/A os path basename outFileName replace .h N/A outFile N/A open outFileName w N/A N/A N/A outFile write N/A 
#ifndef __%s_h
#define __%s_h

#include <QObject>
#include "PythonQt.h"

%s
%s

class %s %s : public QObject
{
  Q_OBJECT

public:

  %s(QObject* parent=0) : QObject(parent)
    {
%s
    }

  inline void registerClassForPythonQt(const QMetaObject* metaobject)
    {
    PythonQt::self()->registerClass(metaobject, "%s");
    }

public slots:

%s

};

#endif N/A decoratorClassName decoratorClassName exportInclude classIncludes exportSymbol decoratorClassName decoratorClassName classRegisters moduleName generatedCode N/A N/A N/A outFile close N/A main N/A N/A N/A N/A N/A parser N/A N/A argparse ArgumentParser description Generate a PythonQt decorator class file from a list of method signatures. N/A N/A N/A parser add_argument --input-file -i nargs + required True help A text file with method signatures, one per line. N/A N/A N/A parser add_argument --output-file -o required True help The output filename.  The file extension should be .h N/A N/A N/A parser add_argument --module-name default help The Python module name under which Qt classes will be registered. N/A N/A N/A parser add_argument --export-symbol default help An export symbol that will be added to the class declaration. N/A N/A N/A parser add_argument --export-header default help A header filename that defines an export symbol. N/A N/A N/A parser add_argument --class-prefixes nargs * help A list of class name prefixes. N/A N/A N/A parser add_argument --qt-class-prefixes nargs * help A list of Qt class name prefixes. N/A args N/A N/A parser parse_args N/A N/A wrap N/A args input_file N/A args output_file N/A args export_symbol N/A args export_header N/A args class_prefixes N/A args qt_class_prefixes N/A args module_name N/A N/A N/A __name__ __main__ N/A N/A N/A main