Exemplo n.º 1
0
    def cleanup(self):
        """Make sure the reactor, threads, etc have been stopped.  Also removes
    the file that indicates we shutdown cleanly."""

        #shutdown Twisted
        if ProgramState.USE_GTK:
            Globals.reactor.stop()
            Globals.reactor.runUntilCurrent()

        #ensure that all threads have closed:
        remainingThreads = threading.enumerate()
        for thread in remainingThreads:
            if threading._MainThread != type(thread):
                log_msg(
                    "Thread has not finished by the end of the program: %s" %
                    (thread), 1)

        #start the update if necessary:
        if Updater.get().APPLY_UPDATE:
            ClientUtil.apply_update()

        #NOTE:  we intentionally leave the log files open so that errors can get written to them...
        log_msg("Thanks for using BitBlinder", 2)
        ErrorReporting.destroy_marker_file()

        #NOTE:  this is here so that threads can finish properly.  I was getting errors from leftover threads without it.
        #However, I'm pretty sure that it was just from the IDE
        time.sleep(0.2)
Exemplo n.º 2
0
  def cleanup(self):
    """Make sure the reactor, threads, etc have been stopped.  Also removes
    the file that indicates we shutdown cleanly."""
    
    #shutdown Twisted
    if ProgramState.USE_GTK:
      Globals.reactor.stop()
      Globals.reactor.runUntilCurrent()
      
    #ensure that all threads have closed:
    remainingThreads = threading.enumerate()
    for thread in remainingThreads:
      if threading._MainThread != type(thread):
        log_msg("Thread has not finished by the end of the program: %s" % (thread), 1)

    #start the update if necessary:
    if Updater.get().APPLY_UPDATE:
      ClientUtil.apply_update()
      
    #NOTE:  we intentionally leave the log files open so that errors can get written to them...
    log_msg("Thanks for using BitBlinder", 2)
    ErrorReporting.destroy_marker_file()
    
    #NOTE:  this is here so that threads can finish properly.  I was getting errors from leftover threads without it.
    #However, I'm pretty sure that it was just from the IDE
    time.sleep(0.2)
Exemplo n.º 3
0
 def on_response(self, dialog, response_id):
   if (response_id == gtk.RESPONSE_OK):
     #get the login details, etc:
     self.username = str(self.nameEntry.get_text())
     if not self.username:
       GUIController.get().show_msgbox("You must enter a username of some sort.", title="Invalid Username")
       return
     #ship off to the ftp server!
     log_msg("archiving stuffs", 2)
     startiter = self.textbuffer.get_start_iter()
     enditer   = self.textbuffer.get_end_iter()
     buf = self.textbuffer.get_text(startiter, enditer)
     ClientUtil.create_error_archive(buf)
     log_msg("submiting archive", 2)
     def response(success):
       if success:
         GUIController.get().show_msgbox("The bug report was sent successfully.", title="Success!")
       else:
         if not ProgramState.DONE:
           GUIController.get().show_msgbox("The bug report failed.  You can submit the bug manually at:", title="Too Much Fail", link=GTKUtils.make_html_link("http://innomi.net/bugs/report/1", 'http://innomi.net/bugs/report/1'))
     ftpSubmitter = ErrorReporting.send_error_report()
     ftpSubmitter.cb = response
     GUIController.get().show_msgbox("The bug report is being sent.  BitBlinder will alert you when it is finished.", title="Thanks!")
     self.dia.destroy()
   elif (response_id == gtk.RESPONSE_CANCEL):
     self.dia.destroy()
   else:
     log_msg("canceled error submition", 2)
     
Exemplo n.º 4
0
    def _start_logging(self):
        #before we open the logs, make sure any previous errors get zipped up
        ErrorReporting.check_previous_logs()
        #delete the old log files and open the new ones
        Globals.logger.start()
        ErrorReporting.create_marker_file()

        #submit a bugreport if there is one from the last run:  (only do it if this is a release copy)
        #(now that we know the user's name)
        if ErrorReporting.has_report_to_send():
            ErrorReporting.prompt_about_bug_report()
Exemplo n.º 5
0
 def _start_logging(self):
   #before we open the logs, make sure any previous errors get zipped up
   ErrorReporting.check_previous_logs()
   #delete the old log files and open the new ones
   Globals.logger.start()
   ErrorReporting.create_marker_file()
   
   #submit a bugreport if there is one from the last run:  (only do it if this is a release copy)
   #(now that we know the user's name)
   if ErrorReporting.has_report_to_send():
     ErrorReporting.prompt_about_bug_report()
Exemplo n.º 6
0
    def on_response(self, dialog, response_id):
        if (response_id == gtk.RESPONSE_OK):
            #get the login details, etc:
            self.username = str(self.nameEntry.get_text())
            if not self.username:
                GUIController.get().show_msgbox(
                    "You must enter a username of some sort.",
                    title="Invalid Username")
                return
            #ship off to the ftp server!
            log_msg("archiving stuffs", 2)
            startiter = self.textbuffer.get_start_iter()
            enditer = self.textbuffer.get_end_iter()
            buf = self.textbuffer.get_text(startiter, enditer)
            ClientUtil.create_error_archive(buf)
            log_msg("submiting archive", 2)

            def response(success):
                if success:
                    GUIController.get().show_msgbox(
                        "The bug report was sent successfully.",
                        title="Success!")
                else:
                    if not ProgramState.DONE:
                        GUIController.get().show_msgbox(
                            "The bug report failed.  You can submit the bug manually at:",
                            title="Too Much Fail",
                            link=GTKUtils.make_html_link(
                                "http://innomi.net/bugs/report/1",
                                'http://innomi.net/bugs/report/1'))

            ftpSubmitter = ErrorReporting.send_error_report()
            ftpSubmitter.cb = response
            GUIController.get().show_msgbox(
                "The bug report is being sent.  BitBlinder will alert you when it is finished.",
                title="Thanks!")
            self.dia.destroy()
        elif (response_id == gtk.RESPONSE_CANCEL):
            self.dia.destroy()
        else:
            log_msg("canceled error submition", 2)