Commit f6cd06d3 authored by François Grisez's avatar François Grisez
Browse files

Wrappers generator: logging system reworking

parent a2f363ac
......@@ -18,10 +18,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import sys
import os
import argparse
import logging
import os
import pystache
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', '..', '..', 'tools'))
import abstractapi
......@@ -363,7 +364,11 @@ if __name__ == '__main__':
argparser = argparse.ArgumentParser(description='Generate a sphinx project to generate the documentation of Linphone Core API.')
argparser.add_argument('xmldir', type=str, help='directory holding the XML documentation of the C API generated by Doxygen')
argparser.add_argument('-o --output', type=str, help='directory into where Sphinx source files will be written', dest='outputdir', default='.')
argparser.add_argument('-v --verbose', action='store_true', default=False, dest='verbose_mode', help='Show warning and info messages')
args = argparser.parse_args()
loglevel = logging.INFO if args.verbose_mode else logging.ERROR
logging.basicConfig(format='%(levelname)s[%(name)s]: %(message)s', level=loglevel)
cProject = capi.Project()
cProject.initFromDir(args.xmldir)
......
......@@ -350,26 +350,23 @@ LINPHONE_PUBLIC void linphone_call_set_audio_route (LinphoneCall *call, Linphone
LINPHONE_PUBLIC int linphone_call_get_stream_count (const LinphoneCall *call);
/**
* Returns the type of stream for the given stream index.
* @param call
* @param stream_index
* @brief Returns the type of stream for the given stream index.
* @return the type (MSAudio, MSVideo, MSText) of the stream of given index.
* @donotwrap
**/
LINPHONE_PUBLIC MSFormatType linphone_call_get_stream_type (const LinphoneCall *call, int stream_index);
/**
* Returns the meta rtp transport for the given stream index.
* @param call
* @param stream_index
* @return a pointer to the meta rtp transport if it exists, NULL otherwise
* @brief Returns the meta rtp transport for the given stream index.
* @return a pointer to the meta rtp transport if it exists, NULL otherwise.
* @donotwrap
**/
LINPHONE_PUBLIC RtpTransport *linphone_call_get_meta_rtp_transport (const LinphoneCall *call, int stream_index);
/**
* Returns the meta rtcp transport for the given stream index.
* @param call
* @param stream_index
* @return a pointer to the meta rtcp transport if it exists, NULL otherwise
* @brief Returns the meta rtcp transport for the given stream index.
* @return a pointer to the meta rtcp transport if it exists, NULL otherwise.
* @donotwrap
**/
LINPHONE_PUBLIC RtpTransport *linphone_call_get_meta_rtcp_transport (const LinphoneCall *call, int stream_index);
......
......@@ -68,6 +68,7 @@ LINPHONE_PUBLIC const LinphoneAddress * linphone_call_log_get_from_address(const
* Get the RTP statistics computed locally regarding the call.
* @param[in] cl LinphoneCallLog object
* @return The RTP statistics that have been computed locally for the call.
* @donotwrap
**/
LINPHONE_PUBLIC const rtp_stats_t * linphone_call_log_get_local_stats(const LinphoneCallLog *cl);
......@@ -101,6 +102,7 @@ LINPHONE_PUBLIC LinphoneAddress * linphone_call_log_get_remote_address(const Lin
* @note Not implemented yet.
* @param[in] cl LinphoneCallLog object
* @return The RTP statistics that have been computed by the remote end for the call.
* @donotwrap
**/
LINPHONE_PUBLIC const rtp_stats_t * linphone_call_log_get_remote_stats(const LinphoneCallLog *cl);
......
......@@ -140,10 +140,11 @@ LINPHONE_PUBLIC float linphone_call_params_get_received_framerate(const Linphone
LINPHONE_PUBLIC const LinphoneVideoDefinition * linphone_call_params_get_received_video_definition(const LinphoneCallParams *cp);
/**
* Get the size of the video that is received.
* @param[in] cp LinphoneCallParams object
* @brief Get the size of the video that is received.
* @param[in] cp #LinphoneCallParams object
* @return The received video size or MS_VIDEO_SIZE_UNKNOWN if not available.
* @deprecated Use linphone_call_params_get_received_video_definition() instead
* @deprecated Use #linphone_call_params_get_received_video_definition() instead. Deprecated since 2017-03-28.
* @donotwrap
*/
LINPHONE_PUBLIC LINPHONE_DEPRECATED MSVideoSize linphone_call_params_get_received_video_size(const LinphoneCallParams *cp);
......@@ -176,10 +177,11 @@ LINPHONE_PUBLIC float linphone_call_params_get_sent_framerate(const LinphoneCall
LINPHONE_PUBLIC const LinphoneVideoDefinition * linphone_call_params_get_sent_video_definition(const LinphoneCallParams *cp);
/**
* Gets the size of the video that is sent.
* @param[in] cp LinphoneCalParams object
* @biref Gets the size of the video that is sent.
* @param[in] cp #LinphoneCalParams object
* @return The sent video size or MS_VIDEO_SIZE_UNKNOWN if not available.
* @deprecated Use linphone_call_params_get_sent_video_definition() instead
* @deprecated Use #linphone_call_params_get_sent_video_definition() instead. Deprecated since 2017-03-28.
* @donotwrap
*/
LINPHONE_PUBLIC LINPHONE_DEPRECATED MSVideoSize linphone_call_params_get_sent_video_size(const LinphoneCallParams *cp);
......
......@@ -193,22 +193,25 @@ typedef struct _LinphoneCoreVTable{
} LinphoneCoreVTable;
/**
* Instantiate a vtable with all arguments set to NULL
* @return newly allocated vtable
* @brief Instantiate a vtable with all arguments set to NULL.
* @return newly allocated vtable.
* @donotwrap
*/
LINPHONE_PUBLIC LinphoneCoreVTable *linphone_core_v_table_new(void);
/**
* Sets a user data pointer in the vtable.
* @param table the vtable
* @param data the user data to attach
* @brief Sets a user data pointer in the vtable.
* @param table the vtable.
* @param data the user data to attach.
* @donotwrap
*/
LINPHONE_PUBLIC void linphone_core_v_table_set_user_data(LinphoneCoreVTable *table, void *data);
/**
* Gets a user data pointer in the vtable.
* @param table the vtable
* @return the data attached to the vtable
* @brief Gets a user data pointer in the vtable.
* @param table the vtable.
* @return the data attached to the vtable.
* @donotwrap
*/
LINPHONE_PUBLIC void* linphone_core_v_table_get_user_data(const LinphoneCoreVTable *table);
......@@ -222,8 +225,9 @@ LINPHONE_PUBLIC void* linphone_core_v_table_get_user_data(const LinphoneCoreVTab
LINPHONE_PUBLIC LinphoneCoreVTable *linphone_core_get_current_vtable(LinphoneCore *lc);
/**
* Destroy a vtable.
* @param table to be destroyed
* @brief Destroy a vtable.
* @param table to be destroyed.
* @donotwrap
*/
LINPHONE_PUBLIC void linphone_core_v_table_destroy(LinphoneCoreVTable* table);
......@@ -786,25 +790,25 @@ LINPHONE_PUBLIC char * linphone_core_compress_log_collection(void);
LINPHONE_PUBLIC void linphone_core_reset_log_collection(void);
/**
* Define a log handler.
*
* @bref Define a log handler.
* @param logfunc The function pointer of the log handler.
* @donotwrap
*/
LINPHONE_PUBLIC void linphone_core_set_log_handler(OrtpLogFunc logfunc);
/**
* Define a log file.
* @brief Define a log file.
*
* If the file pointer passed as an argument is NULL, stdout is used instead.
*
* @param file A pointer to the FILE structure of the file to write to.
* @donotwrap
*/
LINPHONE_PUBLIC void linphone_core_set_log_file(FILE *file);
/**
* Define the minimum level for logging.
*
* @brief Define the minimum level for logging.
* @param loglevel Minimum level for logging messages.
* @donotwrap
**/
LINPHONE_PUBLIC void linphone_core_set_log_level(OrtpLogLevel loglevel);
......@@ -3303,7 +3307,8 @@ LINPHONE_PUBLIC bool_t linphone_core_video_display_enabled(LinphoneCore *lc);
* @param[in] lc LinphoneCore object
* @param[in] policy The video policy to use
* @ingroup media_parameters
* @deprecated
* @deprecated Deprecated since 2017-04-19.
* @donotwrap
**/
LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_core_set_video_policy(LinphoneCore *lc, const LinphoneVideoPolicy *policy);
......@@ -3313,7 +3318,8 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_core_set_video_policy(Linphone
* @param[in] lc LinphoneCore object
* @return The video policy being used
* @ingroup media_parameters
* @deprecated
* @deprecated Deprecated since 2017-04-19.
* @donotwrap
**/
LINPHONE_PUBLIC LINPHONE_DEPRECATED const LinphoneVideoPolicy *linphone_core_get_video_policy(const LinphoneCore *lc);
......@@ -3400,9 +3406,10 @@ LINPHONE_PUBLIC void linphone_core_set_video_activation_policy(LinphoneCore *lc,
LINPHONE_PUBLIC LinphoneVideoActivationPolicy *linphone_core_get_video_activation_policy(const LinphoneCore *lc);
/**
* Returns the zero terminated table of supported video resolutions.
* @brief Returns the zero terminated table of supported video resolutions.
* @ingroup media_parameters
* @deprecated Use linphone_factory_get_supported_video_definitions() instead
* @deprecated Use #linphone_factory_get_supported_video_definitions() instead. Deprecated since 2017-03-28.
* @donotwrap
**/
LINPHONE_PUBLIC LINPHONE_DEPRECATED const MSVideoSizeDef *linphone_core_get_supported_video_sizes(LinphoneCore *lc);
......@@ -3416,12 +3423,13 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED const MSVideoSizeDef *linphone_core_get_supp
LINPHONE_PUBLIC void linphone_core_set_preferred_video_definition(LinphoneCore *lc, LinphoneVideoDefinition *vdef);
/**
* Sets the preferred video size.
* @brief Sets the preferred video size.
*
* This applies only to the stream that is captured and sent to the remote party,
* since we accept all standard video size on the receive path.
* @ingroup media_parameters
* @deprecated Use linphone_core_set_preferred_video_definition() instead
* @deprecated Use linphone_core_set_preferred_video_definition() instead. Deprecated since 2017-03-28.
* @donotwrap
**/
LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_core_set_preferred_video_size(LinphoneCore *lc, MSVideoSize vsize);
......@@ -3437,14 +3445,16 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_core_set_preferred_video_size(
LINPHONE_PUBLIC void linphone_core_set_preview_video_definition(LinphoneCore *lc, LinphoneVideoDefinition *vdef);
/**
* Sets the video size for the captured (preview) video.
* @biref Sets the video size for the captured (preview) video.
*
* This method is for advanced usage where a video capture must be set independently of the size of the stream actually sent through the call.
* This allows for example to have the preview window with HD resolution even if due to bandwidth constraint the sent video size is small.
* Using this feature increases the CPU consumption, since a rescaling will be done internally.
* @ingroup media_parameters
* @param lc the linphone core
* @param vsize the video resolution choosed for capuring and previewing. It can be (0,0) to not request any specific preview size and let the core optimize the processing.
* @deprecated Use linphone_core_set_preview_video_definition() instead
* @deprecated Use #linphone_core_set_preview_video_definition() instead. Deprecated since 2017-03-28.
* @donotwrap
**/
LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_core_set_preview_video_size(LinphoneCore *lc, MSVideoSize vsize);
......@@ -3467,12 +3477,13 @@ LINPHONE_PUBLIC void linphone_core_set_preview_video_size_by_name(LinphoneCore *
LINPHONE_PUBLIC const LinphoneVideoDefinition * linphone_core_get_preview_video_definition(const LinphoneCore *lc);
/**
* Returns video size for the captured video if it was previously set by linphone_core_set_preview_video_size(), otherwise returns a 0,0 size.
* @see linphone_core_set_preview_video_size()
* @brief Returns video size for the captured video if it was previously set by #linphone_core_set_preview_video_size(), otherwise returns a 0,0 size.
* @see #linphone_core_set_preview_video_size()
* @ingroup media_parameters
* @param lc the core
* @return a MSVideoSize
* @deprecated Use linphone_core_get_preview_video_definition() instead
* @return a #MSVideoSize
* @deprecated Use #linphone_core_get_preview_video_definition() instead. Since 2017-03-28.
* @donotwrap
**/
LINPHONE_PUBLIC LINPHONE_DEPRECATED MSVideoSize linphone_core_get_preview_video_size(const LinphoneCore *lc);
......@@ -3487,13 +3498,15 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED MSVideoSize linphone_core_get_preview_video_
LINPHONE_PUBLIC LinphoneVideoDefinition * linphone_core_get_current_preview_video_definition(const LinphoneCore *lc);
/**
* Returns the effective video size for the captured video as provided by the camera.
* @brief Returns the effective video size for the captured video as provided by the camera.
*
* When preview is disabled or not yet started, this function returns a zeroed video size.
* @see linphone_core_set_preview_video_size()
* @see #linphone_core_set_preview_video_size()
* @ingroup media_parameters
* @param lc the core
* @return a MSVideoSize
* @deprecated Use linphone_core_get_current_preview_video_definition() instead
* @return a #MSVideoSize
* @deprecated Use #linphone_core_get_current_preview_video_definition() instead. Deprecated since 2017-03-28.
* @donotwrap
**/
LINPHONE_PUBLIC LINPHONE_DEPRECATED MSVideoSize linphone_core_get_current_preview_video_size(const LinphoneCore *lc);
......@@ -3506,9 +3519,10 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED MSVideoSize linphone_core_get_current_previe
LINPHONE_PUBLIC const LinphoneVideoDefinition * linphone_core_get_preferred_video_definition(const LinphoneCore *lc);
/**
* Returns the current preferred video size for sending.
* @brief Returns the current preferred video size for sending.
* @ingroup media_parameters
* @deprecated Use linphone_core_get_preferred_video_definition() instead
* @deprecated Use linphone_core_get_preferred_video_definition() instead. Deprecated since 2017-03-28.
* @donotwrap
**/
LINPHONE_PUBLIC LINPHONE_DEPRECATED MSVideoSize linphone_core_get_preferred_video_size(const LinphoneCore *lc);
......@@ -4708,24 +4722,27 @@ LINPHONE_PUBLIC void linphone_core_enable_video_multicast(LinphoneCore *core, bo
LINPHONE_PUBLIC bool_t linphone_core_video_multicast_enabled(const LinphoneCore *core);
/**
* Set the network simulator parameters.
* @brief Set the network simulator parameters.
*
* Liblinphone has the capabability of simulating the effects of a network (latency, lost packets, jitter, max bandwidth).
* Please refer to the oRTP documentation for the meaning of the parameters of the OrtpNetworkSimulatorParams structure.
* This function has effect for future calls, but not for currently running calls, though this behavior may be changed in future versions.
* @warning Due to design of network simulation in oRTP, simulation is applied independently for audio and video stream. This means for example that a bandwidth
* limit of 250kbit/s will have no effect on an audio stream running at 40kbit/s while a videostream targetting 400kbit/s will be highly affected.
* @param lc the LinphoneCore
* @param lc the #LinphoneCore
* @param params the parameters used for the network simulation.
* @return 0 if successful, -1 otherwise.
* @ingroup media_parameters
* @donotwrap
**/
LINPHONE_PUBLIC LinphoneStatus linphone_core_set_network_simulator_params(LinphoneCore *lc, const OrtpNetworkSimulatorParams *params);
/**
* Get the previously set network simulation parameters.
* @brief Get the previously set network simulation parameters.
* @see linphone_core_set_network_simulator_params
* @return a OrtpNetworkSimulatorParams structure.
* @return a #OrtpNetworkSimulatorParams structure.
* @ingroup media_parameters
* @donotwrap
**/
LINPHONE_PUBLIC const OrtpNetworkSimulatorParams *linphone_core_get_network_simulator_params(const LinphoneCore *lc);
......@@ -4862,6 +4879,7 @@ LINPHONE_PUBLIC const char *linphone_core_get_tls_key_path(const LinphoneCore *l
* @param lc LinphoneCore object
* @param imee LinphoneImEncryptionEngine object
* @ingroup chatroom
* @donotwrap
*/
LINPHONE_PUBLIC void linphone_core_set_im_encryption_engine(LinphoneCore *lc, LinphoneImEncryptionEngine *imee);
......@@ -4870,6 +4888,7 @@ LINPHONE_PUBLIC void linphone_core_set_im_encryption_engine(LinphoneCore *lc, Li
* @param lc LinphoneCore object
* @return the IM Encryption Engine in the core or NULL
* @ingroup chatroom
* @donotwrap
*/
LINPHONE_PUBLIC LinphoneImEncryptionEngine * linphone_core_get_im_encryption_engine(const LinphoneCore *lc);
......
......@@ -55,12 +55,12 @@ LINPHONE_DEPRECATED typedef void (*LinphoneEcCalibrationAudioInit)(void *data);
LINPHONE_DEPRECATED typedef void (*LinphoneEcCalibrationAudioUninit)(void *data);
/**
*
* @brief Starts an echo calibration of the sound devices, in order to find adequate settings for the echo canceler automatically.
* @deprecated Use #linphone_core_start_echo_canceller_calibration() instead. To set the callbacks create or get an already instantiated
* #LinphoneCoreCbs and call #linphone_core_cbs_set_ec_calibration_result(), #linphone_core_cbs_set_ec_calibration_audio_init() and
* #linphone_core_cbs_set_ec_callibration_audio_uninit(). Deprecated since 2017-10-16.
* @ingroup misc
* @donotwrap
**/
LINPHONE_DEPRECATED LINPHONE_PUBLIC int linphone_core_start_echo_calibration(LinphoneCore *lc, LinphoneEcCalibrationCallback cb,
LinphoneEcCalibrationAudioInit audio_init_cb, LinphoneEcCalibrationAudioUninit audio_uninit_cb, void *cb_data);
......
......@@ -245,12 +245,14 @@ LINPHONE_PUBLIC const char** linphone_config_get_sections_names(LinphoneConfig *
LINPHONE_PUBLIC const bctbx_list_t * linphone_config_get_sections_names_list(LpConfig *lpconfig);
/**
* Call a function for each section present in the configuration.
* @brief Call a function for each section present in the configuration.
* @donotwrap
**/
void linphone_config_for_each_section(const LinphoneConfig *lpconfig, void (*callback)(const char *section, void *ctx), void *ctx);
/**
* Call a function for each entry present in a section configuration.
* @brief Call a function for each entry present in a section configuration.
* @donotwrap
**/
void linphone_config_for_each_entry(const LinphoneConfig *lpconfig, const char *section, void (*callback)(const char *entry, void *ctx), void *ctx);
......
......@@ -172,6 +172,7 @@ LINPHONE_PUBLIC void linphone_nat_policy_resolve_stun_server(LinphoneNatPolicy *
* WARNING: This function may block for up to 1 second.
* @param[in] policy LinphoneNatPolicy object
* @return addrinfo representation of the STUN server address.
* @donotwrap
*/
LINPHONE_PUBLIC const struct addrinfo * linphone_nat_policy_get_stun_server_addrinfo(LinphoneNatPolicy *policy);
......
......@@ -19,13 +19,65 @@
import re
import genapixml as CApi
import metaname
import logging
class Error(RuntimeError):
pass
logger = logging.getLogger(__name__)
class Error(Exception):
@property
def reason(self):
return self.args[0]
def __str__(self):
return str(self.reason)
@staticmethod
def _name_get_type_as_string(name):
if type(name) is metaname.ClassName:
return 'class'
elif type(name) is metaname.EnumName:
return 'enum'
elif type(name) is metaname.EnumeratorName:
return 'enumerator'
elif type(name) is metaname.MethodName:
return 'function'
else:
raise TypeError('{0} not handled'.format(type(name)))
class BlacklistedException(Error):
class ParsingError(Error):
@property
def context(self):
return self.args[1] if len(self.args) >= 2 else None
def __str__(self):
if self.context is None:
return Error.__str__(self)
else:
params = {
'reason': self.reason,
'name': self.context.to_c(addBrackets=True),
'type_': Error._name_get_type_as_string(self.context)
}
return "error while parsing {name} {type_}: {reason}".format(**params)
class BlacklistedSymbolError(Error):
@property
def name(self):
return self.args[0]
def __str__(self):
params = {
'name': self.name.to_c(addBrackets=True),
'type_': Error._name_get_type_as_string(self.name)
}
return "{name} {type_} has been blacklisted".format(**params)
class TranslationError(Error):
pass
......@@ -154,7 +206,7 @@ class DocumentableObject(Object):
if isinstance(self, (Namespace,Enum,Class)):
return self
elif self.parent is None:
raise Error('{0} is not attached to a namespace object'.format(self))
return None
else:
return self.parent.get_namespace_object()
......@@ -424,17 +476,14 @@ class CParser(object):
for enum in self.cProject.enums:
try:
self.parse_enum(enum)
except Error as e:
print('Could not parse \'{0}\' enum: {1}'.format(enum.name, e.args[0]))
except BlacklistedSymbolError as e:
logger.debug(e)
for _class in self.cProject.classes:
for class_ in self.cProject.classes:
try:
self.parse_class(_class)
except BlacklistedException:
pass
except Error as e:
print('Could not parse \'{0}\' class: {1}'.format(_class.name, e.args[0]))
self.parse_class(class_)
except BlacklistedSymbolError as e:
logger.debug(e)
self._clean_all_indexes()
self._sortall()
......@@ -504,8 +553,8 @@ class CParser(object):
self._fix_type(method.returnType)
for arg in method.args:
self._fix_type(arg.type)
except Error as e:
print('warning: some types could not be fixed in {0}() function: {1}'.format(method.name.to_snake_case(fullName=True), e.args[0]))
except ParsingError as e:
raise ParsingError(e, method.name)
def _fix_type(self, _type):
if isinstance(_type, EnumType) and _type.desc is None:
......@@ -526,7 +575,7 @@ class CParser(object):
if _type.containedTypeName is not None:
_type.containedTypeDesc = self.parse_c_base_type(_type.containedTypeName)
else:
raise Error('bctbx_list_t type without specified contained type')
raise ParsingError('bctbx_list_t type without specified contained type')
def _fix_all_docs(self):
for _class in self.classesIndex.values():
......@@ -545,13 +594,8 @@ class CParser(object):
obj.detailedDescription.resolve_all_references(self)
def parse_enum(self, cenum):
if 'associatedTypedef' in dir(cenum):
nameStr = cenum.associatedTypedef.name
else:
nameStr = cenum.name
name = metaname.EnumName()
name.from_camel_case(nameStr, namespace=self.namespace.name)
name.from_camel_case(cenum.publicName, namespace=self.namespace.name)
enum = Enum(name)
enum.briefDescription = cenum.briefDoc
enum.detailedDescription = cenum.detailedDoc
......@@ -567,16 +611,21 @@ class CParser(object):
try:
aEnumValue.value_from_string(cEnumValue.value)
except ValueError:
raise Error('{0} enum value has an invalid definition ({1})'.format(cEnumValue.name, cEnumValue.value))
reason = '{0} enum value has an invalid definition ({1})'.format(cEnumValue.name, cEnumValue.value)
context = metaname.EnumeratorName()
context.from_camel_case(cEnumValue.name)
raise ParsingError(reason, context)
enum.add_enumerator(aEnumValue)
self.enumsIndex[nameStr] = enum
self.enumsIndex[cenum.publicName] = enum
self.enums.append(enum)
return enum
def parse_class(self, cclass):
if cclass.name in self.classBl:
raise BlacklistedException('{0} is blacklisted'.format(cclass.name));
name = metaname.ClassName()
name.from_snake_case(cclass.name)
raise BlacklistedSymbolError(name)
if cclass.name.endswith('Cbs'):
_class = self._parse_listener(cclass)
......@@ -603,8 +652,8 @@ class CParser(object):
_class.add_property(absProperty)
else:
_class.listenerInterface = self.interfacesIndex[cproperty.getter.returnArgument.ctype]
except Error as e:
print('Could not parse {0} property in {1}: {2}'.format(cproperty.name, cclass.name, e.args[0]))
except BlacklistedSymbolError as e:
logger.debug(e)
for cMethod in cclass.instanceMethods.values():
try:
......@@ -617,20 +666,15 @@ class CParser(object):
pass
else:
_class.add_instance_method(method)
except BlacklistedException:
pass
except Error as e:
print('Could not parse {0} function: {1}'.format(cMethod.name, e.args[0]))
except BlacklistedSymbolError as e:
logger.debug(e)
for cMethod in cclass.classMethods.values():
try:
method = self.parse_method(cMethod, type=Method.Type.Class, namespace=name)
_class.add_class_method(method)
except BlacklistedException:
pass
except Error as e:
print('Could not parse {0} function: {1}'.format(cMethod.name, e.args[0]))
except BlacklistedSymbolError as e:
logger.debug(e)
return _class
......@@ -652,27 +696,28 @@ class CParser(object):
def _parse_listener(self, cclass):
name = metaname.InterfaceName()
name.from_camel_case(cclass.name, namespace=self.namespace.name)
if name.words[len(name.words)-1] == 'cbs':
name.words[len(name.words)-1] = 'listener'
else:
raise Error('{0} is not a listener'.format(cclass.name))
listener = Interface(name)
listener.briefDescription = cclass.briefDoc
listener.detailedDescription = cclass.detailedDoc
for property in cclass.properties.values():
if property.name != 'user_data':
try:
method = self._parse_listener_property(property, listener, cclass.events)
listener.add_method(method)
except Error as e:
print('Could not parse property \'{0}\' of listener \'{1}\': {2}'.format(property.name, cclass.name, e.args[0]))
return listener
try:
name = metaname.InterfaceName()
name.from_camel_case(cclass.name, namespace=self.namespace.name)
name.words[-1] = 'listener'
listener = Interface(name)
listener.briefDescription = cclass.briefDoc
listener.detailedDescription = cclass.detailedDoc
for property in cclass.properties.values():
if property.name != 'user_data':
try: