Eolian: Fix/add more docs

This commit is contained in:
Kai Huuhko 2014-06-17 07:36:40 +03:00
parent e5c82e08d6
commit abefe9eb89
1 changed files with 37 additions and 8 deletions

View File

@ -215,7 +215,9 @@ def class_find_by_name(class_name):
"""Finds a class by its name """Finds a class by its name
:param class_name: name of the class to find. :param class_name: name of the class to find.
:type class_name: string
:return: the class :return: the class
:rtype: :class:`Class`
""" """
if isinstance(class_name, unicode): class_name = PyUnicode_AsUTF8String(class_name) if isinstance(class_name, unicode): class_name = PyUnicode_AsUTF8String(class_name)
@ -229,7 +231,9 @@ def class_find_by_file(file_name):
"""Finds a class by its location (.eo file) """Finds a class by its location (.eo file)
:param file_name: filename where the class is stored. :param file_name: filename where the class is stored.
:type file_name: string
:return: the class stored in the file :return: the class stored in the file
:rtype: :class:`Class`
""" """
if isinstance(file_name, unicode): file_name = PyUnicode_AsUTF8String(file_name) if isinstance(file_name, unicode): file_name = PyUnicode_AsUTF8String(file_name)
@ -359,7 +363,8 @@ cdef class Class(object):
"""Returns a list of functions of a class. """Returns a list of functions of a class.
:param func_type: type of the functions to insert into the list. :param func_type: type of the functions to insert into the list.
:return: the list of Eolian_Function :type ftype: :class:`FunctionType`
:rtype: list of :class:`Function`
""" """
return eina_list_obj_to_python_list( return eina_list_obj_to_python_list(
@ -372,7 +377,7 @@ cdef class Class(object):
property implements: property implements:
"""Get the list of overriding functions defined in a class. """Get the list of overriding functions defined in a class.
:type: list of :py:class:`Implement` :type: list of :class:`Implement`
""" """
def __get__(self): def __get__(self):
@ -383,7 +388,7 @@ cdef class Class(object):
property events: property events:
"""Get the list of events defined in a class. """Get the list of events defined in a class.
:type: list of :py:class:`Event` :type: list of :class:`Event`
""" """
def __get__(self): def __get__(self):
@ -415,7 +420,9 @@ cdef class Class(object):
"""Find a function in a class by its name and type """Find a function in a class by its name and type
:param func_name: name of the function :param func_name: name of the function
:type func_name: string
:param f_type: type of the function :param f_type: type of the function
:type ftype: :class:`FunctionType`
:return: the function id if found, None otherwise. :return: the function id if found, None otherwise.
""" """
@ -432,6 +439,7 @@ def class_names_list_get():
"""Returns the names list of all the classes stored into the database. """Returns the names list of all the classes stored into the database.
:return: the list :return: the list
:rtype: list of string
Returns the list of class names of the database Returns the list of class names of the database
@ -487,7 +495,9 @@ cdef class Function(object):
"""Returns a specific data for a function. """Returns a specific data for a function.
:param key: key to access the data :param key: key to access the data
:type key: string
:return: the data. :return: the data.
:rtype: string
""" """
if isinstance(key, unicode): key = PyUnicode_AsUTF8String(key) if isinstance(key, unicode): key = PyUnicode_AsUTF8String(key)
@ -496,7 +506,10 @@ cdef class Function(object):
def is_virtual_pure_get(self, Eolian_Function_Type f_type): def is_virtual_pure_get(self, Eolian_Function_Type f_type):
"""Indicates if a function is virtual pure. """Indicates if a function is virtual pure.
:return: True if virtual pure, False otherwise.. :param ftype: type of the function
:type ftype: :class:`FunctionType`
:return: True if virtual pure, False otherwise.
:rtype: bool
""" """
return bool(eolian_function_is_virtual_pure(self.function_id, f_type)) return bool(eolian_function_is_virtual_pure(self.function_id, f_type))
@ -505,7 +518,9 @@ cdef class Function(object):
"""Returns a specific description for a function. """Returns a specific description for a function.
:param key: key to access the description :param key: key to access the description
:type key: string
:return: the description. :return: the description.
:rtype: string
""" """
if isinstance(key, unicode): key = PyUnicode_AsUTF8String(key) if isinstance(key, unicode): key = PyUnicode_AsUTF8String(key)
@ -515,7 +530,9 @@ cdef class Function(object):
"""Returns a parameter of a function pointed by its id. """Returns a parameter of a function pointed by its id.
:param param_name: Name of the parameter :param param_name: Name of the parameter
:type param_name: string
:return: a handle to this parameter. :return: a handle to this parameter.
:rtype: :class:`FunctionParameter`
""" """
if isinstance(param_name, unicode): if isinstance(param_name, unicode):
@ -529,7 +546,7 @@ cdef class Function(object):
property property_keys_list: property property_keys_list:
"""Returns a list of keys params of a given function. """Returns a list of keys params of a given function.
:type: list of :py:class:`FunctionParameter` :type: list of :class:`FunctionParameter`
""" """
def __get__(self): def __get__(self):
@ -540,7 +557,7 @@ cdef class Function(object):
property property_values_list: property property_values_list:
"""Returns a list of values params of a given function. """Returns a list of values params of a given function.
:type: list of :py:class:`FunctionParameter` :type: list of :class:`FunctionParameter`
""" """
def __get__(self): def __get__(self):
@ -552,7 +569,7 @@ cdef class Function(object):
property parameters_list: property parameters_list:
"""Returns a list of parameter handles for a method/ctor/dtor. """Returns a list of parameter handles for a method/ctor/dtor.
:type: list of :py:class:`FunctionParameter` :type: list of :class:`FunctionParameter`
""" """
def __get__(self): def __get__(self):
@ -564,7 +581,9 @@ cdef class Function(object):
"""Get the return type of a function. """Get the return type of a function.
:param ftype: type of the function :param ftype: type of the function
:type ftype: :class:`FunctionType`
:return: the return type of the function :return: the return type of the function
:rtype: string
The type of the function is needed because a given function can The type of the function is needed because a given function can
represent a property, that can be set and get functions. represent a property, that can be set and get functions.
@ -578,7 +597,9 @@ cdef class Function(object):
"""Get a list of all the types of a function return """Get a list of all the types of a function return
:param ftype: Function Type :param ftype: Function Type
:type ftype: :class:`FunctionType`
:return: the types of the function return :return: the types of the function return
:rtype: :class:`Type`
""" """
return eolian_type_to_python_obj( return eolian_type_to_python_obj(
@ -591,7 +612,9 @@ cdef class Function(object):
"""Get the return default value of a function. """Get the return default value of a function.
:param ftype: type of the function :param ftype: type of the function
:type ftype: :class:`FunctionType`
:return: the return default value of the function :return: the return default value of the function
:rtype: string
The return default value is needed to return an appropriate The return default value is needed to return an appropriate
value if an error occurs (eo_do failure...). value if an error occurs (eo_do failure...).
@ -606,7 +629,9 @@ cdef class Function(object):
"""Get the return comment of a function. """Get the return comment of a function.
:param ftype: type of the function :param ftype: type of the function
:type ftype: :class:`FunctionType`
:return: the return comment of the function :return: the return comment of the function
:rtype: string
The type of the function is needed because a given function can The type of the function is needed because a given function can
represent a property, that can be set and get functions. represent a property, that can be set and get functions.
@ -620,7 +645,9 @@ cdef class Function(object):
"""Indicates if a function return is warn-unused. """Indicates if a function return is warn-unused.
:param ftype: type of the function :param ftype: type of the function
:type ftype: :class:`FunctionType`
:return: True is warn-unused, False otherwise. :return: True is warn-unused, False otherwise.
:rtype: bool
The type of the function is needed because a given function can The type of the function is needed because a given function can
represent a property, that can be set and get functions. represent a property, that can be set and get functions.
@ -633,7 +660,7 @@ cdef class Function(object):
property object_is_const: property object_is_const:
"""Indicates if a function object is const. """Indicates if a function object is const.
:return: True if the object is const, False otherwise :type: bool
""" """
def __get__(self): def __get__(self):
@ -881,7 +908,9 @@ def type_find_by_alias(alias):
"""Find the type for a certain alias """Find the type for a certain alias
:param alias: alias of the type definition :param alias: alias of the type definition
:type alias: string
:return: real type of the type definition :return: real type of the type definition
:rtype: :class:`Type`
""" """
if isinstance(alias, unicode): alias = PyUnicode_AsUTF8String(alias) if isinstance(alias, unicode): alias = PyUnicode_AsUTF8String(alias)