parameters: (self, gyp_to_build_path)
return_statement: return None
docstring: Returns the .def file from sources, if any.  Otherwise returns None.
docstring_summary: Returns the .def file from sources, if any.  Otherwise returns None.
docstring_tokens: Returns the . def file from sources if any . Otherwise returns None .
function: def GetDefFile(self, gyp_to_build_path):
      """Returns the .def file from sources, if any.  Otherwise returns None."""
      spec = self.spec
      if spec['type'] in ('shared_library', 'loadable_module', 'executable'):
        def_files = [s for s in spec.get('sources', []) if s.endswith('.def')]
        if len(def_files) == 1:
          return gyp_to_build_path(def_files[0])
        elif len(def_files) > 1:
          raise Exception("Multiple .def files")
      return None
function_tokens: def GetDefFile ( self , gyp_to_build_path ) : spec = self . spec if spec [ 'type' ] in ( 'shared_library' , 'loadable_module' , 'executable' ) : def_files = [ s for s in spec . get ( 'sources' , [ ] ) if s . endswith ( '.def' ) ] if len ( def_files ) == 1 : return gyp_to_build_path ( def_files [ 0 ] ) elif len ( def_files ) > 1 : raise Exception ( "Multiple .def files" ) return None