parameters: (filename)
return_statement: return brewlib, abspath, rpath
docstring: input: a path to a brew library, as returned by otool, that can have this form :
              - an absolute path /usr/local/lib/yyy
      output:
          a tuple (brewlib, abspath, rpath) where:
              - brewlib is the name of the brew lib
              - abspath is the absolute path of the qt lib inside the app bundle of exepath
              - relpath is the correct rpath to a qt lib inside the app bundle
docstring_summary: input: a path to a brew library, as returned by otool, that can have this form :
              - an absolute path /usr/local/lib/yyy
      output:
          a tuple (brewlib, abspath, rpath) where:
              - brewlib is the name of the brew lib
              - abspath is the absolute path of the qt lib inside the app bundle of exepath
              - relpath is the correct rpath to a qt lib inside the app bundle
docstring_tokens: input : a path to a brew library as returned by otool that can have this form : - an absolute path / usr / local / lib / yyy output : a tuple ( brewlib abspath rpath ) where : - brewlib is the name of the brew lib - abspath is the absolute path of the qt lib inside the app bundle of exepath - relpath is the correct rpath to a qt lib inside the app bundle
function: def normalize_brew_name(filename):
      """
      input: a path to a brew library, as returned by otool, that can have this form :
              - an absolute path /usr/local/lib/yyy
      output:
          a tuple (brewlib, abspath, rpath) where:
              - brewlib is the name of the brew lib
              - abspath is the absolute path of the qt lib inside the app bundle of exepath
              - relpath is the correct rpath to a qt lib inside the app bundle
      """
      GlobalConfig.logger.debug('normalize_brew_name({0})'.format(filename))
  
      brewlib_name_rgx = re.compile(BREWLIB_REGEX)
      rgxret = brewlib_name_rgx.match(filename)
      if not rgxret:
          msg = 'couldn\'t normalize a brew lib filename: {0}'.format(filename)
          GlobalConfig.logger.critical(msg)
          raise Exception(msg)
  
      # brewlib normalization settings
      brewlib = rgxret.groups()[0]
      templ = Template(BREWLIB_NORMALIZED)
  
      # from brewlib, forge 2 path :
      #  - absolute path of qt lib in bundle,
      abspath = os.path.normpath(templ.safe_substitute(
          prefix=os.path.dirname(GlobalConfig.exepath) + '/..',
          brewlib=brewlib))
  
      #  - and rpath containing @executable_path, relative to exepath
      rpath = templ.safe_substitute(
          prefix='@executable_path/..',
          brewlib=brewlib)
  
      GlobalConfig.logger.debug('\treturns({0})'.format((brewlib, abspath, rpath)))
      return brewlib, abspath, rpath
function_tokens: def normalize_brew_name ( filename ) : GlobalConfig . logger . debug ( 'normalize_brew_name({0})' . format ( filename ) ) brewlib_name_rgx = re . compile ( BREWLIB_REGEX ) rgxret = brewlib_name_rgx . match ( filename ) if not rgxret : msg = 'couldn\'t normalize a brew lib filename: {0}' . format ( filename ) GlobalConfig . logger . critical ( msg ) raise Exception ( msg ) # brewlib normalization settings brewlib = rgxret . groups ( ) [ 0 ] templ = Template ( BREWLIB_NORMALIZED ) # from brewlib, forge 2 path : #  - absolute path of qt lib in bundle, abspath = os . path . normpath ( templ . safe_substitute ( prefix = os . path . dirname ( GlobalConfig . exepath ) + '/..' , brewlib = brewlib ) ) #  - and rpath containing @executable_path, relative to exepath rpath = templ . safe_substitute ( prefix = '@executable_path/..' , brewlib = brewlib ) GlobalConfig . logger . debug ( '\treturns({0})' . format ( ( brewlib , abspath , rpath ) ) ) return brewlib , abspath , rpath