code: def resolve_path(self, filename, skip='', skip_original='',
                       default_template=None):
          
          def _file(filename, dirs):
              for d in dirs:
                  _f = os.path.normpath(os.path.join(d, filename))
                  if os.path.exists(_f):
                      yield _f
              raise StopIteration
  
          filename = os.path.normpath(filename)
          skip = os.path.normpath(skip)
          skip_original = os.path.normpath(skip_original)
  
          if os.path.exists(filename):
              return filename
  
          if filename and self.dirs:
              _files = _file(filename, self.dirs)
              if skip_original == filename:
                  for f in _files:
                      if f == skip:
                          break
  
              for f in _files:
                  if f != skip:
                      return f
                  else:
                      continue
  
          if default_template:
              if not isinstance(default_template, (tuple, list)):
                  default_template = [default_template]
              for x in default_template:
                  filename = self.resolve_path(x)
                  if filename:
                      return filename
docs: Fetch the template filename according dirs
          :para skip: if the searched filename equals skip, then using the one before.