]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
interfaces: use explicit TupleOf and ChoiceOf constraints, since the upcoming version...
authorBrian Warner <warner@lothar.com>
Sat, 14 Apr 2007 02:04:38 +0000 (19:04 -0700)
committerBrian Warner <warner@lothar.com>
Sat, 14 Apr 2007 02:04:38 +0000 (19:04 -0700)
src/allmydata/interfaces.py

index 099a79e7410844a49be4a7d968951e18fb4c287f..f724ccd5edd93be648ed4ce955b7dfe1bcc7d7bf 100644 (file)
@@ -1,6 +1,7 @@
 
 from zope.interface import Interface
-from foolscap.schema import StringConstraint, ListOf, TupleOf, SetOf, DictOf
+from foolscap.schema import StringConstraint, ListOf, TupleOf, SetOf, DictOf, \
+     ChoiceOf
 from foolscap import RemoteInterface, Referenceable
 
 HASH_SIZE=32
@@ -81,12 +82,12 @@ RIMutableDirectoryNode_ = Any() # TODO: how can we avoid this?
 class RIMutableDirectoryNode(RemoteInterface):
     def list():
         return ListOf( TupleOf(str, # name, relative to directory
-                               (RIMutableDirectoryNode_, Verifierid)),
+                               ChoiceOf(RIMutableDirectoryNode_, Verifierid)),
                        maxLength=100,
                        )
 
     def get(name=str):
-        return (RIMutableDirectoryNode_, Verifierid)
+        return ChoiceOf(RIMutableDirectoryNode_, Verifierid)
 
     def add_directory(name=str):
         return RIMutableDirectoryNode_