parameters: (module, mod_path=None)
return_statement: return {}
docstring: :param module: The name of the module (sale, purchase, ...)
      :param mod_path: Physical path of module, if not providedThe name of the module (sale, purchase, ...)
docstring_summary: :param module: The name of the module (sale, purchase, ...)
      :param mod_path: Physical path of module, if not providedThe name of the module (sale, purchase, ...)
docstring_tokens: : param module : The name of the module ( sale purchase ... ) : param mod_path : Physical path of module if not providedThe name of the module ( sale purchase ... )
function: def load_information_from_description_file(module, mod_path=None):
      """
      :param module: The name of the module (sale, purchase, ...)
      :param mod_path: Physical path of module, if not providedThe name of the module (sale, purchase, ...)
      """
      if not mod_path:
          mod_path = get_module_path(module, downloaded=True)
      manifest_file = module_manifest(mod_path)
      if manifest_file:
          # default values for descriptor
          info = {
              'application': False,
              'author': 'Odoo S.A.',
              'auto_install': False,
              'category': 'Uncategorized',
              'depends': [],
              'description': '',
              'icon': get_module_icon(module),
              'installable': True,
              'post_load': None,
              'version': '1.0',
              'web': False,
              'sequence': 100,
              'summary': '',
              'website': '',
          }
          info.update(zip(
              'depends data demo test init_xml update_xml demo_xml'.split(),
              iter(list, None)))
  
          f = tools.file_open(manifest_file, mode='rb')
          try:
              info.update(ast.literal_eval(pycompat.to_text(f.read())))
          finally:
              f.close()
  
          if not info.get('description'):
              readme_path = [opj(mod_path, x) for x in README
                             if os.path.isfile(opj(mod_path, x))]
              if readme_path:
                  with tools.file_open(readme_path[0]) as fd:
                      info['description'] = fd.read()
  
          if not info.get('license'):
              info['license'] = 'LGPL-3'
              _logger.warning("Missing `license` key in manifest for '%s', defaulting to LGPL-3", module)
  
          # auto_install is either `False` (by default) in which case the module
          # is opt-in, either a list of dependencies in which case the module is
          # automatically installed if all dependencies are (special case: [] to
          # always install the module), either `True` to auto-install the module
          # in case all dependencies declared in `depends` are installed.
          if isinstance(info['auto_install'], collections.abc.Iterable):
              info['auto_install'] = set(info['auto_install'])
              non_dependencies = info['auto_install'].difference(info['depends'])
              assert not non_dependencies,\
                  "auto_install triggers must be dependencies, found " \
                  "non-dependencies [%s] for module %s" % (
                      ', '.join(non_dependencies), module
                  )
          elif info['auto_install']:
              info['auto_install'] = set(info['depends'])
  
          info['version'] = adapt_version(info['version'])
          return info
  
      _logger.debug('module %s: no manifest file found %s', module, MANIFEST_NAMES)
      return {}
function_tokens: def load_information_from_description_file ( module , mod_path = None ) : if not mod_path : mod_path = get_module_path ( module , downloaded = True ) manifest_file = module_manifest ( mod_path ) if manifest_file : # default values for descriptor info = { 'application' : False , 'author' : 'Odoo S.A.' , 'auto_install' : False , 'category' : 'Uncategorized' , 'depends' : [ ] , 'description' : '' , 'icon' : get_module_icon ( module ) , 'installable' : True , 'post_load' : None , 'version' : '1.0' , 'web' : False , 'sequence' : 100 , 'summary' : '' , 'website' : '' , } info . update ( zip ( 'depends data demo test init_xml update_xml demo_xml' . split ( ) , iter ( list , None ) ) ) f = tools . file_open ( manifest_file , mode = 'rb' ) try : info . update ( ast . literal_eval ( pycompat . to_text ( f . read ( ) ) ) ) finally : f . close ( ) if not info . get ( 'description' ) : readme_path = [ opj ( mod_path , x ) for x in README if os . path . isfile ( opj ( mod_path , x ) ) ] if readme_path : with tools . file_open ( readme_path [ 0 ] ) as fd : info [ 'description' ] = fd . read ( ) if not info . get ( 'license' ) : info [ 'license' ] = 'LGPL-3' _logger . warning ( "Missing `license` key in manifest for '%s', defaulting to LGPL-3" , module ) # auto_install is either `False` (by default) in which case the module # is opt-in, either a list of dependencies in which case the module is # automatically installed if all dependencies are (special case: [] to # always install the module), either `True` to auto-install the module # in case all dependencies declared in `depends` are installed. if isinstance ( info [ 'auto_install' ] , collections . abc . Iterable ) : info [ 'auto_install' ] = set ( info [ 'auto_install' ] ) non_dependencies = info [ 'auto_install' ] . difference ( info [ 'depends' ] ) assert not non_dependencies , "auto_install triggers must be dependencies, found " "non-dependencies [%s] for module %s" % ( ', ' . join ( non_dependencies ) , module ) elif info [ 'auto_install' ] : info [ 'auto_install' ] = set ( info [ 'depends' ] ) info [ 'version' ] = adapt_version ( info [ 'version' ] ) return info _logger . debug ( 'module %s: no manifest file found %s' , module , MANIFEST_NAMES ) return { }