示例#1
0
PyMODINIT_FUNC initmedcoin_hybrid(void) {
    (void) Py_InitModule("medcoin_hybrid", ScryptMethods);
}
示例#2
0
PyMODINIT_FUNC init5422a3dec735a78746c65b95ef4de399(void){
   import_array();
   (void) Py_InitModule("5422a3dec735a78746c65b95ef4de399", MyMethods);
}
示例#3
0
文件: _webp.c 项目: dvska/Pillow
PyMODINIT_FUNC
init_webp(void)
{
    PyObject* m = Py_InitModule("_webp", webpMethods);
    setup_module(m);
}
示例#4
0
文件: zlibextras.c 项目: cmsdaq/hltd
PyMODINIT_FUNC initzlibextras(void)
{
    (void) Py_InitModule("zlibextras", ZlibExtrasMethods);
}
示例#5
0
PyMODINIT_FUNC
inithungarian(void)
{
  (void) Py_InitModule("hungarian", HungarianMethods);
  import_array();
}
示例#6
0
PyMODINIT_FUNC initutil(void) {
    (void) Py_InitModule("compass.util", compass_util_methods);
}
示例#7
0
PyMODINIT_FUNC init70420f6d255528e496b6dcec592c9bfd(void){
   import_array();
   (void) Py_InitModule("70420f6d255528e496b6dcec592c9bfd", MyMethods);
}
示例#8
0
PyMODINIT_FUNC init_pyfs(void)
{
    (void) Py_InitModule("_pyfs", pyfsMethods);
}
示例#9
0
/*
 * Python calls this to let us initialize our module
 */
