/usr/share/pyshared/djapian/utils/commiter.py is in python-django-djapian 2.3.1-3.
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 | class Commiter(object):
def __init__(self, begin, commit, cancel):
self._begin = begin
self._commit = commit
self._cancel = cancel
def begin_page(self):
pass
def begin_object(self):
pass
def commit_page(self):
pass
def commit_object(self):
pass
def cancel_page(self):
pass
def cancel_object(self):
pass
@classmethod
def create(cls, commit_each):
class _ConcreteCommiter(cls):
pass
prefix = commit_each and 'object' or 'page'
for name in ('begin', 'commit', 'cancel'):
def make_method(name):
return lambda self: getattr(self, '_%s' % name)()
setattr(
_ConcreteCommiter,
'%s_%s' % (name, prefix),
lambda self: make_method(name)
)
return _ConcreteCommiter
|