(self, path, product_dir=None)
return path
Expand specials like $!PRODUCT_DIR in |path|.

    If |product_dir| is None, assumes the cwd is already the product
    dir.  Otherwise, |product_dir| is the relative path to the product
    dir.
Expand specials like $!PRODUCT_DIR in |path|.
Expand specials like $!PRODUCT_DIR in |path| .
def ExpandSpecial(self, path, product_dir=None):
    """Expand specials like $!PRODUCT_DIR in |path|.

    If |product_dir| is None, assumes the cwd is already the product
    dir.  Otherwise, |product_dir| is the relative path to the product
    dir.
    """

    PRODUCT_DIR = '$!PRODUCT_DIR'
    if PRODUCT_DIR in path:
      if product_dir:
        path = path.replace(PRODUCT_DIR, product_dir)
      else:
        path = path.replace(PRODUCT_DIR + '/', '')
        path = path.replace(PRODUCT_DIR + '\\', '')
        path = path.replace(PRODUCT_DIR, '.')

    INTERMEDIATE_DIR = '$!INTERMEDIATE_DIR'
    if INTERMEDIATE_DIR in path:
      int_dir = self.GypPathToUniqueOutput('gen')
      # GypPathToUniqueOutput generates a path relative to the product dir,
      # so insert product_dir in front if it is provided.
      path = path.replace(INTERMEDIATE_DIR,
                          os.path.join(product_dir or '', int_dir))

    CONFIGURATION_NAME = '$|CONFIGURATION_NAME'
    path = path.replace(CONFIGURATION_NAME, self.config_name)

    return path
def ExpandSpecial ( self , path , product_dir = None ) : PRODUCT_DIR = '$!PRODUCT_DIR' if PRODUCT_DIR in path : if product_dir : path = path . replace ( PRODUCT_DIR , product_dir ) else : path = path . replace ( PRODUCT_DIR + '/' , '' ) path = path . replace ( PRODUCT_DIR + '\\' , '' ) path = path . replace ( PRODUCT_DIR , '.' ) INTERMEDIATE_DIR = '$!INTERMEDIATE_DIR' if INTERMEDIATE_DIR in path : int_dir = self . GypPathToUniqueOutput ( 'gen' ) # GypPathToUniqueOutput generates a path relative to the product dir, # so insert product_dir in front if it is provided. path = path . replace ( INTERMEDIATE_DIR , os . path . join ( product_dir or '' , int_dir ) ) CONFIGURATION_NAME = '$|CONFIGURATION_NAME' path = path . replace ( CONFIGURATION_NAME , self . config_name ) return path