void initTCR_module(void)
{
	(void) Py_InitModule("TCR_module", TCR_methods);
}
示例#10
0
PyMODINIT_FUNC init78d2ae1ecd52ae272965fb280fc1bbcb(void){
   import_array();
   (void) Py_InitModule("78d2ae1ecd52ae272965fb280fc1bbcb", MyMethods);
}
示例#11
0
PyMODINIT_FUNC
init_billiard(void)
{
    PyObject *module, *temp, *value;

    /* Initialize module */
    module = Py_InitModule("_billiard", Billiard_module_methods);
    if (!module)
        return;

    /* Get copy of objects from pickle */
    temp = PyImport_ImportModule(PICKLE_MODULE);
    if (!temp)
        return;
    Billiard_pickle_dumps = PyObject_GetAttrString(temp, "dumps");
    Billiard_pickle_loads = PyObject_GetAttrString(temp, "loads");
    Billiard_pickle_protocol = PyObject_GetAttrString(temp, "HIGHEST_PROTOCOL");
    Py_XDECREF(temp);

    /* Get copy of BufferTooShort */
    temp = PyImport_ImportModule("billiard");
    if (!temp)
        return;
    Billiard_BufferTooShort = PyObject_GetAttrString(temp, "BufferTooShort");
    Py_XDECREF(temp);

    /* Add connection type to module */
    if (PyType_Ready(&BilliardConnectionType) < 0)
        return;
    Py_INCREF(&BilliardConnectionType);
    PyModule_AddObject(module, "Connection", (PyObject*)&BilliardConnectionType);

#if defined(MS_WINDOWS) ||                                              \
  (defined(HAVE_SEM_OPEN) && !defined(POSIX_SEMAPHORES_NOT_ENABLED))
    /* Add SemLock type to module */
    if (PyType_Ready(&BilliardSemLockType) < 0)
        return;
    Py_INCREF(&BilliardSemLockType);
    PyDict_SetItemString(BilliardSemLockType.tp_dict, "SEM_VALUE_MAX",
                         Py_BuildValue("i", SEM_VALUE_MAX));
    PyModule_AddObject(module, "SemLock", (PyObject*)&BilliardSemLockType);
#endif

#ifdef MS_WINDOWS
    /* Add PipeConnection to module */
    if (PyType_Ready(&BilliardPipeConnectionType) < 0)
        return;
    Py_INCREF(&BilliardPipeConnectionType);
    PyModule_AddObject(module, "PipeConnection",
                       (PyObject*)&BilliardPipeConnectionType);

    /* Initialize win32 class and add to multiprocessing */
    temp = create_win32_namespace();
    if (!temp)
        return;
    PyModule_AddObject(module, "win32", temp);

    /* Initialize the event handle used to signal Ctrl-C */
    sigint_event = CreateEvent(NULL, TRUE, FALSE, NULL);
    if (!sigint_event) {
        PyErr_SetFromWindowsErr(0);
        return;
    }
    if (!SetConsoleCtrlHandler(ProcessingCtrlHandler, TRUE)) {
        PyErr_SetFromWindowsErr(0);
        return;
    }
#endif

    /* Add configuration macros */
    temp = PyDict_New();
    if (!temp)
        return;
#define ADD_FLAG(name)                                            \
    value = Py_BuildValue("i", name);                             \
    if (value == NULL) { Py_DECREF(temp); return; }               \
    if (PyDict_SetItemString(temp, #name, value) < 0) {           \
        Py_DECREF(temp); Py_DECREF(value); return; }              \
    Py_DECREF(value)

#if defined(HAVE_SEM_OPEN) && !defined(POSIX_SEMAPHORES_NOT_ENABLED)
    ADD_FLAG(HAVE_SEM_OPEN);
#endif
#ifdef HAVE_SEM_TIMEDWAIT
    ADD_FLAG(HAVE_SEM_TIMEDWAIT);
#endif
#ifdef HAVE_FD_TRANSFER
    ADD_FLAG(HAVE_FD_TRANSFER);
#endif
#ifdef HAVE_BROKEN_SEM_GETVALUE
    ADD_FLAG(HAVE_BROKEN_SEM_GETVALUE);
#endif
#ifdef HAVE_BROKEN_SEM_UNLINK
    ADD_FLAG(HAVE_BROKEN_SEM_UNLINK);
#endif
    if (PyModule_AddObject(module, "flags", temp) < 0)
        return;
}
示例#12
0
PyMODINIT_FUNC
INIT_MODULE(_psycopg)(void)
{
#if PY_VERSION_HEX < 0x03020000
    static void *PSYCOPG_API[PSYCOPG_API_pointers];
    PyObject *c_api_object;
#endif

    PyObject *module = NULL, *dict;

#ifdef PSYCOPG_DEBUG
    if (getenv("PSYCOPG_DEBUG"))
        psycopg_debug_enabled = 1;
#endif

    Dprintf("initpsycopg: initializing psycopg %s", PSYCOPG_VERSION);

    /* initialize all the new types and then the module */
    Py_TYPE(&connectionType) = &PyType_Type;
    Py_TYPE(&cursorType)     = &PyType_Type;
    Py_TYPE(&typecastType)   = &PyType_Type;
    Py_TYPE(&qstringType)    = &PyType_Type;
    Py_TYPE(&binaryType)     = &PyType_Type;
    Py_TYPE(&isqlquoteType)  = &PyType_Type;
    Py_TYPE(&pbooleanType)   = &PyType_Type;
    Py_TYPE(&pintType)       = &PyType_Type;
    Py_TYPE(&pfloatType)     = &PyType_Type;
    Py_TYPE(&pdecimalType)   = &PyType_Type;
    Py_TYPE(&asisType)       = &PyType_Type;
    Py_TYPE(&listType)       = &PyType_Type;
    Py_TYPE(&chunkType)      = &PyType_Type;
    Py_TYPE(&NotifyType)     = &PyType_Type;
    Py_TYPE(&XidType)        = &PyType_Type;

    if (PyType_Ready(&connectionType) == -1) goto exit;
    if (PyType_Ready(&cursorType) == -1) goto exit;
    if (PyType_Ready(&typecastType) == -1) goto exit;
    if (PyType_Ready(&qstringType) == -1) goto exit;
    if (PyType_Ready(&binaryType) == -1) goto exit;
    if (PyType_Ready(&isqlquoteType) == -1) goto exit;
    if (PyType_Ready(&pbooleanType) == -1) goto exit;
    if (PyType_Ready(&pintType) == -1) goto exit;
    if (PyType_Ready(&pfloatType) == -1) goto exit;
    if (PyType_Ready(&pdecimalType) == -1) goto exit;
    if (PyType_Ready(&asisType) == -1) goto exit;
    if (PyType_Ready(&listType) == -1) goto exit;
    if (PyType_Ready(&chunkType) == -1) goto exit;
    if (PyType_Ready(&NotifyType) == -1) goto exit;
    if (PyType_Ready(&XidType) == -1) goto exit;

#ifdef PSYCOPG_EXTENSIONS
    Py_TYPE(&lobjectType)    = &PyType_Type;
    if (PyType_Ready(&lobjectType) == -1) goto exit;
#endif

    /* import mx.DateTime module, if necessary */
#ifdef HAVE_MXDATETIME
    Py_TYPE(&mxdatetimeType) = &PyType_Type;
    if (PyType_Ready(&mxdatetimeType) == -1) goto exit;
    if (0 != mxDateTime_ImportModuleAndAPI()) {
        PyErr_Clear();

        /* only fail if the mx typacaster should have been the default */
#ifdef PSYCOPG_DEFAULT_MXDATETIME
        PyErr_SetString(PyExc_ImportError,
            "can't import mx.DateTime module (requested as default adapter)");
        goto exit;
#endif
    }
#endif

    /* import python builtin datetime module, if available */
    pyDateTimeModuleP = PyImport_ImportModule("datetime");
    if (pyDateTimeModuleP == NULL) {
        Dprintf("initpsycopg: can't import datetime module");
        PyErr_SetString(PyExc_ImportError, "can't import datetime module");
        goto exit;
    }

    /* Initialize the PyDateTimeAPI everywhere is used */
    PyDateTime_IMPORT;
    if (psyco_adapter_datetime_init()) { goto exit; }

    Py_TYPE(&pydatetimeType) = &PyType_Type;
    if (PyType_Ready(&pydatetimeType) == -1) goto exit;

    /* import psycopg2.tz anyway (TODO: replace with C-level module?) */
    pyPsycopgTzModule = PyImport_ImportModule("psycopg2.tz");
    if (pyPsycopgTzModule == NULL) {
        Dprintf("initpsycopg: can't import psycopg2.tz module");
        PyErr_SetString(PyExc_ImportError, "can't import psycopg2.tz module");
        goto exit;
    }
    pyPsycopgTzLOCAL =
        PyObject_GetAttrString(pyPsycopgTzModule, "LOCAL");
    pyPsycopgTzFixedOffsetTimezone =
        PyObject_GetAttrString(pyPsycopgTzModule, "FixedOffsetTimezone");

    /* initialize the module and grab module's dictionary */
#if PY_MAJOR_VERSION < 3
    module = Py_InitModule("_psycopg", psycopgMethods);
#else
    module = PyModule_Create(&psycopgmodule);
#endif
    if (!module) { goto exit; }

    dict = PyModule_GetDict(module);

    /* initialize all the module's exported functions */
    /* PyBoxer_API[PyBoxer_Fake_NUM] = (void *)PyBoxer_Fake; */

    /* Create a CObject containing the API pointer array's address */
    /* If anybody asks for a PyCapsule we'll deal with it. */
#if PY_VERSION_HEX < 0x03020000
    c_api_object = PyCObject_FromVoidPtr((void *)PSYCOPG_API, NULL);
    if (c_api_object != NULL)
        PyModule_AddObject(module, "_C_API", c_api_object);
#endif

    /* other mixed initializations of module-level variables */
    if (!(psycoEncodings = PyDict_New())) { goto exit; }
    if (0 != psyco_encodings_fill(psycoEncodings)) { goto exit; }
    psyco_null = Bytes_FromString("NULL");
    if (!(psyco_DescriptionType = psyco_make_description_type())) { goto exit; }

    /* set some module's parameters */
    PyModule_AddStringConstant(module, "__version__", PSYCOPG_VERSION);
    PyModule_AddStringConstant(module, "__doc__", "psycopg PostgreSQL driver");
    PyModule_AddObject(module, "apilevel", Text_FromUTF8(APILEVEL));
    PyModule_AddObject(module, "threadsafety", PyInt_FromLong(THREADSAFETY));
    PyModule_AddObject(module, "paramstyle", Text_FromUTF8(PARAMSTYLE));

    /* put new types in module dictionary */
    PyModule_AddObject(module, "connection", (PyObject*)&connectionType);
    PyModule_AddObject(module, "cursor", (PyObject*)&cursorType);
    PyModule_AddObject(module, "ISQLQuote", (PyObject*)&isqlquoteType);
    PyModule_AddObject(module, "Notify", (PyObject*)&NotifyType);
    PyModule_AddObject(module, "Xid", (PyObject*)&XidType);
#ifdef PSYCOPG_EXTENSIONS
    PyModule_AddObject(module, "lobject", (PyObject*)&lobjectType);
#endif

    /* encodings dictionary in module dictionary */
    PyModule_AddObject(module, "encodings", psycoEncodings);

#ifdef HAVE_MXDATETIME
    /* If we can't find mx.DateTime objects at runtime,
     * remove them from the module (and, as consequence, from the adapters). */
    if (0 != psyco_adapter_mxdatetime_init()) {
        PyDict_DelItemString(dict, "DateFromMx");
        PyDict_DelItemString(dict, "TimeFromMx");
        PyDict_DelItemString(dict, "TimestampFromMx");
        PyDict_DelItemString(dict, "IntervalFromMx");
    }
#endif
    /* initialize default set of typecasters */
    if (0 != typecast_init(dict)) { goto exit; }

    /* initialize microprotocols layer */
    microprotocols_init(dict);
    if (0 != psyco_adapters_init(dict)) { goto exit; }

    /* create a standard set of exceptions and add them to the module's dict */
    if (0 != psyco_errors_init()) { goto exit; }
    psyco_errors_fill(dict);

    /* Solve win32 build issue about non-constant initializer element */
    cursorType.tp_alloc = PyType_GenericAlloc;
    binaryType.tp_alloc = PyType_GenericAlloc;
    isqlquoteType.tp_alloc = PyType_GenericAlloc;
    pbooleanType.tp_alloc = PyType_GenericAlloc;
    pintType.tp_alloc = PyType_GenericAlloc;
    pfloatType.tp_alloc = PyType_GenericAlloc;
    pdecimalType.tp_alloc = PyType_GenericAlloc;
    connectionType.tp_alloc = PyType_GenericAlloc;
    asisType.tp_alloc = PyType_GenericAlloc;
    qstringType.tp_alloc = PyType_GenericAlloc;
    listType.tp_alloc = PyType_GenericAlloc;
    chunkType.tp_alloc = PyType_GenericAlloc;
    pydatetimeType.tp_alloc = PyType_GenericAlloc;
    NotifyType.tp_alloc = PyType_GenericAlloc;
    XidType.tp_alloc = PyType_GenericAlloc;

#ifdef PSYCOPG_EXTENSIONS
    lobjectType.tp_alloc = PyType_GenericAlloc;
#endif

#ifdef HAVE_MXDATETIME
    mxdatetimeType.tp_alloc = PyType_GenericAlloc;
#endif

    Dprintf("initpsycopg: module initialization complete");

exit:
#if PY_MAJOR_VERSION > 2
    return module;
#else
    return;
#endif
}
示例#13
0
void PartGuiExport initPartGui()
{
    if (!Gui::Application::Instance) {
        PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application.");
        return;
    }

    // load needed modules
    try {
        Base::Interpreter().runString("import Part");
    }
    catch(const Base::Exception& e) {
        PyErr_SetString(PyExc_ImportError, e.what());
        return;
    }

    (void) Py_InitModule("PartGui", PartGui_methods);   /* mod name, table ptr */
    Base::Console().Log("Loading GUI of Part module... done\n");

    PartGui::SoBrepFaceSet                  ::initClass();
    PartGui::SoBrepEdgeSet                  ::initClass();
    PartGui::SoBrepPointSet                 ::initClass();
    PartGui::SoFCControlPoints              ::initClass();
    PartGui::ViewProviderPartBase           ::init();
    PartGui::ViewProviderPartExt            ::init();
    PartGui::ViewProviderPart               ::init();
    PartGui::ViewProviderEllipsoid          ::init();
    PartGui::ViewProviderPython             ::init();
    PartGui::ViewProviderBox                ::init();
    PartGui::ViewProviderPrism              ::init();
    PartGui::ViewProviderWedge              ::init();
    PartGui::ViewProviderImport             ::init();
    PartGui::ViewProviderCurveNet           ::init();
    PartGui::ViewProviderExtrusion          ::init();
    PartGui::ViewProvider2DObject           ::init();
    PartGui::ViewProvider2DObjectPython     ::init();
    PartGui::ViewProviderMirror             ::init();
    PartGui::ViewProviderFillet             ::init();
    PartGui::ViewProviderChamfer            ::init();
    PartGui::ViewProviderRevolution         ::init();
    PartGui::ViewProviderLoft               ::init();
    PartGui::ViewProviderSweep              ::init();
    PartGui::ViewProviderOffset             ::init();
    PartGui::ViewProviderThickness          ::init();
    PartGui::ViewProviderCustom             ::init();
    PartGui::ViewProviderCustomPython       ::init();
    PartGui::ViewProviderBoolean            ::init();
    PartGui::ViewProviderMultiFuse          ::init();
    PartGui::ViewProviderMultiCommon        ::init();
    PartGui::ViewProviderCompound           ::init();
    PartGui::ViewProviderSpline             ::init();
    PartGui::ViewProviderCircleParametric   ::init();
    PartGui::ViewProviderLineParametric     ::init();
    PartGui::ViewProviderPointParametric    ::init();
    PartGui::ViewProviderEllipseParametric  ::init();
    PartGui::ViewProviderHelixParametric    ::init();
    PartGui::ViewProviderSpiralParametric   ::init();
    PartGui::ViewProviderPlaneParametric    ::init();
    PartGui::ViewProviderSphereParametric   ::init();
    PartGui::ViewProviderCylinderParametric ::init();
    PartGui::ViewProviderConeParametric     ::init();
    PartGui::ViewProviderTorusParametric    ::init();
    PartGui::ViewProviderRuledSurface       ::init();

    PartGui::Workbench                      ::init();

    // instantiating the commands
    CreatePartCommands();
    CreateSimplePartCommands();
    CreateParamPartCommands();

    // register preferences pages
    (void)new Gui::PrefPageProducer<PartGui::DlgSettingsGeneral>      ( QT_TRANSLATE_NOOP("QObject","Part design") );
    (void)new Gui::PrefPageProducer<PartGui::DlgSettings3DViewPart>   ( QT_TRANSLATE_NOOP("QObject","Part design") );
    (void)new Gui::PrefPageProducer<PartGui::DlgSettingsObjectColor>  ( QT_TRANSLATE_NOOP("QObject","Display") );
    Gui::ViewProviderBuilder::add(
        Part::PropertyPartShape::getClassTypeId(),
        PartGui::ViewProviderPart::getClassTypeId());

    // add resources and reloads the translators
    loadPartResource();

    // register bitmaps
    Gui::BitmapFactoryInst& rclBmpFactory = Gui::BitmapFactory();
    rclBmpFactory.addXPM("PartFeature",(const char**) PartFeature_xpm);
    rclBmpFactory.addXPM("PartFeatureImport",(const char**) PartFeatureImport_xpm);
}
示例#14
0
EnumModule::EnumModule(PyObject *parent, char* name)
{
	module =Py_InitModule(name, enum_methods);
	Py_INCREF(module);
	PyModule_AddObject(parent, name, module);
}
示例#15
0
文件: jam.c 项目: iceberry/flyffsf
int  main( int argc, char **argv, char **arg_environ )
{
    int		n;
    char		*s;
    struct option	optv[N_OPTS];
    const char	*all = "all";
    int		anyhow = 0;
    int		status;
    int arg_c = argc;
    char ** arg_v = argv;
    const char *progname = argv[0];

# ifdef OS_MAC
    InitGraf(&qd.thePort);
# endif

    argc--, argv++;

	if( getoptions( argc, argv, "-:l:d:j:f:gs:t:ano:qv", optv ) < 0 )
    {
        printf( "\nusage: %s [ options ] targets...\n\n", progname );

        printf( "-a      Build all targets, even if they are current.\n" );
        printf( "-dx     Set the debug level to x (0-9).\n" );
        printf( "-fx     Read x instead of Jambase.\n" );
	    /* printf( "-g      Build from newest sources first.\n" ); */
        printf( "-jx     Run up to x shell commands concurrently.\n" );
        printf( "-lx     Limit actions to x number of seconds after which they are stopped.\n" );
        printf( "-n      Don't actually execute the updating actions.\n" );
        printf( "-ox     Write the updating actions to file x.\n" );
		printf( "-q      Quit quickly as soon as a target fails.\n" );
        printf( "-sx=y   Set variable x=y, overriding environment.\n" );
        printf( "-tx     Rebuild x, even if it is up-to-date.\n" );
        printf( "-v      Print the version of jam and exit.\n" );
        printf( "--x     Option is ignored.\n\n" );

        exit( EXITBAD );
    }

    /* Version info. */

    if( ( s = getoptval( optv, 'v', 0 ) ) )
    {
        printf( "Boost.Jam  " );
        printf( "Version %s. %s.\n", VERSION, OSMINOR );
	   printf( "   Copyright 1993-2002 Christopher Seiwald and Perforce Software, Inc.  \n" );
        printf( "   Copyright 2001 David Turner.\n" );
        printf( "   Copyright 2001-2004 David Abrahams.\n" );
        printf( "   Copyright 2002-2005 Rene Rivera.\n" );
        printf( "   Copyright 2003-2005 Vladimir Prus.\n" );

        return EXITOK;
    }

    /* Pick up interesting options */

    if( ( s = getoptval( optv, 'n', 0 ) ) )
        globs.noexec++, globs.debug[2] = 1;

	if( ( s = getoptval( optv, 'q', 0 ) ) )
 	    globs.quitquick = 1;
    if( ( s = getoptval( optv, 'a', 0 ) ) )
        anyhow++;

    if( ( s = getoptval( optv, 'j', 0 ) ) )
        globs.jobs = atoi( s );

	if( ( s = getoptval( optv, 'g', 0 ) ) )
	    globs.newestfirst = 1;

    if( ( s = getoptval( optv, 'l', 0 ) ) )
        globs.timeout = atoi( s );

    /* Turn on/off debugging */

    for( n = 0; s = getoptval( optv, 'd', n ); n++ )
    {
        int i;

        /* First -d, turn off defaults. */

        if( !n )
            for( i = 0; i < DEBUG_MAX; i++ )
                globs.debug[i] = 0;

        i = atoi( s );

        if( i < 0 || i >= DEBUG_MAX )
        {
            printf( "Invalid debug level '%s'.\n", s );
            continue;
        }

        /* n turns on levels 1-n */
        /* +n turns on level n */

        if( *s == '+' )
            globs.debug[i] = 1;
        else while( i )
            globs.debug[i--] = 1;
    }

    { PROFILE_ENTER(MAIN);

    #ifdef HAVE_PYTHON
    {
        PROFILE_ENTER(MAIN_PYTHON);
        Py_Initialize();
    
        {
            static PyMethodDef BjamMethods[] = {
                {"call", bjam_call, METH_VARARGS,
                 "Call the specified bjam rule."},
                {"import_rule", bjam_import_rule, METH_VARARGS,
                 "Imports Python callable to bjam."},
                {NULL, NULL, 0, NULL}
            };
    
            Py_InitModule("bjam", BjamMethods);
        }
        PROFILE_EXIT(MAIN_PYTHON);
    }
    #endif
    
#ifndef NDEBUG
    run_unit_tests();
#endif
#if YYDEBUG != 0
    if ( DEBUG_PARSE )
        yydebug = 1;
#endif

    /* Set JAMDATE first */

    {
        char *date;
        time_t clock;
        time( &clock );
        date = newstr( ctime( &clock ) );

        /* Trim newline from date */

        if( strlen( date ) == 25 )
            date[ 24 ] = 0;

        var_set( "JAMDATE", list_new( L0, newstr( date ) ), VAR_SET );
    }

 
    var_set( "JAM_VERSION",
             list_new( list_new( list_new( L0, newstr( VERSION_MAJOR_SYM ) ), 
                                 newstr( VERSION_MINOR_SYM ) ), 
                       newstr( VERSION_PATCH_SYM ) ),
             VAR_SET );

    /* And JAMUNAME */
# ifdef unix
    {
        struct utsname u;

        if( uname( &u ) >= 0 )
        {
            var_set( "JAMUNAME", 
                     list_new( 
                         list_new(
                             list_new(
                                 list_new(
                                     list_new( L0, 
                                               newstr( u.sysname ) ),
                                     newstr( u.nodename ) ),
                                 newstr( u.release ) ),
                             newstr( u.version ) ),
                         newstr( u.machine ) ), VAR_SET );
        }
    }
# endif /* unix */

    /* load up environment variables */

    /* first into global module, with splitting, for backward compatibility */
    var_defines( use_environ, 1 );
    
    /* then into .ENVIRON, without splitting */
    enter_module( bindmodule(".ENVIRON") );
    var_defines( use_environ, 0 );
    exit_module( bindmodule(".ENVIRON") );

	/*
	 * Jam defined variables OS, OSPLAT
     * We load them after environment, so that
     * setting OS in environment does not 
     * change Jam notion of the current platform.
	 */

    var_defines( othersyms, 1 );


    /* Load up variables set on command line. */

    for( n = 0; s = getoptval( optv, 's', n ); n++ )
    {
        char *symv[2];
        symv[0] = s;
        symv[1] = 0;
        var_defines( symv, 1 );
    }

    /* Set the ARGV to reflect the complete list of arguments of invocation. */

    for ( n = 0; n < arg_c; ++n )
    {
        var_set( "ARGV", list_new( L0, newstr( arg_v[n] ) ), VAR_APPEND );
    }

	/* Initialize built-in rules */

	load_builtins();

    /* Add the targets in the command line to update list */

    for ( n = 1; n < arg_c; ++n )
    {
        if ( arg_v[n][0] == '-' )
        {
            char *f = "-:l:d:j:f:gs:t:ano:qv";
            for( ; *f; f++ ) if( *f == arg_v[n][1] ) break;
            if ( f[1] == ':' && arg_v[n][2] == '\0' ) { ++n; }
        }
        else
        {
            mark_target_for_updating(arg_v[n]);
        }
    }

    /* Parse ruleset */

    {
        FRAME frame[1];
        frame_init( frame );
	for( n = 0; s = getoptval( optv, 'f', n ); n++ )
	    parse_file( s, frame );

	if( !n )
	    parse_file( "+", frame );
    }

    status = yyanyerrors();

    /* Manually touch -t targets */

    for( n = 0; s = getoptval( optv, 't', n ); n++ )
        touchtarget( s );

    /* If an output file is specified, set globs.cmdout to that */

    if( s = getoptval( optv, 'o', 0 ) )
    {
        if( !( globs.cmdout = fopen( s, "w" ) ) )
        {
            printf( "Failed to write to '%s'\n", s );
            exit( EXITBAD );
        }
        globs.noexec++;
    }

    /* Now make target */

    {
        PROFILE_ENTER(MAIN_MAKE);
        
        LIST* targets = targets_to_update();
        if ( !targets )
        {
            status |= make( 1, &all, anyhow );
        }
        else 
        {
            int targets_count = list_length(targets);
            const char **targets2 = (const char **)malloc(targets_count * sizeof(char *));
            int n = 0;
            if ( DEBUG_PROFILE )
                profile_memory( targets_count * sizeof(char *) );
            for ( ; targets; targets = list_next(targets) )
            {
                targets2[n++] = targets->string;
            }
            status |= make( targets_count, targets2, anyhow );       
            free(targets);
        }
        
        PROFILE_EXIT(MAIN_MAKE);
    }


    PROFILE_EXIT(MAIN); }
    
    if ( DEBUG_PROFILE )
        profile_dump();

    /* Widely scattered cleanup */

    var_done();
    file_done();
    donerules();
    donestamps();
    donestr();

    /* close cmdout */

    if( globs.cmdout )
        fclose( globs.cmdout );

#ifdef HAVE_PYTHON
    Py_Finalize();
#endif


    return status ? EXITBAD : EXITOK;
}
示例#16
0
extern "C" PyMODINIT_FUNC inityami4py(void)
{
    Py_InitModule("yami4py", yami4pyMethods);
}
示例#17
0
PyMODINIT_FUNC
initPyBCM2835(void)
{
    PyObject *m;

    m = Py_InitModule("PyBCM2835", PyBCM2835Methods);
    if (m == NULL)
        return;

	// Constants
	PyModule_AddIntConstant(m,"HIGH",1);
	PyModule_AddIntConstant(m,"LOW",0);
	PyModule_AddIntConstant(m,"PERI_BASE",BCM2835_PERI_BASE);
	PyModule_AddIntConstant(m,"GPIO_PADS",BCM2835_GPIO_PADS);
	PyModule_AddIntConstant(m,"CLOCK_BASE",BCM2835_CLOCK_BASE);
	PyModule_AddIntConstant(m,"GPIO_BASE",BCM2835_GPIO_BASE);
	PyModule_AddIntConstant(m,"SPI0_BASE",BCM2835_SPI0_BASE);
	PyModule_AddIntConstant(m,"GPIO_PWM",BCM2835_GPIO_PWM);
	PyModule_AddIntConstant(m,"PAGE_SIZE",BCM2835_PAGE_SIZE);
	PyModule_AddIntConstant(m,"BLOCK_SIZE",BCM2835_BLOCK_SIZE);
	PyModule_AddIntConstant(m,"GPFSEL0",BCM2835_GPFSEL0);
	PyModule_AddIntConstant(m,"GPFSEL1",BCM2835_GPFSEL1);
	PyModule_AddIntConstant(m,"GPFSEL2",BCM2835_GPFSEL2);
	PyModule_AddIntConstant(m,"GPFSEL3",BCM2835_GPFSEL3);
	PyModule_AddIntConstant(m,"GPFSEL4",BCM2835_GPFSEL4);
	PyModule_AddIntConstant(m,"GPFSEL5",BCM2835_GPFSEL5);
	PyModule_AddIntConstant(m,"GPSET0",BCM2835_GPSET0);
	PyModule_AddIntConstant(m,"GPSET1",BCM2835_GPSET1);
	PyModule_AddIntConstant(m,"GPCLR0",BCM2835_GPCLR0);
	PyModule_AddIntConstant(m,"GPCLR1",BCM2835_GPCLR1);
	PyModule_AddIntConstant(m,"GPLEV0",BCM2835_GPLEV0);
	PyModule_AddIntConstant(m,"GPLEV1",BCM2835_GPLEV1);
	PyModule_AddIntConstant(m,"GPEDS0",BCM2835_GPEDS0);
	PyModule_AddIntConstant(m,"GPEDS1",BCM2835_GPEDS1);
	PyModule_AddIntConstant(m,"GPREN0",BCM2835_GPREN0);
	PyModule_AddIntConstant(m,"GPREN1",BCM2835_GPREN1);
	PyModule_AddIntConstant(m,"GPFEN0",BCM2835_GPFEN0);
	PyModule_AddIntConstant(m,"GPFEN1",BCM2835_GPFEN1);
	PyModule_AddIntConstant(m,"GPAFEN0",BCM2835_GPAFEN0);
	PyModule_AddIntConstant(m,"GPAFEN1",BCM2835_GPAFEN1);
	PyModule_AddIntConstant(m,"GPPUD",BCM2835_GPPUD);
	PyModule_AddIntConstant(m,"GPPUDCLK0",BCM2835_GPPUDCLK0);
	PyModule_AddIntConstant(m,"GPPUDCLK1",BCM2835_GPPUDCLK1);
	PyModule_AddIntConstant(m,"BCM2835_PADS_GPIO_0_27",BCM2835_PADS_GPIO_0_27);
	PyModule_AddIntConstant(m,"BCM2835_PADS_GPIO_28_45",BCM2835_PADS_GPIO_28_45);
	PyModule_AddIntConstant(m,"BCM2835_PADS_GPIO_46_53",BCM2835_PADS_GPIO_46_53);
	PyModule_AddIntConstant(m,"BCM2835_PAD_PASSWRD",BCM2835_PAD_PASSWRD);
	PyModule_AddIntConstant(m,"BCM2835_PAD_SLEW_RATE_UNLIMITED",BCM2835_PAD_SLEW_RATE_UNLIMITED);
	PyModule_AddIntConstant(m,"BCM2835_PAD_HYSTERESIS_ENABLED",BCM2835_PAD_HYSTERESIS_ENABLED);
	PyModule_AddIntConstant(m,"BCM2835_PAD_DRIVE_2mA",BCM2835_PAD_DRIVE_2mA);
	PyModule_AddIntConstant(m,"BCM2835_PAD_DRIVE_4mA",BCM2835_PAD_DRIVE_4mA);
	PyModule_AddIntConstant(m,"BCM2835_PAD_DRIVE_6mA",BCM2835_PAD_DRIVE_6mA);
	PyModule_AddIntConstant(m,"BCM2835_PAD_DRIVE_8mA",BCM2835_PAD_DRIVE_8mA);
	PyModule_AddIntConstant(m,"BCM2835_PAD_DRIVE_10mA",BCM2835_PAD_DRIVE_10mA);
	PyModule_AddIntConstant(m,"BCM2835_PAD_DRIVE_12mA",BCM2835_PAD_DRIVE_12mA);
	PyModule_AddIntConstant(m,"BCM2835_PAD_DRIVE_14mA",BCM2835_PAD_DRIVE_14mA);
	PyModule_AddIntConstant(m,"BCM2835_PAD_DRIVE_16mA",BCM2835_PAD_DRIVE_16mA);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_CS",BCM2835_SPI0_CS);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_FIFO",BCM2835_SPI0_FIFO);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_CLK",BCM2835_SPI0_CLK);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_DLEN",BCM2835_SPI0_DLEN);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_LTOH",BCM2835_SPI0_LTOH);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_DC",BCM2835_SPI0_DC);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_CS_LEN_LONG",BCM2835_SPI0_CS_LEN_LONG);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_CS_DMA_LEN",BCM2835_SPI0_CS_DMA_LEN);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_CS_CSPOL2",BCM2835_SPI0_CS_CSPOL2);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_CS_CSPOL1",BCM2835_SPI0_CS_CSPOL1);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_CS_CSPOL0",BCM2835_SPI0_CS_CSPOL0);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_CS_RXF",BCM2835_SPI0_CS_RXF);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_CS_RXR",BCM2835_SPI0_CS_RXR);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_CS_TXD",BCM2835_SPI0_CS_TXD);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_CS_DONE",BCM2835_SPI0_CS_DONE);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_CS_TE_EN",BCM2835_SPI0_CS_TE_EN);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_CS_LMONO",BCM2835_SPI0_CS_LMONO);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_CS_LEN",BCM2835_SPI0_CS_LEN);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_CS_REN",BCM2835_SPI0_CS_REN);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_CS_ADCS",BCM2835_SPI0_CS_ADCS);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_CS_INTR",BCM2835_SPI0_CS_INTR);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_CS_INTD",BCM2835_SPI0_CS_INTD);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_CS_DMAEN",BCM2835_SPI0_CS_DMAEN);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_CS_TA",BCM2835_SPI0_CS_TA);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_CS_CSPOL",BCM2835_SPI0_CS_CSPOL);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_CS_CLEAR",BCM2835_SPI0_CS_CLEAR);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_CS_CLEAR_RX",BCM2835_SPI0_CS_CLEAR_RX);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_CS_CLEAR_TX",BCM2835_SPI0_CS_CLEAR_TX);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_CS_CPOL",BCM2835_SPI0_CS_CPOL);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_CS_CPHA",BCM2835_SPI0_CS_CPHA);
	PyModule_AddIntConstant(m,"BCM2835_SPI0_CS_CS",BCM2835_SPI0_CS_CS);
	//PyModule_AddIntConstant(m,"",);

    // Function Select
	PyModule_AddIntConstant(m,"GPIO_FSEL_INPT",BCM2835_GPIO_FSEL_INPT);
	PyModule_AddIntConstant(m,"GPIO_FSEL_OUTP",BCM2835_GPIO_FSEL_OUTP);
	PyModule_AddIntConstant(m,"GPIO_FSEL_ALT0",BCM2835_GPIO_FSEL_ALT0);
	PyModule_AddIntConstant(m,"GPIO_FSEL_ALT1",BCM2835_GPIO_FSEL_ALT1);
	PyModule_AddIntConstant(m,"GPIO_FSEL_ALT2",BCM2835_GPIO_FSEL_ALT2);
	PyModule_AddIntConstant(m,"GPIO_FSEL_ALT3",BCM2835_GPIO_FSEL_ALT3);
	PyModule_AddIntConstant(m,"GPIO_FSEL_ALT4",BCM2835_GPIO_FSEL_ALT4);
	PyModule_AddIntConstant(m,"GPIO_FSEL_ALT5",BCM2835_GPIO_FSEL_ALT5);
	PyModule_AddIntConstant(m,"GPIO_FSEL_MASK",BCM2835_GPIO_FSEL_MASK);

	// PUD Control
	PyModule_AddIntConstant(m,"BCM2835_GPIO_PUD_OFF",BCM2835_GPIO_PUD_OFF);
	PyModule_AddIntConstant(m,"BCM2835_GPIO_PUD_DOWN",BCM2835_GPIO_PUD_DOWN);
	PyModule_AddIntConstant(m,"BCM2835_GPIO_PUD_UP",BCM2835_GPIO_PUD_UP);

	// Pad Group
	PyModule_AddIntConstant(m,"BCM2835_PAD_GROUP_GPIO_0_27",BCM2835_PAD_GROUP_GPIO_0_27);
	PyModule_AddIntConstant(m,"BCM2835_PAD_GROUP_GPIO_28_45",BCM2835_PAD_GROUP_GPIO_28_45);
	PyModule_AddIntConstant(m,"BCM2835_PAD_GROUP_GPIO_46_53",BCM2835_PAD_GROUP_GPIO_46_53);
    
	// RPiGPIOPin
	PyModule_AddIntConstant(m,"RPI_GPIO_P1_03",RPI_GPIO_P1_03);
	PyModule_AddIntConstant(m,"RPI_GPIO_P1_05",RPI_GPIO_P1_05);
	PyModule_AddIntConstant(m,"RPI_GPIO_P1_07",RPI_GPIO_P1_07);
	PyModule_AddIntConstant(m,"RPI_GPIO_P1_08",RPI_GPIO_P1_08);
	PyModule_AddIntConstant(m,"RPI_GPIO_P1_10",RPI_GPIO_P1_10);
	PyModule_AddIntConstant(m,"RPI_GPIO_P1_11",RPI_GPIO_P1_11);
	PyModule_AddIntConstant(m,"RPI_GPIO_P1_12",RPI_GPIO_P1_12);
	PyModule_AddIntConstant(m,"RPI_GPIO_P1_13",RPI_GPIO_P1_13);
	PyModule_AddIntConstant(m,"RPI_GPIO_P1_15",RPI_GPIO_P1_15);
	PyModule_AddIntConstant(m,"RPI_GPIO_P1_16",RPI_GPIO_P1_16);
	PyModule_AddIntConstant(m,"RPI_GPIO_P1_18",RPI_GPIO_P1_18);
	PyModule_AddIntConstant(m,"RPI_GPIO_P1_19",RPI_GPIO_P1_19);
	PyModule_AddIntConstant(m,"RPI_GPIO_P1_21",RPI_GPIO_P1_21);
	PyModule_AddIntConstant(m,"RPI_GPIO_P1_22",RPI_GPIO_P1_22);
	PyModule_AddIntConstant(m,"RPI_GPIO_P1_23",RPI_GPIO_P1_23);
	PyModule_AddIntConstant(m,"RPI_GPIO_P1_24",RPI_GPIO_P1_24);
	PyModule_AddIntConstant(m,"RPI_GPIO_P1_26",RPI_GPIO_P1_26);
	PyModule_AddIntConstant(m,"RPI_V2_GPIO_P1_03",RPI_V2_GPIO_P1_03);
	PyModule_AddIntConstant(m,"RPI_V2_GPIO_P1_05",RPI_V2_GPIO_P1_05);
	PyModule_AddIntConstant(m,"RPI_V2_GPIO_P1_07",RPI_V2_GPIO_P1_07);
	PyModule_AddIntConstant(m,"RPI_V2_GPIO_P1_08",RPI_V2_GPIO_P1_08);
	PyModule_AddIntConstant(m,"RPI_V2_GPIO_P1_10",RPI_V2_GPIO_P1_10);
	PyModule_AddIntConstant(m,"RPI_V2_GPIO_P1_11",RPI_V2_GPIO_P1_11);
	PyModule_AddIntConstant(m,"RPI_V2_GPIO_P1_12",RPI_V2_GPIO_P1_12);
	PyModule_AddIntConstant(m,"RPI_V2_GPIO_P1_13",RPI_V2_GPIO_P1_13);
	PyModule_AddIntConstant(m,"RPI_V2_GPIO_P1_15",RPI_V2_GPIO_P1_15);
	PyModule_AddIntConstant(m,"RPI_V2_GPIO_P1_16",RPI_V2_GPIO_P1_16);
	PyModule_AddIntConstant(m,"RPI_V2_GPIO_P1_18",RPI_V2_GPIO_P1_18);
	PyModule_AddIntConstant(m,"RPI_V2_GPIO_P1_19",RPI_V2_GPIO_P1_19);
	PyModule_AddIntConstant(m,"RPI_V2_GPIO_P1_21",RPI_V2_GPIO_P1_21);
	PyModule_AddIntConstant(m,"RPI_V2_GPIO_P1_22",RPI_V2_GPIO_P1_22);
	PyModule_AddIntConstant(m,"RPI_V2_GPIO_P1_23",RPI_V2_GPIO_P1_23);
	PyModule_AddIntConstant(m,"RPI_V2_GPIO_P1_24",RPI_V2_GPIO_P1_24);
	PyModule_AddIntConstant(m,"RPI_V2_GPIO_P1_26",RPI_V2_GPIO_P1_26);

	// Bit Order
	PyModule_AddIntConstant(m,"SPI_BIT_ORDER_LSBFIRST",BCM2835_SPI_BIT_ORDER_LSBFIRST);
	PyModule_AddIntConstant(m,"SPI_BIT_ORDER_MSBFIRST",BCM2835_SPI_BIT_ORDER_MSBFIRST);

	// SPI Mode
	PyModule_AddIntConstant(m,"SPI_MODE0",BCM2835_SPI_MODE0);
	PyModule_AddIntConstant(m,"SPI_MODE1",BCM2835_SPI_MODE1);
	PyModule_AddIntConstant(m,"SPI_MODE2",BCM2835_SPI_MODE2);
	PyModule_AddIntConstant(m,"SPI_MODE3",BCM2835_SPI_MODE3);

	// Chip Select
	PyModule_AddIntConstant(m,"SPI_CS0",BCM2835_SPI_CS0);
	PyModule_AddIntConstant(m,"SPI_CS1",BCM2835_SPI_CS1);
	PyModule_AddIntConstant(m,"SPI_CS2",BCM2835_SPI_CS2);
	PyModule_AddIntConstant(m,"SPI_CS_NONE",BCM2835_SPI_CS_NONE);

	// bcm2835SPIClockDivider
	PyModule_AddIntConstant(m,"SPI_CLOCK_DIVIDER_65536",BCM2835_SPI_CLOCK_DIVIDER_65536);
	PyModule_AddIntConstant(m,"SPI_CLOCK_DIVIDER_32768",BCM2835_SPI_CLOCK_DIVIDER_32768);
	PyModule_AddIntConstant(m,"SPI_CLOCK_DIVIDER_16384",BCM2835_SPI_CLOCK_DIVIDER_16384);
	PyModule_AddIntConstant(m,"SPI_CLOCK_DIVIDER_8192",BCM2835_SPI_CLOCK_DIVIDER_8192);
	PyModule_AddIntConstant(m,"SPI_CLOCK_DIVIDER_4096",BCM2835_SPI_CLOCK_DIVIDER_4096);
	PyModule_AddIntConstant(m,"SPI_CLOCK_DIVIDER_2048",BCM2835_SPI_CLOCK_DIVIDER_2048);
	PyModule_AddIntConstant(m,"SPI_CLOCK_DIVIDER_1024",BCM2835_SPI_CLOCK_DIVIDER_1024);
	PyModule_AddIntConstant(m,"SPI_CLOCK_DIVIDER_512",BCM2835_SPI_CLOCK_DIVIDER_512);
	PyModule_AddIntConstant(m,"SPI_CLOCK_DIVIDER_256",BCM2835_SPI_CLOCK_DIVIDER_256);
	PyModule_AddIntConstant(m,"SPI_CLOCK_DIVIDER_128",BCM2835_SPI_CLOCK_DIVIDER_128);
	PyModule_AddIntConstant(m,"SPI_CLOCK_DIVIDER_64",BCM2835_SPI_CLOCK_DIVIDER_64);
	PyModule_AddIntConstant(m,"SPI_CLOCK_DIVIDER_32",BCM2835_SPI_CLOCK_DIVIDER_32);
	PyModule_AddIntConstant(m,"SPI_CLOCK_DIVIDER_16",BCM2835_SPI_CLOCK_DIVIDER_16);
	PyModule_AddIntConstant(m,"SPI_CLOCK_DIVIDER_8",BCM2835_SPI_CLOCK_DIVIDER_8);
	PyModule_AddIntConstant(m,"SPI_CLOCK_DIVIDER_4",BCM2835_SPI_CLOCK_DIVIDER_4);
	PyModule_AddIntConstant(m,"SPI_CLOCK_DIVIDER_2",BCM2835_SPI_CLOCK_DIVIDER_2);
	PyModule_AddIntConstant(m,"SPI_CLOCK_DIVIDER_1",BCM2835_SPI_CLOCK_DIVIDER_1);

	PyBCM2835Error = PyErr_NewException("PyBCM2835.error", NULL, NULL);
    Py_INCREF(PyBCM2835Error);
    PyModule_AddObject(m, "error", PyBCM2835Error);
}
示例#18
0
void CPythonEngine::init()
{
	if (!initialised)
	{
		initialised = 1;

		/* Initialize the Python interpreter.*/
		Py_Initialize();
		PyEval_InitThreads();


		PyGILState_STATE gstate;
		gstate = PyGILState_Ensure();

		/* Initialize TA Python env. */
		Py_InitModule("tibiaauto", Methods_tibiaauto);
		Py_InitModule("tareader", Methods_tareader);
		Py_InitModule("tasender", Methods_tasender);
		Py_InitModule("tamap", Methods_tamap);
		Py_InitModule("taregexp", Methods_taregexp);
		Py_InitModule("taalice", Methods_taalice);
		Py_InitModule("taitem", Methods_taitem);
		Py_InitModule("tacrstat", Methods_tacrstat);
		Py_InitModule("takernel", Methods_takernel);
		Py_InitModule("tapacket", Methods_tapacket);
		PyRun_SimpleString("import tibiaauto");
		PyRun_SimpleString("import tareader");
		PyRun_SimpleString("import tasender");
		PyRun_SimpleString("import tamap");
		PyRun_SimpleString("import taregexp");
		PyRun_SimpleString("import taalice");
		PyRun_SimpleString("import taitem");
		PyRun_SimpleString("import tacrstat");
		PyRun_SimpleString("import takernel");
		PyRun_SimpleString("import sys");
		PyRun_SimpleString("import time");

		char pathBuf[2048];
		sprintf(pathBuf, "%s\\tascripts\\tautil.py", CInstallPath::getInstallPath().c_str());

		// load tautil.py
		FILE *f = fopen(pathBuf, "r");
		if (f)
		{
			fseek(f, 0, SEEK_END);
			int fileSize = ftell(f);
			fseek(f, 0, SEEK_SET);
			char *fileBuf = (char *)malloc(fileSize + 1);
			memset(fileBuf, 0, fileSize + 1);
			fread(fileBuf, 1, fileSize, f);

			int ret = PyRun_SimpleString(fileBuf);
			if (ret == -1)
				AfxMessageBox("Loading tautil.py script failed!");
			fclose(f);
		}
		else
		{
			AfxMessageBox("Unable to find tascripts\\tautil.py!");
		}

		PyGILState_Release(gstate);

		InitializeCriticalSection(&ScriptEngineCriticalSection);


		// now load all scripts from 'tascripts' subdirectory
		sprintf(pathBuf, "%s\\tascripts\\*.py", CInstallPath::getInstallPath().c_str());
		WIN32_FIND_DATA findFileData;
		HANDLE hFind = FindFirstFile(pathBuf, &findFileData);
		if (hFind != INVALID_HANDLE_VALUE)
		{
			char buf[1024];

			do
			{
				snprintf(buf, 1023, "%s\\tascripts\\%s", CInstallPath::getInstallPath().c_str(), findFileData.cFileName);
				// tautil.py will be loaded in a special way
				if (!strstr(buf, "tascripts\\tautil.py"))
					loadScript(buf);
			}
			while (FindNextFile(hFind, &findFileData));
			FindClose(hFind);
		}
	}
}
示例#19
0
PyMODINIT_FUNC
init_librepo(void)
{
    PyObject *m = Py_InitModule("_librepo", librepo_methods);
    if (!m)
        return;

    /* Exceptions */
    if (!init_exceptions())
        return;
    PyModule_AddObject(m, "LibrepoException", LrErr_Exception);

    /* Objects */
    /* _librepo.Handle */
    if (PyType_Ready(&Handle_Type) < 0)
        return;
    Py_INCREF(&Handle_Type);
    PyModule_AddObject(m, "Handle", (PyObject *)&Handle_Type);
    /* _librepo.Result */
    if (PyType_Ready(&Result_Type) < 0)
        return;
    Py_INCREF(&Result_Type);
    PyModule_AddObject(m, "Result", (PyObject *)&Result_Type);

    /* Module constants */

    /* Version */
    PyModule_AddIntConstant(m, "VERSION_MAJOR", LR_VERSION_MAJOR);
    PyModule_AddIntConstant(m, "VERSION_MINOR", LR_VERSION_MINOR);
    PyModule_AddIntConstant(m, "VERSION_PATCH", LR_VERSION_PATCH);

    /* Handle options */
    PyModule_AddIntConstant(m, "LRO_UPDATE", LRO_UPDATE);
    PyModule_AddIntConstant(m, "LRO_URL", LRO_URL);
    PyModule_AddIntConstant(m, "LRO_MIRRORLIST", LRO_MIRRORLIST);
    PyModule_AddIntConstant(m, "LRO_LOCAL", LRO_LOCAL);
    PyModule_AddIntConstant(m, "LRO_HTTPAUTH", LRO_HTTPAUTH);
    PyModule_AddIntConstant(m, "LRO_USERPWD", LRO_USERPWD);
    PyModule_AddIntConstant(m, "LRO_PROXY", LRO_PROXY);
    PyModule_AddIntConstant(m, "LRO_PROXYPORT", LRO_PROXYPORT);
    PyModule_AddIntConstant(m, "LRO_PROXYTYPE", LRO_PROXYTYPE);
    PyModule_AddIntConstant(m, "LRO_PROXYAUTH", LRO_PROXYAUTH);
    PyModule_AddIntConstant(m, "LRO_PROXYUSERPWD", LRO_PROXYUSERPWD);
    PyModule_AddIntConstant(m, "LRO_PROGRESSCB", LRO_PROGRESSCB);
    PyModule_AddIntConstant(m, "LRO_PROGRESSDATA", LRO_PROGRESSDATA);
    PyModule_AddIntConstant(m, "LRO_RETRIES", LRO_RETRIES);
    PyModule_AddIntConstant(m, "LRO_MAXSPEED", LRO_MAXSPEED);
    PyModule_AddIntConstant(m, "LRO_DESTDIR", LRO_DESTDIR);
    PyModule_AddIntConstant(m, "LRO_REPOTYPE", LRO_REPOTYPE);
    PyModule_AddIntConstant(m, "LRO_CONNECTTIMEOUT", LRO_CONNECTTIMEOUT);
    PyModule_AddIntConstant(m, "LRO_IGNOREMISSING", LRO_IGNOREMISSING);
    PyModule_AddIntConstant(m, "LRO_GPGCHECK", LRO_GPGCHECK);
    PyModule_AddIntConstant(m, "LRO_CHECKSUM", LRO_CHECKSUM);
    PyModule_AddIntConstant(m, "LRO_YUMDLIST", LRO_YUMDLIST);
    PyModule_AddIntConstant(m, "LRO_YUMBLIST", LRO_YUMBLIST);
    PyModule_AddIntConstant(m, "LRO_SENTINEL", LRO_SENTINEL);

    /* Handle info options */
    PyModule_AddIntConstant(m, "LRI_UPDATE", LRI_UPDATE);
    PyModule_AddIntConstant(m, "LRI_URL", LRI_URL);
    PyModule_AddIntConstant(m, "LRI_MIRRORLIST", LRI_MIRRORLIST);
    PyModule_AddIntConstant(m, "LRI_LOCAL", LRI_LOCAL);
    PyModule_AddIntConstant(m, "LRI_PROGRESSCB", LRI_PROGRESSCB);
    PyModule_AddIntConstant(m, "LRI_PROGRESSDATA", LRI_PROGRESSDATA);
    PyModule_AddIntConstant(m, "LRI_DESTDIR", LRI_DESTDIR);
    PyModule_AddIntConstant(m, "LRI_REPOTYPE", LRI_REPOTYPE);
    PyModule_AddIntConstant(m, "LRI_YUMDLIST", LRI_YUMDLIST);
    PyModule_AddIntConstant(m, "LRI_YUMBLIST", LRI_YUMBLIST);
    PyModule_AddIntConstant(m, "LRI_LASTCURLERR", LRI_LASTCURLERR);
    PyModule_AddIntConstant(m, "LRI_LASTCURLMERR", LRI_LASTCURLMERR);
    PyModule_AddIntConstant(m, "LRI_LASTCURLSTRERR", LRI_LASTCURLSTRERR);
    PyModule_AddIntConstant(m, "LRI_LASTCURLMSTRERR", LRI_LASTCURLMSTRERR);
    PyModule_AddIntConstant(m, "LRI_LASTBADSTATUSCODE", LRI_LASTBADSTATUSCODE);

    /* Check options */
    PyModule_AddIntConstant(m, "LR_CHECK_GPG", LR_CHECK_GPG);
    PyModule_AddIntConstant(m, "LR_CHECK_CHECKSUM", LR_CHECK_CHECKSUM);

    /* Repo type */
    PyModule_AddIntConstant(m, "LR_YUMREPO", LR_YUMREPO);
    PyModule_AddIntConstant(m, "LR_SUSEREPO", LR_SUSEREPO);
    PyModule_AddIntConstant(m, "LR_DEBREPO", LR_DEBREPO);

    /* Proxy type */
    PyModule_AddIntConstant(m, "LR_PROXY_HTTP", LR_PROXY_HTTP);
    PyModule_AddIntConstant(m, "LR_PROXY_HTTP_1_0", LR_PROXY_HTTP_1_0);
    PyModule_AddIntConstant(m, "LR_PROXY_SOCKS4", LR_PROXY_SOCKS4);
    PyModule_AddIntConstant(m, "LR_PROXY_SOCKS5", LR_PROXY_SOCKS5);
    PyModule_AddIntConstant(m, "LR_PROXY_SOCKS4A", LR_PROXY_SOCKS4A);
    PyModule_AddIntConstant(m, "LR_PROXY_SOCKS5_HOSTNAME", LR_PROXY_SOCKS5_HOSTNAME);

    /* Return codes */
    PyModule_AddIntConstant(m, "LRE_OK", LRE_OK);
    PyModule_AddIntConstant(m, "LRE_BADFUNCARG", LRE_BADFUNCARG);
    PyModule_AddIntConstant(m, "LRE_BADOPTARG", LRE_BADOPTARG);
    PyModule_AddIntConstant(m, "LRE_UNKNOWNOPT", LRE_UNKNOWNOPT);
    PyModule_AddIntConstant(m, "LRE_CURLSETOPT", LRE_CURLSETOPT);
    PyModule_AddIntConstant(m, "LRE_ALREADYUSEDRESULT", LRE_ALREADYUSEDRESULT);
    PyModule_AddIntConstant(m, "LRE_INCOMPLETERESULT", LRE_INCOMPLETERESULT);
    PyModule_AddIntConstant(m, "LRE_CURLDUP", LRE_CURLDUP);
    PyModule_AddIntConstant(m, "LRE_CURL", LRE_CURL);
    PyModule_AddIntConstant(m, "LRE_CURLM", LRE_CURLM);
    PyModule_AddIntConstant(m, "LRE_BADSTATUS", LRE_BADSTATUS);
    PyModule_AddIntConstant(m, "LRE_TEMPORARYERR", LRE_TEMPORARYERR);
    PyModule_AddIntConstant(m, "LRE_NOTLOCAL", LRE_NOTLOCAL);
    PyModule_AddIntConstant(m, "LRE_CANNOTCREATEDIR", LRE_CANNOTCREATEDIR);
    PyModule_AddIntConstant(m, "LRE_IO", LRE_IO);
    PyModule_AddIntConstant(m, "LRE_MLBAD", LRE_MLBAD);
    PyModule_AddIntConstant(m, "LRE_MLXML", LRE_MLXML);
    PyModule_AddIntConstant(m, "LRE_BADCHECKSUM", LRE_BADCHECKSUM);
    PyModule_AddIntConstant(m, "LRE_REPOMDXML", LRE_REPOMDXML);
    PyModule_AddIntConstant(m, "LRE_NOURL", LRE_NOURL);
    PyModule_AddIntConstant(m, "LRE_CANNOTCREATETMP", LRE_CANNOTCREATETMP);
    PyModule_AddIntConstant(m, "LRE_UNKNOWNCHECKSUM", LRE_UNKNOWNCHECKSUM);
    PyModule_AddIntConstant(m, "LRE_BADURL", LRE_BADURL);
    PyModule_AddIntConstant(m, "LRE_GPGNOTSUPPORTED", LRE_GPGNOTSUPPORTED);
    PyModule_AddIntConstant(m, "LRE_GPGERROR", LRE_GPGERROR);
    PyModule_AddIntConstant(m, "LRE_BADGPG", LRE_BADGPG);
    PyModule_AddIntConstant(m, "LRE_INCOMPLETEREPO", LRE_INCOMPLETEREPO);
    PyModule_AddIntConstant(m, "LRE_UNKNOWNERROR", LRE_UNKNOWNERROR);

    /* Result option */
    PyModule_AddIntConstant(m, "LRR_YUM_REPO", LRR_YUM_REPO);
    PyModule_AddIntConstant(m, "LRR_YUM_REPOMD", LRR_YUM_REPOMD);
    PyModule_AddIntConstant(m, "LRR_SENTINEL", LRR_SENTINEL);

    /* Checksums */
    PyModule_AddIntConstant(m, "CHECKSUM_UNKNOWN", LR_CHECKSUM_UNKNOWN);
    PyModule_AddIntConstant(m, "CHECKSUM_MD2", LR_CHECKSUM_MD2);
    PyModule_AddIntConstant(m, "CHECKSUM_MD5", LR_CHECKSUM_MD5);
    PyModule_AddIntConstant(m, "CHECKSUM_SHA", LR_CHECKSUM_SHA);
    PyModule_AddIntConstant(m, "CHECKSUM_SHA1", LR_CHECKSUM_SHA1);
    PyModule_AddIntConstant(m, "CHECKSUM_SHA224", LR_CHECKSUM_SHA224);
    PyModule_AddIntConstant(m, "CHECKSUM_SHA256", LR_CHECKSUM_SHA256);
    PyModule_AddIntConstant(m, "CHECKSUM_SHA384", LR_CHECKSUM_SHA384);
    PyModule_AddIntConstant(m, "CHECKSUM_SHA512", LR_CHECKSUM_SHA512);
}
示例#20
0
PyMODINIT_FUNC
init_imagingtk(void)
{
    Py_InitModule("_imagingtk", functions);
}
void initmema_bare()
{
	(void)Py_InitModule("mema_bare", methods);
}
示例#22
0
文件: ofx.cpp 项目: gatgui/ofxpp
void initofx(void)
{
  PyObject *mod = Py_InitModule("ofx", PyOFX_Methods);
  
  PyModule_AddIntConstant(mod, "TypeImageEffectHost", ofx::TypeImageEffectHost);
  PyModule_AddIntConstant(mod, "TypeImageEffect", ofx::TypeImageEffect);
  PyModule_AddIntConstant(mod, "TypeImageEffectInstance", ofx::TypeImageEffectInstance);
  PyModule_AddIntConstant(mod, "TypeParameter", ofx::TypeParameter);
  PyModule_AddIntConstant(mod, "TypeParameterInstance", ofx::TypeParameterInstance);
  PyModule_AddIntConstant(mod, "TypeClip", ofx::TypeClip);
  PyModule_AddIntConstant(mod, "TypeImage", ofx::TypeImage);
  
  PyModule_AddIntConstant(mod, "BitDepthNone", ofx::BitDepthNone);
  PyModule_AddIntConstant(mod, "BitDepthByte", ofx::BitDepthByte);
  PyModule_AddIntConstant(mod, "BitDepthShort", ofx::BitDepthShort);
  PyModule_AddIntConstant(mod, "BitDepthFloat", ofx::BitDepthFloat);
#ifdef OFX_API_1_3
  PyModule_AddIntConstant(mod, "BitDepthHalf", ofx::BitDepthHalf);
#endif
  
  PyModule_AddIntConstant(mod, "ImageComponentNone", ofx::ImageComponentNone);
#ifdef OFX_API_1_2
  PyModule_AddIntConstant(mod, "ImageComponentRGB", ofx::ImageComponentRGB);
#endif
  PyModule_AddIntConstant(mod, "ImageComponentRGBA", ofx::ImageComponentRGBA);
  PyModule_AddIntConstant(mod, "ImageComponentAlpha", ofx::ImageComponentAlpha);
  PyModule_AddIntConstant(mod, "ImageComponentYUVA", ofx::ImageComponentYUVA);
  
  PyModule_AddIntConstant(mod, "ImageFieldNone", ofx::ImageFieldNone);
  PyModule_AddIntConstant(mod, "ImageFieldBoth", ofx::ImageFieldBoth);
  PyModule_AddIntConstant(mod, "ImageFieldLower", ofx::ImageFieldLower);
  PyModule_AddIntConstant(mod, "ImageFieldUpper", ofx::ImageFieldUpper);
  
  PyModule_AddIntConstant(mod, "ImageFieldExtractBoth", ofx::ImageFieldExtractBoth);
  PyModule_AddIntConstant(mod, "ImageFieldExtractSingle", ofx::ImageFieldExtractSingle);
  PyModule_AddIntConstant(mod, "ImageFieldExtractDoubled", ofx::ImageFieldExtractDoubled);
  
  PyModule_AddIntConstant(mod, "ImageFieldOrderNone", ofx::ImageFieldOrderNone);
  PyModule_AddIntConstant(mod, "ImageFieldOrderLower", ofx::ImageFieldOrderLower);
  PyModule_AddIntConstant(mod, "ImageFieldOrderUpper", ofx::ImageFieldOrderUpper);
  
  PyModule_AddIntConstant(mod, "ImageOpaque", ofx::ImageOpaque);
  PyModule_AddIntConstant(mod, "ImagePreMultiplied", ofx::ImagePreMultiplied);
  PyModule_AddIntConstant(mod, "ImageUnPreMultiplied", ofx::ImageUnPreMultiplied);
  
  PyModule_AddIntConstant(mod, "ImageEffectContextGenerator", ofx::ImageEffectContextGenerator);
  PyModule_AddIntConstant(mod, "ImageEffectContextFilter", ofx::ImageEffectContextFilter);
  PyModule_AddIntConstant(mod, "ImageEffectContextTransition", ofx::ImageEffectContextTransition);
  PyModule_AddIntConstant(mod, "ImageEffectContextPaint", ofx::ImageEffectContextPaint);
  PyModule_AddIntConstant(mod, "ImageEffectContextGeneral", ofx::ImageEffectContextGeneral);
  PyModule_AddIntConstant(mod, "ImageEffectContextRetimer", ofx::ImageEffectContextRetimer);
  
  PyModule_AddIntConstant(mod, "RenderThreadUnsafe", ofx::RenderThreadUnsafe);
  PyModule_AddIntConstant(mod, "RenderThreadInstanceSafe", ofx::RenderThreadInstanceSafe);
  PyModule_AddIntConstant(mod, "RenderThreadFullySafe", ofx::RenderThreadFullySafe);
  
  PyModule_AddIntConstant(mod, "ParamTypeInteger", ofx::ParamTypeInteger);
  PyModule_AddIntConstant(mod, "ParamTypeDouble", ofx::ParamTypeDouble);
  PyModule_AddIntConstant(mod, "ParamTypeBoolean", ofx::ParamTypeBoolean);
  PyModule_AddIntConstant(mod, "ParamTypeChoice", ofx::ParamTypeChoice);
  PyModule_AddIntConstant(mod, "ParamTypeRGBA", ofx::ParamTypeRGBA);
  PyModule_AddIntConstant(mod, "ParamTypeRGB", ofx::ParamTypeRGB);
  PyModule_AddIntConstant(mod, "ParamTypeDouble2D", ofx::ParamTypeDouble2D);
  PyModule_AddIntConstant(mod, "ParamTypeInteger2D", ofx::ParamTypeInteger2D);
  PyModule_AddIntConstant(mod, "ParamTypeDouble3D", ofx::ParamTypeDouble3D);
  PyModule_AddIntConstant(mod, "ParamTypeInteger3D", ofx::ParamTypeInteger3D);
  PyModule_AddIntConstant(mod, "ParamTypeString", ofx::ParamTypeString);
  PyModule_AddIntConstant(mod, "ParamTypeCustom", ofx::ParamTypeCustom);
  PyModule_AddIntConstant(mod, "ParamTypeGroup", ofx::ParamTypeGroup);
  PyModule_AddIntConstant(mod, "ParamTypePage", ofx::ParamTypePage);
  PyModule_AddIntConstant(mod, "ParamTypePushButton", ofx::ParamTypePushButton);
#ifdef OFX_API_1_2
  PyModule_AddIntConstant(mod, "ParamTypeParametric", ofx::ParamTypeParametric);
#endif
  
  PyModule_AddIntConstant(mod, "ParamInvalidateValueChange", ofx::ParamInvalidateValueChange);
  PyModule_AddIntConstant(mod, "ParamInvalidateValueChangeToEnd", ofx::ParamInvalidateValueChangeToEnd);
  PyModule_AddIntConstant(mod, "ParamInvalidateAll", ofx::ParamInvalidateAll);
  
  PyModule_AddIntConstant(mod, "StringParamSingleLine", ofx::StringParamSingleLine);
  PyModule_AddIntConstant(mod, "StringParamMultiLine", ofx::StringParamMultiLine);
  PyModule_AddIntConstant(mod, "StringParamFilePath", ofx::StringParamFilePath);
  PyModule_AddIntConstant(mod, "StringParamDirectoryPath", ofx::StringParamDirectoryPath);
  PyModule_AddIntConstant(mod, "StringParamLabel", ofx::StringParamLabel);
#ifdef OFX_API_1_3
  PyModule_AddIntConstant(mod, "StringParamRichText", ofx::StringParamRichText);
#endif
  
  PyModule_AddIntConstant(mod, "DoubleParamPlain", ofx::DoubleParamPlain);
  PyModule_AddIntConstant(mod, "DoubleParamAngle", ofx::DoubleParamAngle);
  PyModule_AddIntConstant(mod, "DoubleParamScale", ofx::DoubleParamScale);
  PyModule_AddIntConstant(mod, "DoubleParamTime", ofx::DoubleParamTime);
  PyModule_AddIntConstant(mod, "DoubleParamAbsoluteTime", ofx::DoubleParamAbsoluteTime);
  PyModule_AddIntConstant(mod, "DoubleParamNormalisedX", ofx::DoubleParamNormalisedX);
  PyModule_AddIntConstant(mod, "DoubleParamNormalisedXAbsolute", ofx::DoubleParamNormalisedXAbsolute);
  PyModule_AddIntConstant(mod, "DoubleParamNormalisedY", ofx::DoubleParamNormalisedY);
  PyModule_AddIntConstant(mod, "DoubleParamNormalisedYAbsolute", ofx::DoubleParamNormalisedYAbsolute);
  PyModule_AddIntConstant(mod, "DoubleParamNormalisedXY", ofx::DoubleParamNormalisedXY);
  PyModule_AddIntConstant(mod, "DoubleParamNormalisedXYAbsolute", ofx::DoubleParamNormalisedXYAbsolute);
#ifdef OFX_API_1_2
  PyModule_AddIntConstant(mod, "DoubleParamX", ofx::DoubleParamX);
  PyModule_AddIntConstant(mod, "DoubleParamXAbsolute", ofx::DoubleParamXAbsolute);
  PyModule_AddIntConstant(mod, "DoubleParamY", ofx::DoubleParamY);
  PyModule_AddIntConstant(mod, "DoubleParamYAbsolute", ofx::DoubleParamYAbsolute);
  PyModule_AddIntConstant(mod, "DoubleParamXY", ofx::DoubleParamXY);
  PyModule_AddIntConstant(mod, "DoubleParamXYAbsolute", ofx::DoubleParamXYAbsolute);
#endif
  
#ifdef OFX_API_1_2
  PyModule_AddIntConstant(mod, "CoordinatesCanonical", ofx::CoordinatesCanonical);
  PyModule_AddIntConstant(mod, "CoordinatesNormalised", ofx::CoordinatesNormalised);
#endif
  
  PyModule_AddIntConstant(mod, "KeyDirectionPrev", ofx::KeyDirectionPrev);
  PyModule_AddIntConstant(mod, "KeyDirectionExact", ofx::KeyDirectionExact);
  PyModule_AddIntConstant(mod, "KeyDirectionNext", ofx::KeyDirectionNext);
  
  PyModule_AddIntConstant(mod, "MessageTypeFatal", ofx::MessageTypeFatal);
  PyModule_AddIntConstant(mod, "MessageTypeError", ofx::MessageTypeError);
  PyModule_AddIntConstant(mod, "MessageTypeMessage", ofx::MessageTypeMessage);
  PyModule_AddIntConstant(mod, "MessageTypeLog", ofx::MessageTypeLog);
  PyModule_AddIntConstant(mod, "MessageTypeQuestion", ofx::MessageTypeQuestion);
#ifdef OFX_API_1_2
  PyModule_AddIntConstant(mod, "MessageTypeWarning", ofx::MessageTypeWarning);
#endif
  
  PyModule_AddIntConstant(mod, "ChangeUserEdited", ofx::ChangeUserEdited);
  PyModule_AddIntConstant(mod, "ChangePluginEdited", ofx::ChangePluginEdited);
  PyModule_AddIntConstant(mod, "ChangeTime", ofx::ChangeTime);
  
  PyModule_AddIntConstant(mod, "ActionLoad", ofx::ActionLoad);
  PyModule_AddIntConstant(mod, "ActionInteractLoseFocus", ofx::ActionInteractLoseFocus);
  PyModule_AddIntConstant(mod, "ActionInteractGainFocus", ofx::ActionInteractGainFocus);
  PyModule_AddIntConstant(mod, "ActionInteractKeyRepeat", ofx::ActionInteractKeyRepeat);
  PyModule_AddIntConstant(mod, "ActionInteractKeyUp", ofx::ActionInteractKeyUp);
  PyModule_AddIntConstant(mod, "ActionInteractKeyDown", ofx::ActionInteractKeyDown);
  PyModule_AddIntConstant(mod, "ActionInteractPenUp", ofx::ActionInteractPenUp);
  PyModule_AddIntConstant(mod, "ActionInteractPenDown", ofx::ActionInteractPenDown);
  PyModule_AddIntConstant(mod, "ActionInteractPenMotion", ofx::ActionInteractPenMotion);
  PyModule_AddIntConstant(mod, "ActionInteractDraw", ofx::ActionInteractDraw);
  PyModule_AddIntConstant(mod, "ActionImageEffectGetTimeDomain", ofx::ActionImageEffectGetTimeDomain);
  PyModule_AddIntConstant(mod, "ActionImageEffectGetClipPreferences", ofx::ActionImageEffectGetClipPreferences);
  PyModule_AddIntConstant(mod, "ActionImageEffectEndSequenceRender", ofx::ActionImageEffectEndSequenceRender);
  PyModule_AddIntConstant(mod, "ActionImageEffectBeginSequenceRender", ofx::ActionImageEffectBeginSequenceRender);
  PyModule_AddIntConstant(mod, "ActionImageEffectRender", ofx::ActionImageEffectRender);
  PyModule_AddIntConstant(mod, "ActionImageEffectIsIdentity", ofx::ActionImageEffectIsIdentity);
  PyModule_AddIntConstant(mod, "ActionImageEffectGetFramesNeeded", ofx::ActionImageEffectGetFramesNeeded);
  PyModule_AddIntConstant(mod, "ActionImageEffectGetRoI", ofx::ActionImageEffectGetRoI);
  PyModule_AddIntConstant(mod, "ActionImageEffectGetRoD", ofx::ActionImageEffectGetRoD);
  PyModule_AddIntConstant(mod, "ActionImageEffectDescribeInContext", ofx::ActionImageEffectDescribeInContext);
  PyModule_AddIntConstant(mod, "ActionEndInstanceEdit", ofx::ActionEndInstanceEdit);
  PyModule_AddIntConstant(mod, "ActionBeginInstanceEdit", ofx::ActionBeginInstanceEdit);
  PyModule_AddIntConstant(mod, "ActionUnload", ofx::ActionUnload);
  PyModule_AddIntConstant(mod, "ActionDescribe", ofx::ActionDescribe);
  PyModule_AddIntConstant(mod, "ActionCreateInstance", ofx::ActionCreateInstance);
  PyModule_AddIntConstant(mod, "ActionDestroyInstance", ofx::ActionDestroyInstance);
  PyModule_AddIntConstant(mod, "ActionInstanceChanged", ofx::ActionInstanceChanged);
  PyModule_AddIntConstant(mod, "ActionBeginInstanceChanged", ofx::ActionBeginInstanceChanged);
  PyModule_AddIntConstant(mod, "ActionEndInstanceChanged", ofx::ActionEndInstanceChanged);
  PyModule_AddIntConstant(mod, "ActionPurgeCaches", ofx::ActionPurgeCaches);
  PyModule_AddIntConstant(mod, "ActionSyncPrivateData", ofx::ActionSyncPrivateData);
#ifdef OFX_API_1_3
  PyModule_AddIntConstant(mod, "ActionOpenGLContextAttached", ofx::ActionOpenGLContextAttached);
  PyModule_AddIntConstant(mod, "ActionOpenGLContextDetached", ofx::ActionOpenGLContextAttached);
#endif
  
  PyModule_AddIntConstant(mod, "SequentialRenderNotNeeded", ofx::SequentialRenderNotNeeded);
  PyModule_AddIntConstant(mod, "SequentialRenderRequired", ofx::SequentialRenderRequired);
  PyModule_AddIntConstant(mod, "SequentialRenderUnknown", ofx::SequentialRenderUnknown);
  PyModule_AddIntConstant(mod, "SequentialRenderAlways", ofx::SequentialRenderAlways);
#ifdef OFX_API_1_2
  PyModule_AddIntConstant(mod, "SequentialRenderIfPossible", ofx::SequentialRenderIfPossible);
  PyModule_AddIntConstant(mod, "SequentialRenderSometimes", ofx::SequentialRenderSometimes);
#endif

  PyModule_AddIntConstant(mod, "StatOK", kOfxStatOK);
  PyModule_AddIntConstant(mod, "StatFailed", kOfxStatFailed);
  PyModule_AddIntConstant(mod, "StatErrFatal", kOfxStatErrFatal);
  PyModule_AddIntConstant(mod, "StatErrUnknown", kOfxStatErrUnknown);
  PyModule_AddIntConstant(mod, "StatErrMissingHostFeature", kOfxStatErrMissingHostFeature);
  PyModule_AddIntConstant(mod, "StatErrUnsupported", kOfxStatErrUnsupported);
  PyModule_AddIntConstant(mod, "StatErrExists", kOfxStatErrExists);
  PyModule_AddIntConstant(mod, "StatErrFormat", kOfxStatErrFormat);
  PyModule_AddIntConstant(mod, "StatErrMemory", kOfxStatErrMemory);
  PyModule_AddIntConstant(mod, "StatErrBadHandle", kOfxStatErrBadHandle);
  PyModule_AddIntConstant(mod, "StatErrBadIndex", kOfxStatErrBadIndex);
  PyModule_AddIntConstant(mod, "StatErrValue", kOfxStatErrValue);
  PyModule_AddIntConstant(mod, "StatErrImageFormat", kOfxStatErrImageFormat);
  PyModule_AddIntConstant(mod, "StatReplyYes", kOfxStatReplyYes);
  PyModule_AddIntConstant(mod, "StatReplyNo", kOfxStatReplyNo);
  PyModule_AddIntConstant(mod, "StatReplyDefault", kOfxStatReplyDefault);
#ifdef OFX_API_1_3
  PyModule_AddIntConstant(mod, "StatGLOutOfMemory", kOfxStatGLOutOfMemory);
  PyModule_AddIntConstant(mod, "StatGLRenderFailed", kOfxStatGLRenderFailed);
#endif
  
  PyModule_AddStringConstant(mod, "PageSkipRow", kOfxParamPageSkipRow);
  PyModule_AddStringConstant(mod, "PageSkipColumn", kOfxParamPageSkipColumn);
  
  PyModule_AddIntConstant(mod, "MajorVersion", ofx::MajorVersion);
  PyModule_AddIntConstant(mod, "MinorVersion", ofx::MinorVersion);
  PyModule_AddIntConstant(mod, "PatchVersion", ofx::PatchVersion);
  PyModule_AddStringConstant(mod, "Version", ofx::Version);
  
  INIT_TYPE(PyOFXActionArgumentsType, "ofx.ActionArguments", PyOFXActionArguments);
  PyOFXActionArgumentsType.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE;
  PyOFXActionArgumentsType.tp_new = PyOFXActionArguments_New;
  PyOFXActionArgumentsType.tp_init = PyOFXActionArguments_Init;
  PyOFXActionArgumentsType.tp_dealloc = PyOFXActionArguments_Delete;
  PyOFXActionArgumentsType.tp_setattro = PyOFXActionArguments_SetAttr; //PyObject_GenericSetAttr;
  PyOFXActionArgumentsType.tp_getattro = PyOFXActionArguments_GetAttr; //PyObject_GenericGetAttr;
  if (PyType_Ready(&PyOFXActionArgumentsType) < 0)
  {
    std::cerr << "Failed to intiialize ofx.ActionArguments class" << std::endl;
    Py_DECREF(mod);
    return;
  }
  
  INIT_TYPE(PyOFXRectIType, "ofx.RectI", PyOFXRectI);
  PyOFXRectIType.tp_flags = Py_TPFLAGS_DEFAULT;
  PyOFXRectIType.tp_new = PyOFXRectI_New;
  PyOFXRectIType.tp_init = PyOFXRectI_Init;
  PyOFXRectIType.tp_dealloc = PyOFXRectI_Delete;
  PyOFXRectIType.tp_getset = PyOFXRectI_GetSeters;
  if (PyType_Ready(&PyOFXRectIType) < 0)
  {
    std::cerr << "Failed to intiialize ofx.RectI class" << std::endl;
    Py_DECREF(mod);
    return;
  }
  
  INIT_TYPE(PyOFXRectDType, "ofx.RectD", PyOFXRectD);
  PyOFXRectDType.tp_flags = Py_TPFLAGS_DEFAULT;
  PyOFXRectDType.tp_new = PyOFXRectD_New;
  PyOFXRectDType.tp_init = PyOFXRectD_Init;
  PyOFXRectDType.tp_dealloc = PyOFXRectD_Delete;
  PyOFXRectDType.tp_getset = PyOFXRectD_GetSeters;
  if (PyType_Ready(&PyOFXRectDType) < 0)
  {
    std::cerr << "Failed to intiialize ofx.RectD class" << std::endl;
    Py_DECREF(mod);
    return;
  }
  
  INIT_TYPE(PyOFXRangeIType, "ofx.RangeI", PyOFXRangeI);
  PyOFXRangeIType.tp_flags = Py_TPFLAGS_DEFAULT;
  PyOFXRangeIType.tp_new = PyOFXRangeI_New;
  PyOFXRangeIType.tp_init = PyOFXRangeI_Init;
  PyOFXRangeIType.tp_dealloc = PyOFXRangeI_Delete;
  PyOFXRangeIType.tp_getset = PyOFXRangeI_GetSeters;
  if (PyType_Ready(&PyOFXRangeIType) < 0)
  {
    std::cerr << "Failed to intiialize ofx.RangeI class" << std::endl;
    Py_DECREF(mod);
    return;
  }
  
  INIT_TYPE(PyOFXRangeDType, "ofx.RangeD", PyOFXRangeD);
  PyOFXRangeDType.tp_flags = Py_TPFLAGS_DEFAULT;
  PyOFXRangeDType.tp_new = PyOFXRangeD_New;
  PyOFXRangeDType.tp_init = PyOFXRangeD_Init;
  PyOFXRangeDType.tp_dealloc = PyOFXRangeD_Delete;
  PyOFXRangeDType.tp_getset = PyOFXRangeD_GetSeters;
  if (PyType_Ready(&PyOFXRangeDType) < 0)
  {
    std::cerr << "Failed to intiialize ofx.RangeD class" << std::endl;
    Py_DECREF(mod);
    return;
  }
  
  Py_INCREF(&PyOFXActionArgumentsType);
  PyModule_AddObject(mod, "ActionArguments", (PyObject*)&PyOFXActionArgumentsType);
  
  Py_INCREF(&PyOFXRectIType);
  PyModule_AddObject(mod, "RectI", (PyObject*)&PyOFXRectIType);
  
  Py_INCREF(&PyOFXRectDType);
  PyModule_AddObject(mod, "RectD", (PyObject*)&PyOFXRectDType);
  
  Py_INCREF(&PyOFXRangeIType);
  PyModule_AddObject(mod, "RangeI", (PyObject*)&PyOFXRangeIType);
  
  Py_INCREF(&PyOFXRangeDType);
  PyModule_AddObject(mod, "RangeD", (PyObject*)&PyOFXRangeDType);
  
  Py_INCREF(&PyOFXRangeDType);
  PyModule_AddObject(mod, "FrameRange", (PyObject*)&PyOFXRangeDType);
  
  if (!PyOFX_InitException(mod))
  {
    std::cerr << "Failed to intiialize exception classes" << std::endl;
    Py_DECREF(mod);
    return;
  }
  
  if (!PyOFX_InitHandle(mod))
  {
    std::cerr << "Failed to intiialize handle classes" << std::endl;
    Py_DECREF(mod);
    return;
  }
  
  if (!PyOFX_InitPixel(mod))
  {
    std::cerr << "Failed to intiialize pixel classes" << std::endl;
    Py_DECREF(mod);
    return;
  }
  
  if (!PyOFX_InitMessage(mod))
  {
    std::cerr << "Failed to intiialize message classes" << std::endl;
    Py_DECREF(mod);
    return;
  }
  
  if (!PyOFX_InitMemory(mod))
  {
    std::cerr << "Failed to intiialize memory classes" << std::endl;
    Py_DECREF(mod);
    return;
  }
  
  if (!PyOFX_InitProgress(mod))
  {
    std::cerr << "Failed to intiialize progress classes" << std::endl;
    Py_DECREF(mod);
    return;
  }
  
  if (!PyOFX_InitTimeLine(mod))
  {
    std::cerr << "Failed to intiialize timeline classes" << std::endl;
    Py_DECREF(mod);
    return;
  }
  
  if (!PyOFX_InitProperty(mod))
  {
    std::cerr << "Failed to intiialize property classes" << std::endl;
    Py_DECREF(mod);
    return;
  }
  
  if (!PyOFX_InitParameter(mod))
  {
    std::cerr << "Failed to intiialize parameter classes" << std::endl;
    Py_DECREF(mod);
    return;
  }
  
  if (!PyOFX_InitParameterSet(mod))
  {
    std::cerr << "Failed to intiialize parameterset classes" << std::endl;
    Py_DECREF(mod);
    return;
  }
  
  if (!PyOFX_InitHost(mod))
  {
    std::cerr << "Failed to intiialize host classes" << std::endl;
    Py_DECREF(mod);
    return;
  }
  
  if (!PyOFX_InitImage(mod))
  {
    std::cerr << "Failed to intiialize image classes" << std::endl;
    Py_DECREF(mod);
    return;
  }
  
  if (!PyOFX_InitClip(mod))
  {
    std::cerr << "Failed to intiialize clip classes" << std::endl;
    Py_DECREF(mod);
    return;
  }
  
  if (!PyOFX_InitInteract(mod))
  {
    std::cerr << "Failed to intiialize interact classes" << std::endl;
    Py_DECREF(mod);
    return;
  }
  
  if (!PyOFX_InitImageEffect(mod))
  {
    std::cerr << "Failed to intiialize imageeffect classes" << std::endl;
    Py_DECREF(mod);
    return;
  }
  
  if (!PyOFX_InitPlugin(mod))
  {
    std::cerr << "Failed to intiialize plugin classes" << std::endl;
    Py_DECREF(mod);
    return;
  }
  
  if (!PyOFX_InitTest(mod))
  {
    std::cerr << "Failed to intiialize test classes" << std::endl;
    Py_DECREF(mod);
    return;
  }
}
示例#23
0
void initanimate() {
  (void) Py_InitModule((char *)"animate", methods);
}
示例#24
0
PyMODINIT_FUNC init974880c1782ea33895e89f76392e1020(void){
   import_array();
   (void) Py_InitModule("974880c1782ea33895e89f76392e1020", MyMethods);
}
示例#25
0
PyMODINIT_FUNC init45dfab8da8578c723988601d4f3f5833(void){
   import_array();
   (void) Py_InitModule("45dfab8da8578c723988601d4f3f5833", MyMethods);
}
示例#26
0
void inittestMod(void)
{
    _module = Py_InitModule("testMod", _exportedMethods);
}
示例#27
0
PyMODINIT_FUNC initnpcolony() {
    (void) Py_InitModule("npcolony", colony_methods);
}
示例#28
0
DL_EXPORT(void) init_apache()
{
    PyObject *m, *d, *o;

    /* initialize types XXX break windows? */
    MpTable_Type.ob_type = &PyType_Type; 
    MpTableIter_Type.ob_type = &PyType_Type;
    MpServer_Type.ob_type = &PyType_Type;
    MpConn_Type.ob_type = &PyType_Type;  
    MpRequest_Type.ob_type = &PyType_Type; 
    MpFilter_Type.ob_type = &PyType_Type;
    MpHList_Type.ob_type = &PyType_Type;

    m = Py_InitModule("_apache", _apache_module_methods);
    d = PyModule_GetDict(m);
    Mp_ServerReturn = PyErr_NewException("_apache.SERVER_RETURN", NULL, NULL);
    if (Mp_ServerReturn == NULL)
        return;
    PyDict_SetItemString(d, "SERVER_RETURN", Mp_ServerReturn);

    PyDict_SetItemString(d, "table", (PyObject *)&MpTable_Type);

    o = PyInt_FromLong(AP_CONN_UNKNOWN);
    PyDict_SetItemString(d, "AP_CONN_UNKNOWN", o);
    Py_DECREF(o);
    o = PyInt_FromLong(AP_CONN_CLOSE);
    PyDict_SetItemString(d, "AP_CONN_CLOSE", o);
    Py_DECREF(o);
    o = PyInt_FromLong(AP_CONN_KEEPALIVE);
    PyDict_SetItemString(d, "AP_CONN_KEEPALIVE", o);
    Py_DECREF(o);

    o = PyInt_FromLong(APR_NOFILE);
    PyDict_SetItemString(d, "APR_NOFILE", o);
    Py_DECREF(o);
    o = PyInt_FromLong(APR_REG);
    PyDict_SetItemString(d, "APR_REG", o);
    Py_DECREF(o);
    o = PyInt_FromLong(APR_DIR);
    PyDict_SetItemString(d, "APR_DIR", o);
    Py_DECREF(o);
    o = PyInt_FromLong(APR_CHR);
    PyDict_SetItemString(d, "APR_CHR", o);
    Py_DECREF(o);
    o = PyInt_FromLong(APR_BLK);
    PyDict_SetItemString(d, "APR_BLK", o);
    Py_DECREF(o);
    o = PyInt_FromLong(APR_PIPE);
    PyDict_SetItemString(d, "APR_PIPE", o);
    Py_DECREF(o);
    o = PyInt_FromLong(APR_LNK);
    PyDict_SetItemString(d, "APR_LNK", o);
    Py_DECREF(o);
    o = PyInt_FromLong(APR_SOCK);
    PyDict_SetItemString(d, "APR_SOCK", o);
    Py_DECREF(o);
    o = PyInt_FromLong(APR_UNKFILE);
    PyDict_SetItemString(d, "APR_UNKFILE", o);
    Py_DECREF(o);

    o = PyInt_FromLong(MODULE_MAGIC_NUMBER_MAJOR);
    PyDict_SetItemString(d, "MODULE_MAGIC_NUMBER_MAJOR", o);
    Py_DECREF(o);
    o = PyInt_FromLong(MODULE_MAGIC_NUMBER_MINOR);
    PyDict_SetItemString(d, "MODULE_MAGIC_NUMBER_MINOR", o);
    Py_DECREF(o);

}
示例#29
0
PyMODINIT_FUNC init_sqlite3(void)
{
    PyObject *module, *dict;
    PyObject *tmp_obj;
    int i;

    module = Py_InitModule("_sqlite3", module_methods);

    if (!module ||
        (pysqlite_row_setup_types() < 0) ||
        (pysqlite_cursor_setup_types() < 0) ||
        (pysqlite_connection_setup_types() < 0) ||
        (pysqlite_cache_setup_types() < 0) ||
        (pysqlite_statement_setup_types() < 0) ||
        (pysqlite_prepare_protocol_setup_types() < 0)
       ) {
        return;
    }

    Py_INCREF(&pysqlite_ConnectionType);
    PyModule_AddObject(module, "Connection", (PyObject*) &pysqlite_ConnectionType);
    Py_INCREF(&pysqlite_CursorType);
    PyModule_AddObject(module, "Cursor", (PyObject*) &pysqlite_CursorType);
    Py_INCREF(&pysqlite_CacheType);
    PyModule_AddObject(module, "Statement", (PyObject*)&pysqlite_StatementType);
    Py_INCREF(&pysqlite_StatementType);
    PyModule_AddObject(module, "Cache", (PyObject*) &pysqlite_CacheType);
    Py_INCREF(&pysqlite_PrepareProtocolType);
    PyModule_AddObject(module, "PrepareProtocol", (PyObject*) &pysqlite_PrepareProtocolType);
    Py_INCREF(&pysqlite_RowType);
    PyModule_AddObject(module, "Row", (PyObject*) &pysqlite_RowType);

    if (!(dict = PyModule_GetDict(module))) {
        goto error;
    }

    /*** Create DB-API Exception hierarchy */

    if (!(pysqlite_Error = PyErr_NewException(MODULE_NAME ".Error", PyExc_StandardError, NULL))) {
        goto error;
    }
    PyDict_SetItemString(dict, "Error", pysqlite_Error);

    if (!(pysqlite_Warning = PyErr_NewException(MODULE_NAME ".Warning", PyExc_StandardError, NULL))) {
        goto error;
    }
    PyDict_SetItemString(dict, "Warning", pysqlite_Warning);

    /* Error subclasses */

    if (!(pysqlite_InterfaceError = PyErr_NewException(MODULE_NAME ".InterfaceError", pysqlite_Error, NULL))) {
        goto error;
    }
    PyDict_SetItemString(dict, "InterfaceError", pysqlite_InterfaceError);

    if (!(pysqlite_DatabaseError = PyErr_NewException(MODULE_NAME ".DatabaseError", pysqlite_Error, NULL))) {
        goto error;
    }
    PyDict_SetItemString(dict, "DatabaseError", pysqlite_DatabaseError);

    /* pysqlite_DatabaseError subclasses */

    if (!(pysqlite_InternalError = PyErr_NewException(MODULE_NAME ".InternalError", pysqlite_DatabaseError, NULL))) {
        goto error;
    }
    PyDict_SetItemString(dict, "InternalError", pysqlite_InternalError);

    if (!(pysqlite_OperationalError = PyErr_NewException(MODULE_NAME ".OperationalError", pysqlite_DatabaseError, NULL))) {
        goto error;
    }
    PyDict_SetItemString(dict, "OperationalError", pysqlite_OperationalError);

    if (!(pysqlite_ProgrammingError = PyErr_NewException(MODULE_NAME ".ProgrammingError", pysqlite_DatabaseError, NULL))) {
        goto error;
    }
    PyDict_SetItemString(dict, "ProgrammingError", pysqlite_ProgrammingError);

    if (!(pysqlite_IntegrityError = PyErr_NewException(MODULE_NAME ".IntegrityError", pysqlite_DatabaseError,NULL))) {
        goto error;
    }
    PyDict_SetItemString(dict, "IntegrityError", pysqlite_IntegrityError);

    if (!(pysqlite_DataError = PyErr_NewException(MODULE_NAME ".DataError", pysqlite_DatabaseError, NULL))) {
        goto error;
    }
    PyDict_SetItemString(dict, "DataError", pysqlite_DataError);

    if (!(pysqlite_NotSupportedError = PyErr_NewException(MODULE_NAME ".NotSupportedError", pysqlite_DatabaseError, NULL))) {
        goto error;
    }
    PyDict_SetItemString(dict, "NotSupportedError", pysqlite_NotSupportedError);

    /* We just need "something" unique for pysqlite_OptimizedUnicode. It does not really
     * need to be a string subclass. Just anything that can act as a special
     * marker for us. So I pulled PyCell_Type out of my magic hat.
     */
    Py_INCREF((PyObject*)&PyCell_Type);
    pysqlite_OptimizedUnicode = (PyObject*)&PyCell_Type;
    PyDict_SetItemString(dict, "OptimizedUnicode", pysqlite_OptimizedUnicode);

    /* Set integer constants */
    for (i = 0; _int_constants[i].constant_name != 0; i++) {
        tmp_obj = PyInt_FromLong(_int_constants[i].constant_value);
        if (!tmp_obj) {
            goto error;
        }
        PyDict_SetItemString(dict, _int_constants[i].constant_name, tmp_obj);
        Py_DECREF(tmp_obj);
    }

    if (!(tmp_obj = PyString_FromString(PYSQLITE_VERSION))) {
        goto error;
    }
    PyDict_SetItemString(dict, "version", tmp_obj);
    Py_DECREF(tmp_obj);

    if (!(tmp_obj = PyString_FromString(sqlite3_libversion()))) {
        goto error;
    }
    PyDict_SetItemString(dict, "sqlite_version", tmp_obj);
    Py_DECREF(tmp_obj);

    /* initialize microprotocols layer */
    pysqlite_microprotocols_init(dict);

    /* initialize the default converters */
    converters_init(dict);

    _enable_callback_tracebacks = 0;

    pysqlite_BaseTypeAdapted = 0;

    /* Original comment from _bsddb.c in the Python core. This is also still
     * needed nowadays for Python 2.3/2.4.
     * 
     * PyEval_InitThreads is called here due to a quirk in python 1.5
     * - 2.2.1 (at least) according to Russell Williamson <[email protected]>:
     * The global interpreter lock is not initialized until the first
     * thread is created using thread.start_new_thread() or fork() is
     * called.  that would cause the ALLOW_THREADS here to segfault due
     * to a null pointer reference if no threads or child processes
     * have been created.  This works around that and is a no-op if
     * threads have already been initialized.
     *  (see pybsddb-users mailing list post on 2002-08-07)
     */
    PyEval_InitThreads();

error:
    if (PyErr_Occurred())
    {
        PyErr_SetString(PyExc_ImportError, MODULE_NAME ": init failed");
    }
}
示例#30
0
void initchr()
{
	static PyMethodDef s_methods[] =
	{
		{ "DismountHorse",				chrDismountHorse,					METH_VARARGS },
		{ "MountHorse",					chrMountHorse,						METH_VARARGS },

		{ "Destroy",					chrDestroy,							METH_VARARGS },
		{ "Update",						chrUpdate,							METH_VARARGS },
		{ "Deform",						chrDeform,							METH_VARARGS },
		{ "Render",						chrRender,							METH_VARARGS },
		{ "RenderCollision",			chrRenderCollision,					METH_VARARGS },

		// Functions For Python Code
		{ "CreateInstance",				chrCreateInstance,					METH_VARARGS },
		{ "DeleteInstance",				chrDeleteInstance,					METH_VARARGS },
		{ "DeleteInstanceByFade",		chrDeleteInstanceByFade,			METH_VARARGS },
		{ "SelectInstance",				chrSelectInstance,					METH_VARARGS },

		{ "HasInstance",				chrHasInstance,						METH_VARARGS },
		{ "IsEnemy",					chrIsEnemy,							METH_VARARGS },
		{ "IsNPC",						chrIsNPC,							METH_VARARGS },
		{ "IsGameMaster",				chrIsGameMaster,					METH_VARARGS },
		{ "IsPartyMember",				chrIsPartyMember,					METH_VARARGS },

		{ "Select",						chrSelect,							METH_VARARGS },
		{ "SetAddRenderMode",			chrSetAddRenderMode,				METH_VARARGS },
		{ "SetBlendRenderMode",			chrSetBlendRenderMode,				METH_VARARGS },
		{ "Unselect",					chrUnselect,						METH_VARARGS },

		{ "Hide",						chrHide,							METH_VARARGS },
		{ "Show",						chrShow,							METH_VARARGS },
		{ "Pick",						chrPick,							METH_VARARGS },
		{ "PickAll",					chrPickAll,							METH_VARARGS },

		{ "SetArmor",					chrSetArmor,						METH_VARARGS },
		{ "SetWeapon",					chrSetWeapon,						METH_VARARGS },
		{ "ChangeShape",				chrChangeShape,						METH_VARARGS },
		{ "SetRace",					chrSetRace,							METH_VARARGS },
		{ "SetHair",					chrSetHair,							METH_VARARGS },
		{ "ChangeHair",					chrChangeHair,						METH_VARARGS },
		{ "SetVirtualID",				chrSetVirtualID,					METH_VARARGS },
		{ "SetNameString",				chrSetNameString,					METH_VARARGS },
		{ "SetInstanceType",			chrSetInstanceType,					METH_VARARGS },

		{ "SetPixelPosition",			chrSetPixelPosition,				METH_VARARGS },
		{ "SetDirection",				chrSetDirection,					METH_VARARGS },
		{ "Refresh",					chrRefresh,							METH_VARARGS },
		{ "Revive",						chrRevive,							METH_VARARGS },
		{ "Die",						chrDie,								METH_VARARGS },

		{ "AttachEffectByID",			chrAttachEffectByID,				METH_VARARGS },
		{ "AttachEffectByName",			chrAttachEffectByName,				METH_VARARGS },

		{ "LookAt",						chrLookAt,							METH_VARARGS },
		{ "SetMotionMode",				chrSetMotionMode,					METH_VARARGS },
		{ "SetLoopMotion",				chrSetLoopMotion,					METH_VARARGS },
		{ "BlendLoopMotion",			chrBlendLoopMotion,					METH_VARARGS },
		{ "PushOnceMotion",				chrPushOnceMotion,					METH_VARARGS },
		{ "PushLoopMotion",				chrPushLoopMotion,					METH_VARARGS },
		{ "GetPixelPosition",			chrGetPixelPosition,				METH_VARARGS },
		{ "SetRotation",				chrSetRotation,						METH_VARARGS },
		{ "SetRotationAll",				chrSetRotationAll,					METH_VARARGS },
		{ "BlendRotation",				chrBlendRotation,					METH_VARARGS },
		{ "GetRotation",				chrGetRotation,						METH_VARARGS },
		{ "GetRace",					chrGetRace,							METH_VARARGS },
		{ "GetName",					chrGetName,							METH_VARARGS },
		{ "GetNameByVID",				chrGetNameByVID,					METH_VARARGS },
		{ "GetGuildID",					chrGetGuildID,						METH_VARARGS },
		{ "GetProjectPosition",			chrGetProjectPosition,				METH_VARARGS },

		{ "GetVirtualNumber",			chrGetVirtualNumber,				METH_VARARGS },
		{ "GetInstanceType",			chrGetInstanceType,					METH_VARARGS },

		{ "GetBoundBoxOnlyXY",			chrGetBoundBoxOnlyXY,				METH_VARARGS },

		{ "RaceToJob",					chrRaceToJob,							METH_VARARGS },
		{ "RaceToSex",					chrRaceToSex,							METH_VARARGS },

		// For Test
		{ "testGetPKData",					chrtestGetPKData,					METH_VARARGS },
		{ "FaintTest",						chrFaintTest,						METH_VARARGS },
		{ "SetMoveSpeed",					chrSetMoveSpeed,					METH_VARARGS },
		{ "SetAttackSpeed",					chrSetAttackSpeed,					METH_VARARGS },
		{ "WeaponTraceSetTexture",			chrWeaponTraceSetTexture,			METH_VARARGS },
		{ "WeaponTraceUseAlpha",			chrWeaponTraceUseAlpha,				METH_VARARGS },
		{ "WeaponTraceUseTexture",			chrWeaponTraceUseTexture,			METH_VARARGS },
		{ "MoveToDestPosition",				chrMoveToDestPosition,				METH_VARARGS },
		{ "testSetComboType",				chrtestSetComboType,				METH_VARARGS },
		{ "testSetAddRenderMode",			chrtestSetAddRenderMode,			METH_VARARGS },
		{ "testSetModulateRenderMode",		chrtestSetModulateRenderMode,		METH_VARARGS },
		{ "testSetAddRenderModeRGB",		chrtestSetAddRenderModeRGB,			METH_VARARGS },
		{ "testSetModulateRenderModeRGB",	chrtestSetModulateRenderModeRGB,	METH_VARARGS },
		{ "testSetSpecularRenderMode",		chrtestSetSpecularRenderMode,		METH_VARARGS },
		{ "testSetSpecularRenderMode2",		chrtestSetSpecularRenderMode2,		METH_VARARGS },
		{ "testRestoreRenderMode",			chrtestRestoreRenderMode,			METH_VARARGS },
		{ "testSetRideMan",					chrtestSetRideMan,					METH_VARARGS },

		{ NULL,								NULL,								NULL		 },
	};

	PyObject * poModule = Py_InitModule("chr", s_methods);

	// Length
	PyModule_AddIntConstant(poModule, "PLAYER_NAME_MAX_LEN",				PLAYER_NAME_MAX_LEN);

	// General
	PyModule_AddIntConstant(poModule, "MOTION_NONE",						CRaceMotionData::NAME_NONE);

	PyModule_AddIntConstant(poModule, "MOTION_SPAWN",						CRaceMotionData::NAME_SPAWN);
	PyModule_AddIntConstant(poModule, "MOTION_WAIT",						CRaceMotionData::NAME_WAIT);
	PyModule_AddIntConstant(poModule, "MOTION_WALK",						CRaceMotionData::NAME_WALK);
	PyModule_AddIntConstant(poModule, "MOTION_RUN",							CRaceMotionData::NAME_RUN);
	PyModule_AddIntConstant(poModule, "MOTION_CHANGE_WEAPON",				CRaceMotionData::NAME_CHANGE_WEAPON);
	PyModule_AddIntConstant(poModule, "MOTION_DAMAGE",						CRaceMotionData::NAME_DAMAGE);
	PyModule_AddIntConstant(poModule, "MOTION_DAMAGE_FLYING",				CRaceMotionData::NAME_DAMAGE_FLYING);
	PyModule_AddIntConstant(poModule, "MOTION_STAND_UP",					CRaceMotionData::NAME_STAND_UP);
	PyModule_AddIntConstant(poModule, "MOTION_DAMAGE_BACK",					CRaceMotionData::NAME_DAMAGE_BACK);
	PyModule_AddIntConstant(poModule, "MOTION_DAMAGE_FLYING_BACK",			CRaceMotionData::NAME_DAMAGE_FLYING_BACK);
	PyModule_AddIntConstant(poModule, "MOTION_STAND_UP_BACK",				CRaceMotionData::NAME_STAND_UP_BACK);
	PyModule_AddIntConstant(poModule, "MOTION_DEAD",						CRaceMotionData::NAME_DEAD);
	PyModule_AddIntConstant(poModule, "MOTION_DEAD_BACK",					CRaceMotionData::NAME_DEAD_BACK);
	PyModule_AddIntConstant(poModule, "MOTION_NORMAL_ATTACK",				CRaceMotionData::NAME_NORMAL_ATTACK);
	PyModule_AddIntConstant(poModule, "MOTION_COMBO_ATTACK_1",				CRaceMotionData::NAME_COMBO_ATTACK_1);
	PyModule_AddIntConstant(poModule, "MOTION_COMBO_ATTACK_2",				CRaceMotionData::NAME_COMBO_ATTACK_2);
	PyModule_AddIntConstant(poModule, "MOTION_COMBO_ATTACK_3",				CRaceMotionData::NAME_COMBO_ATTACK_3);
	PyModule_AddIntConstant(poModule, "MOTION_COMBO_ATTACK_4",				CRaceMotionData::NAME_COMBO_ATTACK_4);
	PyModule_AddIntConstant(poModule, "MOTION_COMBO_ATTACK_5",				CRaceMotionData::NAME_COMBO_ATTACK_5);
	PyModule_AddIntConstant(poModule, "MOTION_COMBO_ATTACK_6",				CRaceMotionData::NAME_COMBO_ATTACK_6);
	PyModule_AddIntConstant(poModule, "MOTION_COMBO_ATTACK_7",				CRaceMotionData::NAME_COMBO_ATTACK_7);
	PyModule_AddIntConstant(poModule, "MOTION_COMBO_ATTACK_8",				CRaceMotionData::NAME_COMBO_ATTACK_8);
	PyModule_AddIntConstant(poModule, "MOTION_INTRO_WAIT",					CRaceMotionData::NAME_INTRO_WAIT);
	PyModule_AddIntConstant(poModule, "MOTION_INTRO_SELECTED",				CRaceMotionData::NAME_INTRO_SELECTED);
	PyModule_AddIntConstant(poModule, "MOTION_INTRO_NOT_SELECTED",			CRaceMotionData::NAME_INTRO_NOT_SELECTED);
	PyModule_AddIntConstant(poModule, "MOTION_FISHING_THROW",				CRaceMotionData::NAME_FISHING_THROW);
	PyModule_AddIntConstant(poModule, "MOTION_FISHING_WAIT",				CRaceMotionData::NAME_FISHING_WAIT);
	PyModule_AddIntConstant(poModule, "MOTION_FISHING_STOP",				CRaceMotionData::NAME_FISHING_STOP);
	PyModule_AddIntConstant(poModule, "MOTION_FISHING_REACT",				CRaceMotionData::NAME_FISHING_REACT);
	PyModule_AddIntConstant(poModule, "MOTION_FISHING_CATCH",				CRaceMotionData::NAME_FISHING_CATCH);
	PyModule_AddIntConstant(poModule, "MOTION_FISHING_FAIL",				CRaceMotionData::NAME_FISHING_FAIL);
	PyModule_AddIntConstant(poModule, "MOTION_STOP",						CRaceMotionData::NAME_STOP);
	PyModule_AddIntConstant(poModule, "MOTION_SKILL",						CRaceMotionData::NAME_SKILL);
	PyModule_AddIntConstant(poModule, "MOTION_CLAP",						CRaceMotionData::NAME_CLAP);
	PyModule_AddIntConstant(poModule, "MOTION_DANCE_1",						CRaceMotionData::NAME_DANCE_1);
	PyModule_AddIntConstant(poModule, "MOTION_DANCE_2",						CRaceMotionData::NAME_DANCE_2);

	PyModule_AddIntConstant(poModule, "MOTION_DANCE_3",						CRaceMotionData::NAME_DANCE_3);
	PyModule_AddIntConstant(poModule, "MOTION_DANCE_4",						CRaceMotionData::NAME_DANCE_4);
	PyModule_AddIntConstant(poModule, "MOTION_DANCE_5",						CRaceMotionData::NAME_DANCE_5);
	PyModule_AddIntConstant(poModule, "MOTION_DANCE_6",						CRaceMotionData::NAME_DANCE_6);
	PyModule_AddIntConstant(poModule, "MOTION_CONGRATULATION",				CRaceMotionData::NAME_CONGRATULATION);
	PyModule_AddIntConstant(poModule, "MOTION_FORGIVE",						CRaceMotionData::NAME_FORGIVE);
	PyModule_AddIntConstant(poModule, "MOTION_ANGRY",						CRaceMotionData::NAME_ANGRY);
	PyModule_AddIntConstant(poModule, "MOTION_ATTRACTIVE",					CRaceMotionData::NAME_ATTRACTIVE);
	PyModule_AddIntConstant(poModule, "MOTION_SAD",							CRaceMotionData::NAME_SAD);
	PyModule_AddIntConstant(poModule, "MOTION_SHY",							CRaceMotionData::NAME_SHY);
	PyModule_AddIntConstant(poModule, "MOTION_CHEERUP",						CRaceMotionData::NAME_CHEERUP);
	PyModule_AddIntConstant(poModule, "MOTION_BANTER",						CRaceMotionData::NAME_BANTER);
	PyModule_AddIntConstant(poModule, "MOTION_JOY",							CRaceMotionData::NAME_JOY);
	

	PyModule_AddIntConstant(poModule, "MOTION_CHEERS_1",					CRaceMotionData::NAME_CHEERS_1);
	PyModule_AddIntConstant(poModule, "MOTION_CHEERS_2",					CRaceMotionData::NAME_CHEERS_2);
	PyModule_AddIntConstant(poModule, "MOTION_KISS_WITH_WARRIOR",			CRaceMotionData::NAME_KISS_WITH_WARRIOR);
	PyModule_AddIntConstant(poModule, "MOTION_KISS_WITH_ASSASSIN",			CRaceMotionData::NAME_KISS_WITH_ASSASSIN);
	PyModule_AddIntConstant(poModule, "MOTION_KISS_WITH_SURA",				CRaceMotionData::NAME_KISS_WITH_SURA);
	PyModule_AddIntConstant(poModule, "MOTION_KISS_WITH_SHAMAN",			CRaceMotionData::NAME_KISS_WITH_SHAMAN);
	PyModule_AddIntConstant(poModule, "MOTION_FRENCH_KISS_WITH_WARRIOR",	CRaceMotionData::NAME_FRENCH_KISS_WITH_WARRIOR);
	PyModule_AddIntConstant(poModule, "MOTION_FRENCH_KISS_WITH_ASSASSIN",	CRaceMotionData::NAME_FRENCH_KISS_WITH_ASSASSIN);
	PyModule_AddIntConstant(poModule, "MOTION_FRENCH_KISS_WITH_SURA",		CRaceMotionData::NAME_FRENCH_KISS_WITH_SURA);
	PyModule_AddIntConstant(poModule, "MOTION_FRENCH_KISS_WITH_SHAMAN",		CRaceMotionData::NAME_FRENCH_KISS_WITH_SHAMAN);
	PyModule_AddIntConstant(poModule, "MOTION_SLAP_HIT_WITH_WARRIOR",		CRaceMotionData::NAME_SLAP_HIT_WITH_WARRIOR);
	PyModule_AddIntConstant(poModule, "MOTION_SLAP_HIT_WITH_ASSASSIN",		CRaceMotionData::NAME_SLAP_HIT_WITH_ASSASSIN);
	PyModule_AddIntConstant(poModule, "MOTION_SLAP_HIT_WITH_SURA",			CRaceMotionData::NAME_SLAP_HIT_WITH_SURA);
	PyModule_AddIntConstant(poModule, "MOTION_SLAP_HIT_WITH_SHAMAN",		CRaceMotionData::NAME_SLAP_HIT_WITH_SHAMAN);
	PyModule_AddIntConstant(poModule, "MOTION_SLAP_HURT_WITH_WARRIOR",		CRaceMotionData::NAME_SLAP_HURT_WITH_WARRIOR);
	PyModule_AddIntConstant(poModule, "MOTION_SLAP_HURT_WITH_ASSASSIN",		CRaceMotionData::NAME_SLAP_HURT_WITH_ASSASSIN);
	PyModule_AddIntConstant(poModule, "MOTION_SLAP_HURT_WITH_SURA",			CRaceMotionData::NAME_SLAP_HURT_WITH_SURA);
	PyModule_AddIntConstant(poModule, "MOTION_SLAP_HURT_WITH_SHAMAN",		CRaceMotionData::NAME_SLAP_HURT_WITH_SHAMAN);
	PyModule_AddIntConstant(poModule, "MOTION_DIG",							CRaceMotionData::NAME_DIG);

	PyModule_AddIntConstant(poModule, "MOTION_MODE_RESERVED",				CRaceMotionData::MODE_RESERVED);
	PyModule_AddIntConstant(poModule, "MOTION_MODE_GENERAL",				CRaceMotionData::MODE_GENERAL);
	PyModule_AddIntConstant(poModule, "MOTION_MODE_ONEHAND_SWORD",			CRaceMotionData::MODE_ONEHAND_SWORD);
	PyModule_AddIntConstant(poModule, "MOTION_MODE_TWOHAND_SWORD",			CRaceMotionData::MODE_TWOHAND_SWORD);
	PyModule_AddIntConstant(poModule, "MOTION_MODE_DUALHAND_SWORD",			CRaceMotionData::MODE_DUALHAND_SWORD);
	PyModule_AddIntConstant(poModule, "MOTION_MODE_BOW",					CRaceMotionData::MODE_BOW);
	PyModule_AddIntConstant(poModule, "MOTION_MODE_FAN",					CRaceMotionData::MODE_FAN);
	PyModule_AddIntConstant(poModule, "MOTION_MODE_BELL",					CRaceMotionData::MODE_BELL);
	PyModule_AddIntConstant(poModule, "MOTION_MODE_FISHING",				CRaceMotionData::MODE_FISHING);
	PyModule_AddIntConstant(poModule, "MOTION_MODE_HORSE",					CRaceMotionData::MODE_HORSE);
	PyModule_AddIntConstant(poModule, "MOTION_MODE_HORSE_ONEHAND_SWORD",	CRaceMotionData::MODE_HORSE_ONEHAND_SWORD);
	PyModule_AddIntConstant(poModule, "MOTION_MODE_HORSE_TWOHAND_SWORD",	CRaceMotionData::MODE_HORSE_TWOHAND_SWORD);
	PyModule_AddIntConstant(poModule, "MOTION_MODE_HORSE_DUALHAND_SWORD",	CRaceMotionData::MODE_HORSE_DUALHAND_SWORD);
	PyModule_AddIntConstant(poModule, "MOTION_MODE_HORSE_BOW",				CRaceMotionData::MODE_HORSE_BOW);
	PyModule_AddIntConstant(poModule, "MOTION_MODE_HORSE_FAN",				CRaceMotionData::MODE_HORSE_FAN);
	PyModule_AddIntConstant(poModule, "MOTION_MODE_HORSE_BELL",				CRaceMotionData::MODE_HORSE_BELL);
	PyModule_AddIntConstant(poModule, "MOTION_MODE_WEDDING_DRESS",			CRaceMotionData::MODE_WEDDING_DRESS);

	PyModule_AddIntConstant(poModule, "DIR_NORTH",							CInstanceBase::DIR_NORTH);
	PyModule_AddIntConstant(poModule, "DIR_NORTHEAST",						CInstanceBase::DIR_NORTHEAST);
	PyModule_AddIntConstant(poModule, "DIR_EAST",							CInstanceBase::DIR_EAST);
	PyModule_AddIntConstant(poModule, "DIR_SOUTHEAST",						CInstanceBase::DIR_SOUTHEAST);
	PyModule_AddIntConstant(poModule, "DIR_SOUTH",							CInstanceBase::DIR_SOUTH);
	PyModule_AddIntConstant(poModule, "DIR_SOUTHWEST",						CInstanceBase::DIR_SOUTHWEST);
	PyModule_AddIntConstant(poModule, "DIR_WEST",							CInstanceBase::DIR_WEST);
	PyModule_AddIntConstant(poModule, "DIR_NORTHWEST",						CInstanceBase::DIR_NORTHWEST);

	PyModule_AddIntConstant(poModule, "INSTANCE_TYPE_PLAYER",				CActorInstance::TYPE_PC);
	PyModule_AddIntConstant(poModule, "INSTANCE_TYPE_NPC",					CActorInstance::TYPE_NPC);
	PyModule_AddIntConstant(poModule, "INSTANCE_TYPE_ENEMY",				CActorInstance::TYPE_ENEMY);
	PyModule_AddIntConstant(poModule, "INSTANCE_TYPE_BUILDING",				CActorInstance::TYPE_BUILDING);
	PyModule_AddIntConstant(poModule, "INSTANCE_TYPE_OBJECT",				CActorInstance::TYPE_OBJECT);

	PyModule_AddIntConstant(poModule, "PART_WEAPON",						CRaceData::PART_WEAPON);
	PyModule_AddIntConstant(poModule, "PART_HEAD",							CRaceData::PART_HEAD);
	PyModule_AddIntConstant(poModule, "PART_WEAPON_LEFT",					CRaceData::PART_WEAPON_LEFT);

	/////

	PyModule_AddIntConstant(poModule, "AFFECT_POISON",						CInstanceBase::AFFECT_POISON);
	PyModule_AddIntConstant(poModule, "AFFECT_SLOW",						CInstanceBase::AFFECT_SLOW);
	PyModule_AddIntConstant(poModule, "AFFECT_STUN",						CInstanceBase::AFFECT_STUN);
	PyModule_AddIntConstant(poModule, "AFFECT_MOV_SPEED_POTION",			CInstanceBase::AFFECT_MOV_SPEED_POTION);
	PyModule_AddIntConstant(poModule, "AFFECT_ATT_SPEED_POTION",			CInstanceBase::AFFECT_ATT_SPEED_POTION);
	PyModule_AddIntConstant(poModule, "AFFECT_FISH_MIND",					CInstanceBase::AFFECT_FISH_MIND);

	PyModule_AddIntConstant(poModule, "AFFECT_JEONGWI",						CInstanceBase::AFFECT_JEONGWI);
	PyModule_AddIntConstant(poModule, "AFFECT_GEOMGYEONG",					CInstanceBase::AFFECT_GEOMGYEONG);
	PyModule_AddIntConstant(poModule, "AFFECT_CHEONGEUN",					CInstanceBase::AFFECT_CHEONGEUN);
	PyModule_AddIntConstant(poModule, "AFFECT_GYEONGGONG",					CInstanceBase::AFFECT_GYEONGGONG);
	PyModule_AddIntConstant(poModule, "AFFECT_EUNHYEONG",					CInstanceBase::AFFECT_EUNHYEONG);
	PyModule_AddIntConstant(poModule, "AFFECT_GWIGEOM",						CInstanceBase::AFFECT_GWIGEOM);
	PyModule_AddIntConstant(poModule, "AFFECT_GONGPO",						CInstanceBase::AFFECT_GONGPO);
	PyModule_AddIntConstant(poModule, "AFFECT_JUMAGAP",						CInstanceBase::AFFECT_JUMAGAP);
	PyModule_AddIntConstant(poModule, "AFFECT_HOSIN",						CInstanceBase::AFFECT_HOSIN);
	PyModule_AddIntConstant(poModule, "AFFECT_BOHO",						CInstanceBase::AFFECT_BOHO);
	PyModule_AddIntConstant(poModule, "AFFECT_KWAESOK",						CInstanceBase::AFFECT_KWAESOK);
	PyModule_AddIntConstant(poModule, "AFFECT_HEUKSIN",						CInstanceBase::AFFECT_HEUKSIN);
	PyModule_AddIntConstant(poModule, "AFFECT_MUYEONG",						CInstanceBase::AFFECT_MUYEONG);
	PyModule_AddIntConstant(poModule, "AFFECT_GICHEON",						CInstanceBase::AFFECT_GICHEON);
	PyModule_AddIntConstant(poModule, "AFFECT_JEUNGRYEOK",					CInstanceBase::AFFECT_JEUNGRYEOK);
	PyModule_AddIntConstant(poModule, "AFFECT_PABEOP",						CInstanceBase::AFFECT_PABEOP);
	PyModule_AddIntConstant(poModule, "AFFECT_FALLEN_CHEONGEUN",			CInstanceBase::AFFECT_FALLEN_CHEONGEUN);
	PyModule_AddIntConstant(poModule, "AFFECT_CHINA_FIREWORK",				CInstanceBase::AFFECT_CHINA_FIREWORK);
	PyModule_AddIntConstant(poModule, "NEW_AFFECT_MALL",					CInstanceBase::NEW_AFFECT_MALL);
	PyModule_AddIntConstant(poModule, "NEW_AFFECT_NO_DEATH_PENALTY",		CInstanceBase::NEW_AFFECT_NO_DEATH_PENALTY);
	PyModule_AddIntConstant(poModule, "NEW_AFFECT_SKILL_BOOK_BONUS",		CInstanceBase::NEW_AFFECT_SKILL_BOOK_BONUS);
	PyModule_AddIntConstant(poModule, "NEW_AFFECT_SKILL_BOOK_NO_DELAY",		CInstanceBase::NEW_AFFECT_SKILL_BOOK_NO_DELAY);
	PyModule_AddIntConstant(poModule, "NEW_AFFECT_EXP_BONUS",				CInstanceBase::NEW_AFFECT_EXP_BONUS);
	PyModule_AddIntConstant(poModule, "NEW_AFFECT_EXP_BONUS_EURO_FREE",		CInstanceBase::NEW_AFFECT_EXP_BONUS_EURO_FREE);
	PyModule_AddIntConstant(poModule, "NEW_AFFECT_EXP_BONUS_EURO_FREE_UNDER_15",CInstanceBase::NEW_AFFECT_EXP_BONUS_EURO_FREE_UNDER_15);

	PyModule_AddIntConstant(poModule, "NEW_AFFECT_ITEM_BONUS",				CInstanceBase::NEW_AFFECT_ITEM_BONUS);
	PyModule_AddIntConstant(poModule, "NEW_AFFECT_SAFEBOX",					CInstanceBase::NEW_AFFECT_SAFEBOX);
	PyModule_AddIntConstant(poModule, "NEW_AFFECT_AUTOLOOT",				CInstanceBase::NEW_AFFECT_AUTOLOOT);
	PyModule_AddIntConstant(poModule, "NEW_AFFECT_FISH_MIND",				CInstanceBase::NEW_AFFECT_FISH_MIND);
	PyModule_AddIntConstant(poModule, "NEW_AFFECT_MARRIAGE_FAST",			CInstanceBase::NEW_AFFECT_MARRIAGE_FAST);
	PyModule_AddIntConstant(poModule, "NEW_AFFECT_GOLD_BONUS",				CInstanceBase::NEW_AFFECT_GOLD_BONUS);
	PyModule_AddIntConstant(poModule, "NEW_AFFECT_AUTO_HP_RECOVERY",		CInstanceBase::NEW_AFFECT_AUTO_HP_RECOVERY);
	PyModule_AddIntConstant(poModule, "NEW_AFFECT_AUTO_SP_RECOVERY",		CInstanceBase::NEW_AFFECT_AUTO_SP_RECOVERY);

	PyModule_AddIntConstant(poModule, "NEW_AFFECT_DRAGON_SOUL_QUALIFIED",		CInstanceBase::NEW_AFFECT_DRAGON_SOUL_QUALIFIED);

	PyModule_AddIntConstant(poModule, "NEW_AFFECT_DRAGON_SOUL_DECK1",		CInstanceBase::NEW_AFFECT_DRAGON_SOUL_DECK1);
	PyModule_AddIntConstant(poModule, "NEW_AFFECT_DRAGON_SOUL_DECK2",		CInstanceBase::NEW_AFFECT_DRAGON_SOUL_DECK2);

}