Back to index

plone3  3.1.7
fields.py
Go to the documentation of this file.
00001 
00002 from zope.schema import Text
00003 from zope.schema.interfaces import IFromUnicode
00004 from zope.interface import implements
00005 import os.path
00006 
00007 class PathList(Text):
00008 
00009     implements(IFromUnicode)
00010 
00011     def fromUnicode(self, u):
00012         result = []
00013         for u in u.split():
00014             if os.path.isabs(u):
00015                 path = os.path.normpath(u)
00016             else:
00017                 path = self.context.path(u)
00018             result.append(path)
00019         return result