[Zope3-checkins] CVS: Zope3/src/zope/app/fssync - syncer.py:1.19

Jim Fulton jim@zope.com
Wed, 21 May 2003 16:29:45 -0400


Update of /cvs-repository/Zope3/src/zope/app/fssync
In directory cvs.zope.org:/tmp/cvs-serv22695/src/zope/app/fssync

Modified Files:
	syncer.py 
Log Message:
Changed the API for handling named adapters.  There is
now a separate cleaner api for getting named adapters.

Also changed the handling of files wo extensions to look for an
adapter named ".".




=== Zope3/src/zope/app/fssync/syncer.py 1.18 => 1.19 ===
--- Zope3/src/zope/app/fssync/syncer.py:1.18	Thu May 15 17:27:43 2003
+++ Zope3/src/zope/app/fssync/syncer.py	Wed May 21 16:29:45 2003
@@ -175,10 +175,12 @@
         if isuffix >= 0:
             suffix = name[isuffix:]
         else:
-            suffix = ""
-        factory = as.queryAdapter(container, IFileFactory, name=suffix)
-        if factory is None and suffix:
+            suffix = "."
+            
+        factory = as.queryNamedAdapter(container, IFileFactory, suffix)
+        if factory is None:
             factory = as.queryAdapter(container, IFileFactory)
+
         if factory:
             newOb = factory(name, None, readFile(path))
             newOb = removeAllProxies(newOb)