# Path: g_sorcery/exceptions.py
# class EclassError(GSorceryError):
#     pass
# 
# Path: g_sorcery/fileutils.py
# def get_pkgpath(root = None):
#     """
#     Get package path.
# 
#     Args:
#         root: module file path
# 
#     Returns:
#         Package path.
#     """
#     if not root:
#         root = __file__
#     if os.path.islink(root):
#         root = os.path.realpath(root)
#     return os.path.dirname(os.path.abspath(root))


import glob
import os
from .exceptions import EclassError
from .fileutils import get_pkgpath
    ~~~~~~~~~
    
    eclass generation
    
    :copyright: (c) 2013 by Jauhien Piatlicki
    :license: GPL-2, see LICENSE for more details.
"""



class EclassGenerator(object):
    """
    Generates eclasses from files in a given dir.
    """

    def __init__(self, eclass_dir):
        """
        __init__ in a subclass should take no parameters.
        """
        self.eclass_dir = eclass_dir

    def list(self):
        """
        List all eclasses.
        
        Returns:
            List of all eclasses with string entries.
        """
        result = []


# Path: g_sorcery/exceptions.py
# class EclassError(GSorceryError):
#     pass
# 
# Path: g_sorcery/fileutils.py
# def get_pkgpath(root = None):
#     """
#     Get package path.
# 
#     Args:
#         root: module file path
# 
#     Returns:
#         Package path.
#     """
#     if not root:
#         root = __file__
#     if os.path.islink(root):
#         root = os.path.realpath(root)
#     return os.path.dirname(os.path.abspath(root))


# Path: g_sorcery/eclass.py
import glob
import os
from .exceptions import EclassError
from .fileutils import get_pkgpath

    ~~~~~~~~~
    
    eclass generation
    
    :copyright: (c) 2013 by Jauhien Piatlicki
    :license: GPL-2, see LICENSE for more details.
"""



class EclassGenerator(object):
    """
    Generates eclasses from files in a given dir.
    """

    def __init__(self, eclass_dir):
        """
        __init__ in a subclass should take no parameters.
        """
        self.eclass_dir = eclass_dir

    def list(self):
        """
        List all eclasses.
        
        Returns:
            List of all eclasses with string entries.
        """
        result = []


        for directory in [self.eclass_dir, os.path.join(get_pkgpath(), 'data')]: