~certify-web-dev/twisted/certify-trunk

« back to all changes in this revision

Viewing changes to twisted/persisted/journal/base.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-01-17 14:52:35 UTC
  • mfrom: (1.1.5 upstream) (2.1.2 etch)
  • Revision ID: james.westby@ubuntu.com-20070117145235-btmig6qfmqfen0om
Tags: 2.5.0-0ubuntu1
New upstream version, compatible with python2.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
    import pickle
20
20
 
21
21
# twisted imports
22
 
from twisted.python.components import Interface
23
 
from twisted.python import components
24
 
from zope.interface import implements
 
22
from zope.interface import implements, Interface
25
23
 
26
24
 
27
25
class Journal:
103
101
class ICommand(Interface):
104
102
    """A serializable command which interacts with a journaled service."""
105
103
 
106
 
    def execute(self, journaledService, runTime):
 
104
    def execute(journaledService, runTime):
107
105
        """Run the command and return result."""
108
106
 
109
107
 
110
108
class ICommandLog(Interface):
111
109
    """Interface for command log."""
112
110
 
113
 
    def logCommand(self, command, runTime):
 
111
    def logCommand(command, runTime):
114
112
        """Add a command and its run time to the log.
115
113
 
116
114
        @return: Deferred of command index.
117
115
        """
118
116
 
119
 
    def getCurrentIndex(self):
 
117
    def getCurrentIndex():
120
118
        """Return index of last command that was logged."""
121
119
 
122
 
    def getCommandsSince(self, index):
 
120
    def getCommandsSince(index):
123
121
        """Return commands who's index >= the given one.
124
122
 
125
123
        @return: list of (time, command) tuples, sorted with ascending times.