commotion_client.GUI.crash_report.CrashReport Class Reference
Inheritance diagram for commotion_client.GUI.crash_report.CrashReport:

Public Member Functions

def __init__
 
def crash_alert
 
def check_restart
 
def check_quit
 
def generate_report
 
def update_countdown
 
def set_report
 
def save_report
 
def create_uuid
 

Public Attributes

 log
 
 report_timer
 
 error_msg
 
 gatherer
 
 countdown
 
 countdown_timer
 
 compiled_report
 
 uuid
 

Static Public Attributes

tuple crash_override = QtCore.pyqtSignal()
 
tuple crash_info = QtCore.pyqtSignal(str, dict)
 
tuple crash = QtCore.pyqtSignal(str)
 
tuple alert_user = QtCore.pyqtSignal(str)
 

Member Function Documentation

def commotion_client.GUI.crash_report.CrashReport.save_report (   self)
TODO ADD python-gnupg encryption to all data saved here.

References commotion_client.GUI.crash_report.CrashReport.compiled_report, and commotion_client.GUI.crash_report.CrashReport.uuid.

131  def save_report(self):
132  """
133  TODO ADD python-gnupg encryption to all data saved here.
134  """
135  #Save user comments
136  try:
137  self.compiled_report['error']['comments'] = str(self.comment_field.toPlainText())
138  except Exception as e:
139  self.log.info(QtCore.QCoreApplication.translate("logs", "The crash reporter could not store user comments in the crash report."))
140  self.log.debug(e, exc_info=1)
141  _settings = QtCore.QSettings()
142  _settings.beginGroup("CrashReport/"+self.uuid) #create a unique crash report
143  for section, results in self.compiled_report.items():
144  for name, value in results.items():
145  _settings.setValue(section+"/"+name, value)
146  _settings.endGroup()
def save_report
Definition: crash_report.py:130
uuid
Definition: crash_report.py:149
compiled_report
Definition: crash_report.py:108
def commotion_client.GUI.crash_report.CrashReport.set_report (   self)
set_report creates and saves the current error report and then disconnects crash_info signal.

References commotion_client.GUI.crash_report.CrashReport.compiled_report.

Referenced by commotion_client.GUI.crash_report.CrashReport.update_countdown().

102  def set_report(self):
103  """
104  set_report creates and saves the current error report and then disconnects crash_info signal.
105  """
106  #turn off report gatherer
107  self.crash_info.disconnect()
108  try:
109  self.compiled_report = self.gatherer.get_report()
110  except Exception as e:
111  self.log.error(QtCore.QCoreApplication.translate("logs", "Faile to create a crash report."))
112  self.log.debug(e, exc_info=1)
113  self.crash_report.setPlainText(QtCore.QCoreApplication.translate("A crash report could not be generated."))
114  return
115  else:
116  #send to user if window activated
117  printable_report = []
118  try:
119  for section, results in self.compiled_report.items():
120  printable_report.append("\n========== "+section+" ==========\n")
121  #format and append each name-value pair to the report.
122  printable_report.append("\n".join(['%s = %s' %(name, value) for name, value in results.items()]))
123  except Exception as e:
124  self.log.error(QtCore.QCoreApplication.translate("logs", "Failed to format crash report for user to view."))
125  self.log.debug(e, exc_info=1)
126  self.crash_report.setPlainText(QtCore.QCoreApplication.translate("Unable to parse crash report for viewing. You can send the report without viewing it or un-check \"Send crash report\" to cancel sending this report."))
127  else:
128  self.crash_report.setPlainText("\n".join(printable_report))
129  #todo add logs
def set_report
Definition: crash_report.py:101
compiled_report
Definition: crash_report.py:108
def commotion_client.GUI.crash_report.CrashReport.update_countdown (   self)
Slot for countdown timer timeout that populates the graphical countdown if required.        

References commotion_client.GUI.crash_report.CrashReport.countdown, and commotion_client.GUI.crash_report.CrashReport.set_report().

88 
89  def update_countdown(self):
90  """
91  Slot for countdown timer timeout that populates the graphical countdown if required.
92  """
93  self.countdown -= 1
94  self.report_gen_countdown.setProperty("intValue", self.countdown)
95  if self.countdown <= 0:
96  self.countdown_timer.stop()
97  self.report_loading_label.hide()
98  self.report_gen_countdown.hide()
99  self.set_report() #set report upon completion
100 
def set_report
Definition: crash_report.py:101
countdown
Definition: crash_report.py:83
def update_countdown
Definition: crash_report.py:88

The documentation for this class was generated from the following file: