parameters: (self)
docstring: installs or updates the selected addon
docstring_summary: installs or updates the selected addon
docstring_tokens: installs or updates the selected addon
function: def run(self):
          "installs or updates the selected addon"
  
          if not self.repo:
              return
  
          if not have_git or NOGIT:
              FreeCAD.Console.PrintLog(
                  translate(
                      "AddonsInstaller",
                      "GitPython not found. Using ZIP file download instead.",
                  )
                  + "\n"
              )
              if not have_zip:
                  FreeCAD.Console.PrintError(
                      translate(
                          "AddonsInstaller",
                          "Your version of Python doesn't appear to support ZIP files. Unable to proceed.",
                      )
                      + "\n"
                  )
                  return
  
          basedir = FreeCAD.getUserAppDataDir()
          moddir = basedir + os.sep + "Mod"
          if not os.path.exists(moddir):
              os.makedirs(moddir)
          target_dir = moddir + os.sep + self.repo.name
  
          if have_git and not NOGIT:
              # Do the git process...
              self.run_git(target_dir)
          else:
  
              # The zip process uses an event loop, since the download can potentially be quite large
              self.launch_zip(target_dir)
              self.zip_complete = False
              current_thread = QtCore.QThread.currentThread()
              while not self.zip_complete:
                  if current_thread.isInterruptionRequested():
                      return
                  QtCore.QCoreApplication.processEvents(QtCore.QEventLoop.AllEvents, 50)
function_tokens: def run ( self ) : if not self . repo : return if not have_git or NOGIT : FreeCAD . Console . PrintLog ( translate ( "AddonsInstaller" , "GitPython not found. Using ZIP file download instead." , ) + "\n" ) if not have_zip : FreeCAD . Console . PrintError ( translate ( "AddonsInstaller" , "Your version of Python doesn't appear to support ZIP files. Unable to proceed." , ) + "\n" ) return basedir = FreeCAD . getUserAppDataDir ( ) moddir = basedir + os . sep + "Mod" if not os . path . exists ( moddir ) : os . makedirs ( moddir ) target_dir = moddir + os . sep + self . repo . name if have_git and not NOGIT : # Do the git process... self . run_git ( target_dir ) else : # The zip process uses an event loop, since the download can potentially be quite large self . launch_zip ( target_dir ) self . zip_complete = False current_thread = QtCore . QThread . currentThread ( ) while not self . zip_complete : if current_thread . isInterruptionRequested ( ) : return QtCore . QCoreApplication . processEvents ( QtCore . QEventLoop . AllEvents , 50 )