__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
"""Apport integration to provide better problem reports.""" # Copyright (C) 2010 Sebastian Heinlein <[email protected]> # # Licensed under the GNU General Public License Version 2 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. __author__ = "Sebastian Heinlein <[email protected]>" __all__ = ("create_report") import os import apport import apport.fileutils import apt_pkg from . import enums def create_report(error, traceback, trans=None): """Create an apport problem report for a given crash. :param error: The summary of the error. :param traceback: The traceback of the exception. :param trans: The optional transaction in which the crash occured. """ if not apport.packaging.enabled() or os.getcwd() != "/": return uid = 0 report = apport.Report("Crash") report["Title"] = error package = "aptdaemon" try: package_version = apport.packaging.get_version(package) except ValueError as e: if 'does not exist' in e.message: package_version = 'unknown' report['Package'] = '%s %s' % (package, package_version) report["SourcePackage"] = "aptdaemon" report["Traceback"] = traceback report["ExecutablePath"] = "/usr/sbin/aptd" report.add_os_info() # Attach information about the transaction if trans: report["Annotation"] = enums.get_role_error_from_enum(trans.role) report["TransactionRole"] = trans.role report["TransactionPackages"] = str([list(l) for l in trans.packages]) report["TransactionDepends"] = str([list(l) for l in trans.depends]) report["TransactionKwargs"] = str(trans.kwargs) report["TransactionLocale"] = trans.locale report["TransactionOutput"] = trans.output report["TransactionErrorCode"] = trans._error_property[0] report["TransactionErrorDetails"] = trans._error_property[1] uid = os.path.basename(trans.tid) # Write report with apport.fileutils.make_report_file(report, uid) as f: report.write(f) if __name__ == "__main__": apt_pkg.init_config() create_report('test', 'testtrace') # vim:ts=4:sw=4:et
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| __pycache__ | Folder | 0755 |
|
|
| worker | Folder | 0755 |
|
|
| __init__.py | File | 1.14 KB | 0644 |
|
| client.py | File | 68.73 KB | 0644 |
|
| console.py | File | 26.95 KB | 0644 |
|
| core.py | File | 85.82 KB | 0644 |
|
| crash.py | File | 2.74 KB | 0644 |
|
| debconf.py | File | 6.58 KB | 0644 |
|
| enums.py | File | 31.35 KB | 0644 |
|
| errors.py | File | 7.29 KB | 0644 |
|
| gtk3widgets.py | File | 47.28 KB | 0644 |
|
| lock.py | File | 5.9 KB | 0644 |
|
| logger.py | File | 2.3 KB | 0644 |
|
| loop.py | File | 1.07 KB | 0644 |
|
| networking.py | File | 9.7 KB | 0644 |
|
| policykit1.py | File | 6.83 KB | 0644 |
|
| progress.py | File | 33.4 KB | 0644 |
|
| utils.py | File | 3.79 KB | 0644 |
|