OOPS disk serialisation and repository management.
Project description
Copyright (c) 2011, Canonical Ltd
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
This is a component of the python-oops project: https://launchpad.net/python-oops. An OOPS report is a report about something going wrong in a piece of software… thus, an ‘oops’ :)
This package provides disk storage, management, and a serialisation format for OOPSes stored in the repository. Programs or services that are generating OOPS reports need this package or other similar ones, if they want to persist the reports.
Dependencies
Python 2.6+
The oops package (https://launchpad.net/python-oops or ‘oops’ on pypi).
Testing Dependencies
fixtures (http://pypi.python.org/pypi/fixtures)
subunit (http://pypi.python.org/pypi/python-subunit) (optional)
testtools (http://pypi.python.org/pypi/testtools)
Usage
oops_datedir_repo is an extension package for the oops package.
The DateDirRepo class provides an OOPS publisher (DateDirRepo.publish) which will write OOPSes into the repository.
Retrieving OOPSes can be done by using the low level serializer_rfc822 functions : an OOPS report can be written to a disk file via the serializer_rfc822.write() function, and read via the matching read() function.
The uniquefileallocator module is used by the repository implementation and provides a system for allocating file names on disk.
Typical usage:
>>> config = oops.Config() >>> with fixtures.TempDir() as tempdir: ... repo = oops_datedir_repo.DateDirRepo('/tmp/demo', 'servername') ... config.publishers.append(repo.publish) ... ids = config.publish({'oops': '!!!'})
For more information see the oops package documentation or the api docs.
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-datedir-repo. 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_datedir_repo.tests.test_suite
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file oops_datedir_repo-0.0.6.tar.gz
.
File metadata
- Download URL: oops_datedir_repo-0.0.6.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 333211d345d002d96c875ff3bc1da92798c517c59f3146b6ed8a6ee19ec94344 |
|
MD5 | 7fe7fd13c7e632ca179686d1e8564778 |
|
BLAKE2b-256 | f80dec9ee3d13dba48c76669cbc633865151bf59e45ff2350650d5b392db5d4e |