# Path: mcm/librouteros/exceptions.py
# class CmdError( LibError ):
#     '''
#     Commend execution errors.
#     '''
# 
# class ConnError( LibError ):
#     '''
#     Connection related errors.
#     '''


from mcm.librouteros.exceptions import CmdError, ConnError
    :param word: Attribute word.
    '''

    splitted = word.split( '=', 2 )
    key = splitted[1]
    value = splitted[2]
    casted_value = castValToPy( value )

    return ( key, casted_value )



def trapCheck( snts ):
    '''
    Check for existance of !trap word. This word indicates that an error occured.
    At least one !trap word in any sentence triggers an error.
    Unfortunatelly mikrotik api may throw one or more errors as response.

    :param snts: Iterable with each sentence as tuple
    '''

    errmsgs = []

    for snt in snts:
        if '!trap' in snt:
            emsg = ' '.join( word for word in snt )
            errmsgs.append( emsg )

    if errmsgs:
        e = ', '.join( errmsgs )

# Path: mcm/librouteros/exceptions.py
# class CmdError( LibError ):
#     '''
#     Commend execution errors.
#     '''
# 
# class ConnError( LibError ):
#     '''
#     Connection related errors.
#     '''


# Path: mcm/librouteros/datastructures.py
from mcm.librouteros.exceptions import CmdError, ConnError

    :param word: Attribute word.
    '''

    splitted = word.split( '=', 2 )
    key = splitted[1]
    value = splitted[2]
    casted_value = castValToPy( value )

    return ( key, casted_value )



def trapCheck( snts ):
    '''
    Check for existance of !trap word. This word indicates that an error occured.
    At least one !trap word in any sentence triggers an error.
    Unfortunatelly mikrotik api may throw one or more errors as response.

    :param snts: Iterable with each sentence as tuple
    '''

    errmsgs = []

    for snt in snts:
        if '!trap' in snt:
            emsg = ' '.join( word for word in snt )
            errmsgs.append( emsg )

    if errmsgs:
        e = ', '.join( errmsgs )

        raise CmdError( e )