# Path: pywrap/utils.py
# def lines(*args):
#     """Make multi-line string."""
#     return os.linesep.join(args)
# 
# def replace_keyword_argnames(argname):
#     """Replace Python keywords.
# 
#     We will add the prefix "_".
#     """
#     if keyword.iskeyword(argname):
#         argname = "_" + argname
#     return argname
# 
# Path: pywrap/templates.py
# def render(template, **kwargs):
#     """Render a Jinja2 template.
# 
#     Parameters
#     ----------
#     template : str
#         Name of the template file (without '.template' suffix). It must be
#         located in the directory 'pywrap/template_data'.
# 
#     kwargs : dict
#         Template arguments.
# 
#     Returns
#     -------
#     text : str
#         Rendered template.
#     """
#     template_file = resource_filename(
#         "pywrap", os.path.join("template_data", template + ".template"))
#     if not os.path.exists(template_file):
#         raise IOError("No template for '%s' found." % template)
#     template = jinja2.Template(open(template_file, "r").read())
#     return template.render(**kwargs)


import os
import re
from abc import ABCMeta, abstractmethod
from .utils import lines, replace_keyword_argnames
from .templates import render


def is_basic_type_with_automatic_conversion(typename):
    # source: http://docs.cython.org/src/userguide/wrapping_CPlusPlus.html#standard-library
    return typename in ["bool", "string", "char *",
                        "int", "unsigned int", "long", "unsigned long",
                        "float", "double"]


def is_stl_type_with_automatic_conversion(typename):
    # source: http://docs.cython.org/src/userguide/wrapping_CPlusPlus.html#standard-library

# Path: pywrap/utils.py
# def lines(*args):
#     """Make multi-line string."""
#     return os.linesep.join(args)
# 
# def replace_keyword_argnames(argname):
#     """Replace Python keywords.
# 
#     We will add the prefix "_".
#     """
#     if keyword.iskeyword(argname):
#         argname = "_" + argname
#     return argname
# 
# Path: pywrap/templates.py
# def render(template, **kwargs):
#     """Render a Jinja2 template.
# 
#     Parameters
#     ----------
#     template : str
#         Name of the template file (without '.template' suffix). It must be
#         located in the directory 'pywrap/template_data'.
# 
#     kwargs : dict
#         Template arguments.
# 
#     Returns
#     -------
#     text : str
#         Rendered template.
#     """
#     template_file = resource_filename(
#         "pywrap", os.path.join("template_data", template + ".template"))
#     if not os.path.exists(template_file):
#         raise IOError("No template for '%s' found." % template)
#     template = jinja2.Template(open(template_file, "r").read())
#     return template.render(**kwargs)


# Path: pywrap/type_conversion.py
import os
import re
from abc import ABCMeta, abstractmethod
from .utils import lines, replace_keyword_argnames
from .templates import render



def is_basic_type_with_automatic_conversion(typename):
    # source: http://docs.cython.org/src/userguide/wrapping_CPlusPlus.html#standard-library
    return typename in ["bool", "string", "char *",
                        "int", "unsigned int", "long", "unsigned long",
                        "float", "double"]


def is_stl_type_with_automatic_conversion(typename):
    # source: http://docs.cython.org/src/userguide/wrapping_CPlusPlus.html#standard-library

    for container in ["string", "map", "vector", "list", "set", "pair"]: