[Zope-CVS] SVN: zversioning/trunk/src/versioning/ overworked :-)
IVersion and IVersionableData
Grégoire Weber
zope.org at incept.ch
Wed Oct 13 20:16:19 EDT 2004
Log message for revision 28145:
overworked :-) IVersion and IVersionableData
Changed:
U zversioning/trunk/src/versioning/README.txt
U zversioning/trunk/src/versioning/interfaces.py
-=-
Modified: zversioning/trunk/src/versioning/README.txt
===================================================================
--- zversioning/trunk/src/versioning/README.txt 2004-10-13 23:33:52 UTC (rev 28144)
+++ zversioning/trunk/src/versioning/README.txt 2004-10-14 00:16:18 UTC (rev 28145)
@@ -32,7 +32,7 @@
3. Reverting to a version means that the saved state of an object is somehow
reconstructed in the present context. For some contexts a substitution
of the original with a saved copy is sufficient, sometimes references
- to the originl objects must remain intact. These different variants
+ to the original objects must remain intact. These different variants
are also defined in policies.py
Modified: zversioning/trunk/src/versioning/interfaces.py
===================================================================
--- zversioning/trunk/src/versioning/interfaces.py 2004-10-13 23:33:52 UTC (rev 28144)
+++ zversioning/trunk/src/versioning/interfaces.py 2004-10-14 00:16:18 UTC (rev 28145)
@@ -36,7 +36,7 @@
"""
import persistent, zope
-from zope.interface import Interface
+from zope.interface import Interface, Attribute
from zope.app.container.interfaces import INameChooser
@@ -225,63 +225,53 @@
class IVersionableData(Interface) :
- """ An adapter for versionable data. """
-
- def getData() :
- """ A copy method that allows to move of versionable data from workspace to workspace.
- Implementations must ensure that the copy is independent from its original
- database.
- """
-
- def getTicket() :
- """ Must return the ticket that is associated with this kind of data. """
-
- def getWhen() :
- """ Must return a datetime or None in which case the current system time is used as time stamp. """
-
- def getWho() :
- """ Must return a user id or None in which case the version is assigned to the current user. """
-
- def getPredecessors() :
- """ Returns a list of guid of predecessing versions. Should return None for the current version as a default predecessor. """
+ """ An adapter for versionable data. """
+
+ data = Attribute("A read only reference to the versioned data.")
+
+ ticket = Attribute("A read only ticket that is associated with "
+ "IVersionableData.")
+
+ timestamp = Attribute("The read onyl timestamp when the version "
+ "was stored to the repository")
+ principal = Attribute("The read only actor of the store action.")
+
class IVersion(IVersionableData):
- """ Versions are snapshots of data that change over time.
- In group situations there can be parallel versions that must be synchronized or merged.
- This interface defines some basic methods each version, whether on server or client side,
- should fullfill. It makes no assumptions about attributes or other
- implementation specific details besides the use of global unique ids.
- """
+ """ Versions are snapshots of data that change over time.
+ This interface defines some basic methods each version should
+ fullfill.
+ """
- def getDescriptor() :
- """ Returns the descriptor that created the version."""
-
- def getVersionLabel() :
- """ Returns a string that encodes the version sequence and parallel versions, e.g. '2a'"""
-
- def getName() :
- """ Returns a more describptive name that describes the version, e.g. 'Version2a'"""
-
- def setPredecessors(guids) :
- """ Sets the predecessors of a version. Accepts a list of guid as input. """
-
- def getPredecessors() :
- """ Returns a list of guid of predecessing versions. """
+ label = Attribute("Short read only string encoding version information.")
+
+ name = Attribute("User readable read only string encoding version "
+ "information.")
+
+ comment = Attribute("Read only user defined comment.")
+
+class IVersionNode(IVersion):
+ """In group situations there can be parallel versions that must be
+ synchronized or merged.
+
+ XXX Talk about graphs and nodes.
+ """
+
+ def setPredecessors(guids) :
+ """ Sets the predecessors of a version. Accepts a list of guid as input. """
+
+ def getPredecessors() :
+ """ Returns a list of guid of predecessing versions. """
- def isVersionable() :
- """ Returns False, because versions are not themselves versionable. """
-
- def getPredecessorNodes() :
- """ Return the direct predecessors as a list of nodes """
-
- def isPredecessorOf(version) :
- """ Returns a boolean that indicates whether this node is a predecessor of another version. """
-
- def isCurrent() :
- """ Returns a boolean that indicates whether this node is the current version. """
-
-
+ def isPredecessorOf(version) :
+ """ Returns a boolean that indicates whether this node is a predecessor of another version. """
+
+ def isCurrent() :
+ """ Returns a boolean that indicates whether this node is the current version. """
+
+
+
class IVersionHistory(INameChooser) :
""" A version history of a single object should be able to
generate unique names for each version within the version history.
@@ -362,5 +352,3 @@
# XXX describe Event types here
-
-
More information about the Zope-CVS
mailing list