def ProduceURLs(self, consumer):
    if not self._path:
      return

    root_path = self._path
    root_URL  = self._url
    root_file = self._default_file
    remove_empty_directories = self._remove_empty_directories

    def HasReadPermissions(path):
      """ Verifies a given path has read permissions. """  
      stat_info = os.stat(path)
      mode = stat_info[stat.ST_MODE]
      if mode & stat.S_IREAD:
        return True
      else:
        return None

    def PerFile(dirpath, name):
      """
      Called once per file.
      Note that 'name' will occasionally be None -- for a directory itself
      """
      # Pull a timestamp
      url           = URL()
      isdir         = False
      try:
        if name:
          path      = os.path.join(dirpath, name)
        else:
          path      = dirpath
        isdir       = os.path.isdir(path)
        time        = None
        if isdir and root_file:
          file      = os.path.join(path, root_file)
          try:
            time    = os.stat(file)[stat.ST_MTIME];
          except OSError:
            pass
        if not time:
          time      = os.stat(path)[stat.ST_MTIME];
        url.lastmod = TimestampISO8601(time)
      except OSError:
        pass
      except ValueError:
        pass

      # Build a URL
      middle        = dirpath[len(root_path):]
      if os.sep != '/':
        middle = middle.replace(os.sep, '/')
      if middle:
        middle      = middle + '/'
      if name:
        middle      = middle + name
        if isdir:
          middle    = middle + '/'
      url.TrySetAttribute('loc', root_URL + encoder.WidenText(middle, None))

      # Suppress default files.  (All the way down here so we can log it.)
      if name and (root_file == name):
        url.Log(prefix='IGNORED (default file)', level=2)
        return
  
      # Suppress directories when remove_empty_directories="true"
      try:
        if isdir:
	  if HasReadPermissions(path):
            if remove_empty_directories == 'true' and \
	       len(os.listdir(path)) == 0:
              output.Log('IGNORED empty directory %s' % str(path), level=1)
              return
          elif path == self._path:
            output.Error('IGNORED configuration file directory input %s due '
			 'to file permissions' % self._path)
          else:
            output.Log('IGNORED files within directory %s due to file '
		       'permissions' % str(path), level=0)
      except OSError:
        pass
      except ValueError:
        pass
 
      consumer(url, False)
    #end def PerFile

    def PerDirectory(ignore, dirpath, namelist):
      """
      Called once per directory with a list of all the contained files/dirs.
      """
      ignore = ignore  # Avoid warnings of an unused parameter

      if not dirpath.startswith(root_path):
        output.Warn('Unable to decide what the root path is for directory: '
                    '%s' % dirpath)
        return

      for name in namelist:
        PerFile(dirpath, name)
    #end def PerDirectory

    output.Log('Walking DIRECTORY "%s"' % self._path, 1)
    PerFile(self._path, None)
    os.path.walk(self._path, PerDirectory, None)
  #end def ProduceURLs
#end class InputDirectory
Return the location record from the database
dataset/ETHPy150Open benoitc/restkit/doc/sitemap_gen.py/InputDirectory.ProduceURLs--crossover with--dataset/ETHPy150Open sahana/eden/modules/s3db/survey.py/S3QuestionTypeLocationWidget.getLocationRecord