# Path: gtool/core/types/core.py
# class AttrSelector(Selector):
# 
#     def __init__(self):
#         self.__method__ = searchByAttrib
# 
# class FullPathSelector(Selector):
# 
#     def __init__(self):
#         self.__method__ = getObjectByUri
# 
# class AttrByObjectSelector(Selector):
# 
#     def __init__(self):
#         self.__method__ = searchByAttribAndObjectType


import pyparsing as p
from gtool.core.types.core import AttrSelector, FullPathSelector, AttrByObjectSelector
    _retlist = []

    for m in match:
        _retdict = {}
        _retdict['id'] = m[0]
        for k, v in m.items():
            _retdict[k] = v
        _retlist.append(_retdict)

    return _retlist

def parseSelector(selectorstring):
    # *select = @attr1 | /tf1/@attr | @attr1//objtype

    """
    def enumtype(*args,**kwargs): #s, l, t, selectortype=None):
        print(args)
        selectortype = kwargs['selectortype']
        if selectortype is None or not isinstance(selectortype, str):
            raise ValueError('enumtype requires a selectortype string but got a', type(selectortype))
        return selectortype
    """

    def attrtype():
        return AttrSelector() # 'ATTRTYPE'

    def fullpathtype():
        return FullPathSelector() #'FULLPATH'

    def attrbyobjtype():

# Path: gtool/core/types/core.py
# class AttrSelector(Selector):
# 
#     def __init__(self):
#         self.__method__ = searchByAttrib
# 
# class FullPathSelector(Selector):
# 
#     def __init__(self):
#         self.__method__ = getObjectByUri
# 
# class AttrByObjectSelector(Selector):
# 
#     def __init__(self):
#         self.__method__ = searchByAttribAndObjectType


# Path: gtool/core/utils/aggregatorprocessor.py
import pyparsing as p
from gtool.core.types.core import AttrSelector, FullPathSelector, AttrByObjectSelector

    _retlist = []

    for m in match:
        _retdict = {}
        _retdict['id'] = m[0]
        for k, v in m.items():
            _retdict[k] = v
        _retlist.append(_retdict)

    return _retlist

def parseSelector(selectorstring):
    # *select = @attr1 | /tf1/@attr | @attr1//objtype

    """
    def enumtype(*args,**kwargs): #s, l, t, selectortype=None):
        print(args)
        selectortype = kwargs['selectortype']
        if selectortype is None or not isinstance(selectortype, str):
            raise ValueError('enumtype requires a selectortype string but got a', type(selectortype))
        return selectortype
    """

    def attrtype():
        return AttrSelector() # 'ATTRTYPE'

    def fullpathtype():
        return FullPathSelector() #'FULLPATH'

    def attrbyobjtype():

        return AttrByObjectSelector() #'ATTRBYOBJECT'