# Path: dockit/schema/exceptions.py
# class DotPathNotFound(Exception):
#     def __init__(self, message, traverser=None):
#         Exception.__init__(self, message)
#         self.traverser = traverser


from dockit.schema.exceptions import DotPathNotFound
        from dockit.schema.fields import SchemaField
        from dockit.schema.fields import SchemaField
        from dockit.schema.fields import DictField, SchemaField
            from dockit.schema.fields import SchemaField
            from dockit.schema.schema import Schema
        self._resolve_loop()
    
    def resolve_for_raw_data(self, data, schema=None):
        field = None
        if schema:
            field = SchemaField(schema=schema)
            data = schema.to_python(data)
        else:
            field = DictField()
        entry = {'value':data,
                 'field':field,
                 'part':None,}
        self.resolved_paths = [entry]
        self._resolve_loop()
    
    def _resolve_loop(self):
        while not self._finished:
            self._called = False
            self.resolve_next()
            if not self._called:
                assert False, str(self.resolved_paths)
            #need a better control routine, want one last resolve if end wasn't called
    
    def resolve_next(self):
        current = self.current
        if current['field'] is None:
            if hasattr(current['value'], 'traverse_dot_path'):
                current['value'].traverse_dot_path(self)
                #note the result may or may not have a field
            elif self.remaining_paths:

# Path: dockit/schema/exceptions.py
# class DotPathNotFound(Exception):
#     def __init__(self, message, traverser=None):
#         Exception.__init__(self, message)
#         self.traverser = traverser


# Path: dockit/schema/common.py
from dockit.schema.exceptions import DotPathNotFound
        from dockit.schema.fields import SchemaField
        from dockit.schema.fields import SchemaField
        from dockit.schema.fields import DictField, SchemaField
            from dockit.schema.fields import SchemaField
            from dockit.schema.schema import Schema

        self._resolve_loop()
    
    def resolve_for_raw_data(self, data, schema=None):
        field = None
        if schema:
            field = SchemaField(schema=schema)
            data = schema.to_python(data)
        else:
            field = DictField()
        entry = {'value':data,
                 'field':field,
                 'part':None,}
        self.resolved_paths = [entry]
        self._resolve_loop()
    
    def _resolve_loop(self):
        while not self._finished:
            self._called = False
            self.resolve_next()
            if not self._called:
                assert False, str(self.resolved_paths)
            #need a better control routine, want one last resolve if end wasn't called
    
    def resolve_next(self):
        current = self.current
        if current['field'] is None:
            if hasattr(current['value'], 'traverse_dot_path'):
                current['value'].traverse_dot_path(self)
                #note the result may or may not have a field
            elif self.remaining_paths:

                raise DotPathNotFound('Arrived at a dead end', traverser=self)