Author: jmorliaguet
Date: Sun Jul  2 23:32:05 2006
New Revision: 3596

Modified:
   cpsskins/branches/paris-sprint-2006/locations/README.txt
   cpsskins/branches/paris-sprint-2006/locations/sources.py

Log:

- test update: scopes with a non-zero end do not work as expected

- added a scope (all immediate sub-folders)



Modified: cpsskins/branches/paris-sprint-2006/locations/README.txt
==============================================================================
--- cpsskins/branches/paris-sprint-2006/locations/README.txt    (original)
+++ cpsskins/branches/paris-sprint-2006/locations/README.txt    Sun Jul  2 
23:32:05 2006
@@ -216,26 +216,32 @@
     >>> l3
     <Location at /f1/f3/>
 
-means that the 'l3' location has a scope covering /f1/f3 and all immediate
-sublocation paths (/f1/f3/...) but not (/f1/f3/.../...)
+- the first element of the couple is the position starting from the location.
+- the second element of the couple is the end position relative to the
+  location. 1 is the level of the location, 2 is the level of immediate
+  sublocation, 0 means no limit.
+
+(0, 1) means that the 'l3' location at /f1/f3/ has a scope covering /f1/f3/
+only.
 
 
     >>> locations.find(u'/f1/f3/')
     <Location at /f1/f3/>
 
     >>> locations.find(u'/f1/f3/f4/')
-    <Location at /f1/f3/>
+    <Location at /f1/>
 
     >>> locations.find(u'/f1/f3/f4/f5/')
     <Location at /f1/>
 
-l4 has a scope covering '/f1/f4/' and sublocations of level 1 and 2:
 
-    >>> l4 = Location(path=u'/f1/f4/', data=u'D', scope=(0, 2))
+l4 has a scope (1, 0) covering all sublocations of '/f1/f4/'.
+
+    >>> l4 = Location(path=u'/f1/f4/', data=u'D', scope=(1, 0))
     >>> locations.add(l4)
 
     >>> locations.find(u'/f1/f4/')
-    <Location at /f1/f4/>
+    <Location at /f1/>
 
     >>> locations.find(u'/f1/f4/f5/')
     <Location at /f1/f4/>
@@ -244,14 +250,12 @@
     <Location at /f1/f4/>
 
     >>> locations.find(u'/f1/f4/f5/f6/f7/')
-    <Location at /f1/>
+    <Location at /f1/f4/>
 
-    >>> locations.find(u'/f1/f4/f5/f6/f7/f8/')
-    <Location at /f1/>
 
-l5 has a scope covering the '/f1/f5' location's immediate sublocations only:
+l5 has a scope (1, 2) covering the immediate sublocations of '/f1/f5' only:
 
-    >>> l5 = Location(path=u'/f1/f5/', data=u'E', scope=(1, 1))
+    >>> l5 = Location(path=u'/f1/f5/', data=u'E', scope=(1, 2))
     >>> locations.add(l5)
 
     >>> locations.find(u'/f1/f5/')
@@ -260,8 +264,12 @@
     >>> locations.find(u'/f1/f5/f6/')
     <Location at /f1/f5/>
 
-l6 has a scope covering the '/f1/f6/' location's sublocations of level 2 or
-more:
+    >>> locations.find(u'/f1/f5/f6/f7/')
+    <Location at /f1/>
+
+
+l6 has a scope (2, 0) covering the '/f1/f6/' location's sublocations of level
+2 or more:
 
     >>> l6 = Location(path=u'/f1/f6/', data=u'F', scope=(2, 0))
     >>> locations.add(l6)

Modified: cpsskins/branches/paris-sprint-2006/locations/sources.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/locations/sources.py    (original)
+++ cpsskins/branches/paris-sprint-2006/locations/sources.py    Sun Jul  2 
23:32:05 2006
@@ -34,8 +34,9 @@
     return SimpleVocabulary(
         [SimpleTerm(value, title=title) for value, title in (
             ((0, 0), _(u"there and in all sub-folders")),
-            ((0, 1), _(u"only there")),
+            ((0, 1), _(u"only in that folder")),
             ((1, 0), _(u"in all sub-folders")),
+            ((1, 2), _(u"only in immediate sub-folders")),
         )])
 
 alsoProvides(scopesVocabulary, IVocabularyFactory)
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to