/usr/lib/python2.7/dist-packages/oops-0.0.10.egg-info is in python-oops 0.0.10-0ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | Metadata-Version: 1.1
Name: oops
Version: 0.0.10
Summary: OOPS report model and default allocation/[de]serialization.
Home-page: https://launchpad.net/python-oops
Author: Launchpad Developers
Author-email: launchpad-dev@lists.launchpad.net
License: UNKNOWN
Description: **************************
python-oops: Error reports
**************************
Copyright (c) 2011, Canonical Ltd
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, version 3 only.
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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
GNU Lesser General Public License version 3 (see the file LICENSE).
The oops project provides an in-memory model and basic serialisation,
deserialisation and allocation of OOPS reports. An OOPS report is a report
about something going wrong in a piece of software... thus, an 'oops' :)
This core package is rarely used directly: most programs or services that want
to generate OOPS reports will do so via a framework specific adapter (e.g.
python-oops_wsgi).
Dependencies
============
* Python 2.6+
Testing Dependencies
====================
* subunit (http://pypi.python.org/pypi/python-subunit) (optional)
* testtools (http://pypi.python.org/pypi/testtools)
Usage
=====
In Python, OOPS reports are dicts with some well known keys, but extensible
simply by adding as many additional keys asneeded. The only constraint is that
the resulting dict must be bson serializable : this is the standard to which
new serializers are held. Some existing serializers cannot handle this degree
of extensability and will ignore additional keys, and/or raise an error on keys
they expect but which contain unexpected data.
Typical usage:
* When initializing your script/app/server, create a Config object::
>>> from oops import Config
>>> config = Config()
* New reports will be based on the template report::
>>> config.template
{}
* You can edit the template report (which like all reports is just a dict)::
>>> config.template['branch_nick'] = 'mybranch'
>>> config.template['appname'] = 'demo'
* You can supply a callback (for instance, to capture your process memory usage
when the oops is created, or to override / tweak the information gathered by an
earlier callback)::
>>> mycallback = lambda report, context: None
>>> config.on_create.append(mycallback)
The context parameter is also just dict, and is passed to all the on_create
callbacks similarly to the report. This is used to support passing information
to the on_create hooks. For instance, the exc_info key is used to pass in
information about the exception being logged (if one was caught).
* Later on, when something has gone wrong and you want to create an OOPS
report::
>>> report = config.create(context=dict(exc_info=sys.exc_info()))
>>> report
{'appname': 'demo', 'branch_nick': 'mybranch'}
* And then send it off for storage::
>>> config.publish(report)
[]
* Note that publish returns a list - each item in the list is the id allocated
by the particular repository that recieved the report. (Id allocation is up
to the repository). Publishers should try to use report['id'] for the id, if it
is set. This is automatically set to the id returned by the previous publisher.
If publish returns None, then the report was filtered and not passed to any
publisher (see the api docs for more information).
>>> 'id' in report
False
>>> def demo_publish(report):
... return 'id 1'
>>> config.publishers.append(demo_publish)
>>> config.publish(report)
['id 1']
>>> report['id']
'id 1'
* The related project oops_datedir_repo contains a local disk based repository which
can be used as a publisher.
More coming soon.
Installation
============
Either run setup.py in an environment with all the dependencies available, or
add the working directory to your PYTHONPATH.
Development
===========
Upstream development takes place at https://launchpad.net/python-oops.
To setup a working area for development, if the dependencies are not
immediately available, you can use ./bootstrap.py to create bin/buildout, then
bin/py to get a python interpreter with the dependencies available.
To run the tests use the runner of your choice, the test suite is
oops.tests.test_suite.
For instance::
$ bin/py -m testtools.run oops.tests.test_suite
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
|