parameters: (self,get)
return_statement: return public.return_data(True,'Module unloaded successfully!')
docstring: @name 卸载指定模块
              @author hwliang<2021-04-08>
              @param get<dict_obj>{
                  project_name: string<项目名称>
                  mod_name: string<模块名称>
              }
              @return dict
function: def uninstall_module(self,get):
          '''
              @name 卸载指定模块
              @author hwliang<2021-04-08>
              @param get<dict_obj>{
                  project_name: string<项目名称>
                  mod_name: string<模块名称>
              }
              @return dict
          '''
          project_find = self.get_project_find(get.project_name)
          if not project_find: return public.return_error('The specified item does not exist!')
          project_cwd = project_find['path']
  
          mod_name = get.mod_name
          filename = '{}/node_modules/{}/package.json'.format(project_cwd,mod_name)
          if not os.path.exists(filename): return public.return_error('The specified module is not installed!')
  
          nodejs_version = project_find['project_config']['nodejs_version']
          npm_bin = self.get_npm_bin(nodejs_version)
          yarn_bin = self.get_yarn_bin(nodejs_version)
          if not npm_bin and not yarn_bin: 
              return public.return_error('The specified nodejs version does not exist!')
          if yarn_bin:
              result = public.ExecShell(self.get_last_env(nodejs_version) + "cd {} && {} remove {}".format(project_find['path'],yarn_bin,mod_name))
          else:
              result = public.ExecShell(self.get_last_env(nodejs_version) + "cd {} && {} uninstall {}".format(project_find['path'],npm_bin,mod_name))
          if os.path.exists(filename): 
              result = "\n".join(result)
              if result.find('looking for funding') != -1:
                  return public.return_error("This module is dependent on other installed modules and cannot be uninstalled!")
              return public.return_error("Unable to uninstall this module!")
  
          public.WriteLog(self._log_name,'Node project {}, {} module uninstallation completed!'.format(get.project_name,mod_name))
          return public.return_data(True,'Module unloaded successfully!')
function_tokens: def uninstall_module ( self , get ) : project_find = self . get_project_find ( get . project_name ) if not project_find : return public . return_error ( 'The specified item does not exist!' ) project_cwd = project_find [ 'path' ] mod_name = get . mod_name filename = '{}/node_modules/{}/package.json' . format ( project_cwd , mod_name ) if not os . path . exists ( filename ) : return public . return_error ( 'The specified module is not installed!' ) nodejs_version = project_find [ 'project_config' ] [ 'nodejs_version' ] npm_bin = self . get_npm_bin ( nodejs_version ) yarn_bin = self . get_yarn_bin ( nodejs_version ) if not npm_bin and not yarn_bin : return public . return_error ( 'The specified nodejs version does not exist!' ) if yarn_bin : result = public . ExecShell ( self . get_last_env ( nodejs_version ) + "cd {} && {} remove {}" . format ( project_find [ 'path' ] , yarn_bin , mod_name ) ) else : result = public . ExecShell ( self . get_last_env ( nodejs_version ) + "cd {} && {} uninstall {}" . format ( project_find [ 'path' ] , npm_bin , mod_name ) ) if os . path . exists ( filename ) : result = "\n" . join ( result ) if result . find ( 'looking for funding' ) != - 1 : return public . return_error ( "This module is dependent on other installed modules and cannot be uninstalled!" ) return public . return_error ( "Unable to uninstall this module!" ) public . WriteLog ( self . _log_name , 'Node project {}, {} module uninstallation completed!' . format ( get . project_name , mod_name ) ) return public . return_data ( True , 'Module unloaded successfully!' )