[Zope3-checkins] CVS: Zope3/src/zope/app/browser/services - service.py:1.5

Jim Fulton jim@zope.com
Mon, 3 Feb 2003 14:01:23 -0500


Update of /cvs-repository/Zope3/src/zope/app/browser/services
In directory cvs.zope.org:/tmp/cvs-serv14927

Modified Files:
	service.py 
Log Message:
When using the type name as a sedault item name, now
use only the poertion of the name after the last dot. This causes much
more reasonable names to be selected.


=== Zope3/src/zope/app/browser/services/service.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/browser/services/service.py:1.4	Mon Feb  3 11:36:02 2003
+++ Zope3/src/zope/app/browser/services/service.py	Mon Feb  3 14:01:21 2003
@@ -38,6 +38,9 @@
         if not id:
             # Generate an id from the type name
             id = type_name
+            l = id.rfind('.')
+            if l >= 0:
+                id = id[l+1:]
             if id in self.context:
                 i=2
                 while ("%s-%s" % (id, i)) in self.context: