lib.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:exosip2ctypes 作者: tanbro 项目源码 文件源码
def initialize(path=None):
    """Load `libeXosip2` into this Python library

    :param str path: `libeXosip2` SO/DLL path, `default` is `None`.
        When `None` or empty string, the function will try to find and load so/dll by :data:`DLL_NAME`
    """
    _logger.info('initialize: >>> path=%s', path)
    if globs.libexosip2:
        raise RuntimeError('library eXosip2 already loaded')
    if not path:
        _logger.debug('initialize: find_library "%s"', DLL_NAME)
        path = find_library(DLL_NAME)
        if not path:
            raise RuntimeError('Failed to find library {}'.format(DLL_NAME))
    _logger.debug('initialize: CDLL %s', path)
    globs.libexosip2 = CDLL(path)
    if not globs.libexosip2:
        raise RuntimeError('Failed to load library {}'.format(path))
    _logger.debug('initialize: libexosip2=%s', globs.libexosip2)
    for cls in globs.func_classes:
        cls.bind()
    _logger.info('initialize: <<<')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号