parameters: (target, source, env, files=None, path=None)
return_statement: return 0
docstring: Parses `POTFILES.in`-like file and returns list of extracted file names.
docstring_summary: Parses `POTFILES.in`-like file and returns list of extracted file names.
docstring_tokens: Parses POTFILES . in - like file and returns list of extracted file names .
function: def _scan_xgettext_from_files(target, source, env, files=None, path=None):
      """ Parses `POTFILES.in`-like file and returns list of extracted file names.
      """
      if files is None:
          return 0
      if not SCons.Util.is_List(files):
          files = [files]
  
      if path is None:
          if 'XGETTEXTPATH' in env:
              path = env['XGETTEXTPATH']
          else:
              path = []
      if not SCons.Util.is_List(path):
          path = [path]
  
      path = SCons.Util.flatten(path)
  
      dirs = ()
      for p in path:
          if not isinstance(p, SCons.Node.FS.Base):
              if SCons.Util.is_String(p):
                  p = env.subst(p, source=source, target=target)
              p = env.arg2nodes(p, env.fs.Dir)
          dirs += tuple(p)
      # cwd is the default search path (when no path is defined by user)
      if not dirs:
          dirs = (env.fs.getcwd(),)
  
      # Parse 'POTFILE.in' files.
      re_comment = re.compile(r'^#[^\n\r]*$\r?\n?', re.M)
      re_emptyln = re.compile(r'^[ \t\r]*$\r?\n?', re.M)
      re_trailws = re.compile(r'[ \t\r]+$')
      for f in files:
          # Find files in search path $XGETTEXTPATH
          if isinstance(f, SCons.Node.FS.Base) and f.rexists():
              contents = f.get_text_contents()
              contents = re_comment.sub("", contents)
              contents = re_emptyln.sub("", contents)
              contents = re_trailws.sub("", contents)
              depnames = contents.splitlines()
              for depname in depnames:
                  depfile = SCons.Node.FS.find_file(depname, dirs)
                  if not depfile:
                      depfile = env.arg2nodes(depname, dirs[0].File)
                  env.Depends(target, depfile)
      return 0
function_tokens: def _scan_xgettext_from_files ( target , source , env , files = None , path = None ) : if files is None : return 0 if not SCons . Util . is_List ( files ) : files = [ files ] if path is None : if 'XGETTEXTPATH' in env : path = env [ 'XGETTEXTPATH' ] else : path = [ ] if not SCons . Util . is_List ( path ) : path = [ path ] path = SCons . Util . flatten ( path ) dirs = ( ) for p in path : if not isinstance ( p , SCons . Node . FS . Base ) : if SCons . Util . is_String ( p ) : p = env . subst ( p , source = source , target = target ) p = env . arg2nodes ( p , env . fs . Dir ) dirs += tuple ( p ) # cwd is the default search path (when no path is defined by user) if not dirs : dirs = ( env . fs . getcwd ( ) , ) # Parse 'POTFILE.in' files. re_comment = re . compile ( r'^#[^\n\r]*$\r?\n?' , re . M ) re_emptyln = re . compile ( r'^[ \t\r]*$\r?\n?' , re . M ) re_trailws = re . compile ( r'[ \t\r]+$' ) for f in files : # Find files in search path $XGETTEXTPATH if isinstance ( f , SCons . Node . FS . Base ) and f . rexists ( ) : contents = f . get_text_contents ( ) contents = re_comment . sub ( "" , contents ) contents = re_emptyln . sub ( "" , contents ) contents = re_trailws . sub ( "" , contents ) depnames = contents . splitlines ( ) for depname in depnames : depfile = SCons . Node . FS . find_file ( depname , dirs ) if not depfile : depfile = env . arg2nodes ( depname , dirs [ 0 ] . File ) env . Depends ( target , depfile ) return 0