[entropy.qa] rename ErrorReportInterface to ErrorReport, it's cleaner
This commit is contained in:
+2
-2
@@ -187,11 +187,11 @@ def handle_exception(exc_class, exc_instance, exc_tb):
|
||||
os._exit(2)
|
||||
|
||||
try:
|
||||
from entropy.client.interfaces.qa import UGCErrorReportInterface
|
||||
from entropy.client.interfaces.qa import UGCErrorReport
|
||||
from entropy.core.settings.base import SystemSettings
|
||||
_settings = SystemSettings()
|
||||
repository_id = _settings['repositories']['default_repository']
|
||||
error = UGCErrorReportInterface(repository_id)
|
||||
error = UGCErrorReport(repository_id)
|
||||
except (OnlineMirrorError, AttributeError, ImportError,):
|
||||
error = None
|
||||
|
||||
|
||||
@@ -9,14 +9,14 @@
|
||||
B{Entropy Package Manager Client QA Interface}.
|
||||
|
||||
"""
|
||||
from entropy.qa import ErrorReportInterface
|
||||
from entropy.qa import ErrorReport
|
||||
from entropy.client.interfaces import Client
|
||||
from entropy.core.settings.base import SystemSettings
|
||||
from entropy.const import etpConst
|
||||
from entropy.exceptions import PermissionDenied
|
||||
from entropy.services.client import WebService
|
||||
|
||||
class UGCErrorReportInterface(ErrorReportInterface):
|
||||
class UGCErrorReport(ErrorReport):
|
||||
|
||||
"""
|
||||
Entropy Errors Reporting Interface that works over User Generated
|
||||
@@ -28,7 +28,7 @@ class UGCErrorReportInterface(ErrorReportInterface):
|
||||
critical errors happened during normal operation.
|
||||
Here is an example on how to use this:
|
||||
|
||||
error_interface = UGCErrorReportInterface('sabayonlinux.org')
|
||||
error_interface = UGCErrorReport('sabayonlinux.org')
|
||||
error_interface.prepare()
|
||||
reported = error_interface.submit()
|
||||
if reported:
|
||||
@@ -45,7 +45,8 @@ class UGCErrorReportInterface(ErrorReportInterface):
|
||||
@param repository_id: valid repository identifier
|
||||
@type repository_id: string
|
||||
"""
|
||||
ErrorReportInterface.__init__(self, '#fake#')
|
||||
super(UGCErrorReport, self).__init__("#fake#")
|
||||
|
||||
self.__system_settings = SystemSettings()
|
||||
self._entropy = Client()
|
||||
if repository_id not in self.__system_settings['repositories']['order']:
|
||||
@@ -70,7 +71,7 @@ class UGCErrorReportInterface(ErrorReportInterface):
|
||||
|
||||
def submit(self):
|
||||
"""
|
||||
Overloaded method from ErrorReportInterface.
|
||||
Overridden method from ErrorReport.
|
||||
Does the actual error submission. You must call it after prepare().
|
||||
|
||||
@return submission status -- bool
|
||||
|
||||
+5
-5
@@ -14,7 +14,7 @@
|
||||
and Entropy Client such as binary packages health check, dependency
|
||||
test, broken or missing library tes.
|
||||
|
||||
B{ErrorReportInterface} is the HTTP POST based class for Entropy Client
|
||||
B{ErrorReport} is the HTTP POST based class for Entropy Client
|
||||
exceptions (errors) submission.
|
||||
|
||||
"""
|
||||
@@ -1624,7 +1624,7 @@ class QAInterface(TextInterface, EntropyPluginStore):
|
||||
return True
|
||||
|
||||
|
||||
class ErrorReportInterface:
|
||||
class ErrorReport(object):
|
||||
|
||||
"""
|
||||
|
||||
@@ -1640,8 +1640,8 @@ class ErrorReportInterface:
|
||||
|
||||
Sample code:
|
||||
|
||||
>>> from entropy.qa import ErrorReportInterface
|
||||
>>> error = ErrorReportInterface('http://url_for_http_post')
|
||||
>>> from entropy.qa import ErrorReport
|
||||
>>> error = ErrorReport('http://url_for_http_post')
|
||||
>>> error.prepare('traceback_text', 'John Foo', 'john@foo.com',
|
||||
report_data = 'extra traceback info',
|
||||
description = 'I was installing foo!')
|
||||
@@ -1651,7 +1651,7 @@ class ErrorReportInterface:
|
||||
|
||||
def __init__(self, post_url):
|
||||
"""
|
||||
ErrorReportInterface constructor.
|
||||
ErrorReport constructor.
|
||||
|
||||
@param post_url: HTTP post url where to submit data
|
||||
@type post_url: string
|
||||
|
||||
Reference in New Issue
Block a user