parameters: (self)
docstring: Install the plugins in the list.
          @postcondition: all plugins listed in the list are installed and loaded
docstring_summary: Install the plugins in the list.
          @postcondition: all plugins listed in the list are installed and loaded
docstring_tokens: Install the plugins in the list . @postcondition : all plugins listed in the list are installed and loaded
function: def _Install(self):
          """Install the plugins in the list.
          @postcondition: all plugins listed in the list are installed and loaded
  
          """
          items = self._install.GetItems()
          inst_loc = ed_glob.CONFIG['PLUGIN_DIR']
          if self._syscb.GetValue():
              inst_loc = ed_glob.CONFIG['SYS_PLUGIN_DIR']
  
          for item in items:
              egg_name = item.split(os.sep)[-1]
              if os.path.isabs(item):
                  try:
                      reader = file(item, "rb")
                      egg = reader.read()
                      reader.close()
                  except (IOError, SystemError, OSError):
                      continue
              else:
                  dl_pg = self.GetParent().GetPage(DOWNLOAD_PG)
                  egg = dl_pg.GetDownloadedData().get(item, None)
                  if not egg:
                      continue
  
              try:
                  writer = file(inst_loc + egg_name, "wb")
                  writer.write(egg)
                  writer.close()
              except (IOError, OSError):
                  continue
              else:
                  # If successfully installed remove from list
                  ind = self._install.FindString(item)
                  dl_pg = self.GetParent().GetPage(DOWNLOAD_PG)
                  if ind != wx.NOT_FOUND:
                      self._install.Delete(ind)
                      dl_pg.RemoveDownloadedItem(item)
  
          if not len(self._install.GetItems()):
              # All plugins installed correctly
              grand_p = self.GetTopLevelParent()
              grand_p.SetStatusText(_("Successfully Installed Plugins"), 0)
              # Note: need to do this because SetSelection doesn't fire a
              #       page change.
              wx.GetApp().GetPluginManager().ReInit()
              self.GetParent().SetSelection(CONFIG_PG)
              self._instb.Disable()
          else:
              self.GetGrandParent().SetStatusText(_("Error"), 1)
              dlg = wx.MessageDialog(self,
                                     _("Failed to install %d plugins") % \
                                     self._install.GetCount(),
                                     _("Installation Error"),
                                     style = wx.OK | wx.CENTER | wx.ICON_ERROR)
              dlg.ShowModal()
              dlg.Destroy()
function_tokens: def _Install ( self ) : items = self . _install . GetItems ( ) inst_loc = ed_glob . CONFIG [ 'PLUGIN_DIR' ] if self . _syscb . GetValue ( ) : inst_loc = ed_glob . CONFIG [ 'SYS_PLUGIN_DIR' ] for item in items : egg_name = item . split ( os . sep ) [ - 1 ] if os . path . isabs ( item ) : try : reader = file ( item , "rb" ) egg = reader . read ( ) reader . close ( ) except ( IOError , SystemError , OSError ) : continue else : dl_pg = self . GetParent ( ) . GetPage ( DOWNLOAD_PG ) egg = dl_pg . GetDownloadedData ( ) . get ( item , None ) if not egg : continue try : writer = file ( inst_loc + egg_name , "wb" ) writer . write ( egg ) writer . close ( ) except ( IOError , OSError ) : continue else : # If successfully installed remove from list ind = self . _install . FindString ( item ) dl_pg = self . GetParent ( ) . GetPage ( DOWNLOAD_PG ) if ind != wx . NOT_FOUND : self . _install . Delete ( ind ) dl_pg . RemoveDownloadedItem ( item ) if not len ( self . _install . GetItems ( ) ) : # All plugins installed correctly grand_p = self . GetTopLevelParent ( ) grand_p . SetStatusText ( _ ( "Successfully Installed Plugins" ) , 0 ) # Note: need to do this because SetSelection doesn't fire a #       page change. wx . GetApp ( ) . GetPluginManager ( ) . ReInit ( ) self . GetParent ( ) . SetSelection ( CONFIG_PG ) self . _instb . Disable ( ) else : self . GetGrandParent ( ) . SetStatusText ( _ ( "Error" ) , 1 ) dlg = wx . MessageDialog ( self , _ ( "Failed to install %d plugins" ) % self . _install . GetCount ( ) , _ ( "Installation Error" ) , style = wx . OK | wx . CENTER | wx . ICON_ERROR ) dlg . ShowModal ( ) dlg . Destroy ( )