Exemplo n.º 1
0
    def _run(self):
        structspecs = get_structspecs(
            self.STUBMAIN.classes(in_set(self.MGD_API_STRUCTS)),
            self.STUBMAIN.typedefs(in_set(self.MGD_API_STRUCTS)))

        return STRUCTS_FILE_TEMPLATE % '\n\n'.join(
            map(_generate_struct_code, sorted(structspecs)))
Exemplo n.º 2
0
 def _run(self):
     structspecs = get_structspecs(
         self.STUBMAIN.classes(in_set(self.MGD_API_STRUCTS)),
         self.STUBMAIN.typedefs(in_set(self.MGD_API_STRUCTS)))
     
     return STRUCTS_FILE_TEMPLATE % '\n\n'.join(
         map(_generate_struct_code, sorted(structspecs)))
Exemplo n.º 3
0
    def _run(self):
        mgd_api_function_names, unstring_names = _unpack_mgd_api_functions(
            self.MGD_API_FUNCTIONS)
        all_mgd_functions = get_funcspecs(
            self.STUBMAIN.free_functions(in_set(mgd_api_function_names)),
            self.STUBMAIN.free_functions(prefixed('IC_')),
            self.STUBMAIN.variables(prefixed('IC_')))
        all_mgd_functions = _unstring_mgd_api_functions(
            all_mgd_functions, unstring_names)

        method_infos = []
        not_implemented = self.EXPORTED_FUNCTIONS - self.PURE_C_SYMBOLS
        for (name, spec) in sorted(all_mgd_functions):
            if name in not_implemented:
                not_implemented.remove(name)
            method_infos.append(self._generate_method_info(name, spec))
        not_implemented_method_infos = _symbol_dicts(not_implemented)

        api_methods_code = glom_templates(
            '\n\n',
            (METHOD_TEMPLATE, method_infos),
            (METHOD_NOT_IMPL_TEMPLATE, not_implemented_method_infos),
        )
        getaddress_cases_code = glom_templates(
            '\n',
            (GETADDRESS_CASE_TEMPLATE, method_infos),
            (GETADDRESS_CASE_NOT_IMPL_TEMPLATE, not_implemented_method_infos),
        )

        mgd_data_infos = _symbol_dicts(self.MGD_API_DATA)
        data_properties_code = glom_templates(
            "\n\n", (DATA_PROPERTY_TEMPLATE, mgd_data_infos))
        setdata_cases_code = glom_templates(
            "\n", (SETDATA_CASE_TEMPLATE, mgd_data_infos))

        return PYTHONAPI_FILE_TEMPLATE % {
            'api_methods': api_methods_code,
            'getaddress_cases': getaddress_cases_code,
            'data_properties': data_properties_code,
            'setdata_cases': setdata_cases_code
        }
Exemplo n.º 4
0
    def _run(self):
        mgd_api_function_names, unstring_names = _unpack_mgd_api_functions(self.MGD_API_FUNCTIONS)
        all_mgd_functions = get_funcspecs(
            self.STUBMAIN.free_functions(in_set(mgd_api_function_names)),
            self.STUBMAIN.free_functions(prefixed('IC_')),
            self.STUBMAIN.variables(prefixed('IC_')))
        all_mgd_functions = _unstring_mgd_api_functions(all_mgd_functions, unstring_names)
    
        method_infos = []
        not_implemented = self.EXPORTED_FUNCTIONS - self.PURE_C_SYMBOLS
        for (name, spec) in sorted(all_mgd_functions):
            if name in not_implemented:
                not_implemented.remove(name)
            method_infos.append(self._generate_method_info(name, spec))
        not_implemented_method_infos = _symbol_dicts(not_implemented)
        
        api_methods_code = glom_templates('\n\n',
            (METHOD_TEMPLATE, method_infos), 
            (METHOD_NOT_IMPL_TEMPLATE, not_implemented_method_infos),
        )
        getaddress_cases_code = glom_templates('\n',
            (GETADDRESS_CASE_TEMPLATE, method_infos),
            (GETADDRESS_CASE_NOT_IMPL_TEMPLATE, not_implemented_method_infos),
        )

        mgd_data_infos = _symbol_dicts(self.MGD_API_DATA)
        data_properties_code = glom_templates("\n\n",
            (DATA_PROPERTY_TEMPLATE, mgd_data_infos))
        setdata_cases_code = glom_templates("\n",
            (SETDATA_CASE_TEMPLATE, mgd_data_infos))

        return PYTHONAPI_FILE_TEMPLATE % {
            'api_methods': api_methods_code, 
            'getaddress_cases': getaddress_cases_code, 
            'data_properties': data_properties_code, 
            'setdata_cases': setdata_cases_code
        }