native_client_sdk/src/tools/create_nmf.py
def _SetArchFileUrls(self):
    """Fill in the url member of all ArchFiles in self.needed.

    All urls are relative to the nmf_root. In addition, architecture-specific
    files are relative to the .nexe with the matching architecture. This is
    useful when making a multi-platform packaged app, so each architecture's
    files are in a different directory.
    """
    # self.GetNeeded() should have already been called.
    assert self.needed is not None

    main_nexes = [f for f in self.main_files if f.endswith('.nexe')]

    # map from each arch to its corresponding main nexe.
    arch_to_main_dir = {}
    for main_file in main_nexes:
      arch, _ = ParseElfHeader(main_file)
      main_dir = os.path.dirname(main_file)
      main_dir = PosixRelPath(main_dir, self.nmf_root)
      if main_dir == '.':
        main_dir = ''
      arch_to_main_dir[arch] = main_dir

    for arch_file in self.needed.values():
      prefix = ''
      if DirectoryTreeContainsFile(self.nmf_root, arch_file.path):
        # This file is already in the nmf_root tree, so it does not need to be
        # staged. Just make the URL relative to the .nmf.
        url = PosixRelPath(arch_file.path, self.nmf_root)
      else:
        # This file is outside of the nmf_root subtree, so it needs to be
        # staged. Its path should be relative to the main .nexe with the same
        # architecture.
        prefix = arch_to_main_dir[arch_file.arch]
        url = os.path.basename(arch_file.path)

      if arch_file.name.endswith('.nexe') and not IsLoader(arch_file.name):
        prefix = posixpath.join(prefix, self.nexe_prefix)
      elif self.no_arch_prefix:
        prefix = posixpath.join(prefix, self.lib_prefix)
      else:
        prefix = posixpath.join(
            prefix, self.lib_prefix, ARCH_LOCATION[arch_file.arch])
      arch_file.url = posixpath.join(prefix, url)
Fill in the url member of all ArchFiles in self.needed.

    All urls are relative to the nmf_root. In addition, architecture-specific
    files are relative to the .nexe with the matching architecture. This is
    useful when making a multi-platform packaged app, so each architecture's
    files are in a different directory.
    
Fill in the url member of all ArchFiles in self.needed.
All urls are relative to the nmf_root. In addition, architecture-specific
files are relative to the .nexe with the matching architecture. This is
useful when making a multi-platform packaged app, so each architecture's
files are in a different directory.
Fill in the url member of all ArchFiles in self . needed . All urls are relative to the nmf_root . In addition architecture - specific files are relative to the . nexe with the matching architecture . This is useful when making a multi - platform packaged app so each architecture ' s files are in a different directory .
def _SetArchFileUrls(self):
    assert self.needed is not None
    main_nexes = [f for f in self.main_files if f.endswith('.nexe')]
    arch_to_main_dir = {}
    for main_file in main_nexes:
      arch, _ = ParseElfHeader(main_file)
      main_dir = os.path.dirname(main_file)
      main_dir = PosixRelPath(main_dir, self.nmf_root)
      if main_dir == '.':
        main_dir = ''
      arch_to_main_dir[arch] = main_dir
    for arch_file in self.needed.values():
      prefix = ''
      if DirectoryTreeContainsFile(self.nmf_root, arch_file.path):
        url = PosixRelPath(arch_file.path, self.nmf_root)
      else:
        prefix = arch_to_main_dir[arch_file.arch]
        url = os.path.basename(arch_file.path)
      if arch_file.name.endswith('.nexe') and not IsLoader(arch_file.name):
        prefix = posixpath.join(prefix, self.nexe_prefix)
      elif self.no_arch_prefix:
        prefix = posixpath.join(prefix, self.lib_prefix)
      else:
        prefix = posixpath.join(
            prefix, self.lib_prefix, ARCH_LOCATION[arch_file.arch])
      arch_file.url = posixpath.join(prefix, url)
def _SetArchFileUrls ( self ) : assert self . needed is not None main_nexes = [ f for f in self . main_files if f . endswith ( '.nexe' ) ] arch_to_main_dir = { } for main_file in main_nexes : arch , _ = ParseElfHeader ( main_file ) main_dir = os . path . dirname ( main_file ) main_dir = PosixRelPath ( main_dir , self . nmf_root ) if main_dir == '.' : main_dir = '' arch_to_main_dir [ arch ] = main_dir for arch_file in self . needed . values ( ) : prefix = '' if DirectoryTreeContainsFile ( self . nmf_root , arch_file . path ) : url = PosixRelPath ( arch_file . path , self . nmf_root ) else : prefix = arch_to_main_dir [ arch_file . arch ] url = os . path . basename ( arch_file . path ) if arch_file . name . endswith ( '.nexe' ) and not IsLoader ( arch_file . name ) : prefix = posixpath . join ( prefix , self . nexe_prefix ) elif self . no_arch_prefix : prefix = posixpath . join ( prefix , self . lib_prefix ) else : prefix = posixpath . join ( prefix , self . lib_prefix , ARCH_LOCATION [ arch_file . arch ] ) arch_file . url = posixpath . join ( prefix , url )
Fill in the url member of all ArchFiles in self.needed.
Fill in the url member of all ArchFiles in self . needed .
"""Fill in the url member of all ArchFiles in self.needed.

    All urls are relative to the nmf_root. In addition, architecture-specific
    files are relative to the .nexe with the matching architecture. This is
    useful when making a multi-platform packaged app, so each architecture's
    files are in a different directory.
    """ # self.GetNeeded() should have already been called. # map from each arch to its corresponding main nexe. # This file is already in the nmf_root tree, so it does not need to be # staged. Just make the URL relative to the .nmf. # This file is outside of the nmf_root subtree, so it needs to be # staged. Its path should be relative to the main .nexe with the same # architecture.
self