[Checkins] SVN: z3c.pt/trunk/ Made z3c.pt a namespace package.

Malthe Borch mborch at gmail.com
Tue Sep 9 11:44:36 EDT 2008


Log message for revision 91004:
  Made z3c.pt a namespace package.

Changed:
  U   z3c.pt/trunk/CHANGES.txt
  U   z3c.pt/trunk/src/z3c/pt/__init__.py
  U   z3c.pt/trunk/src/z3c/pt/configure.zcml
  U   z3c.pt/trunk/src/z3c/pt/template.txt

-=-
Modified: z3c.pt/trunk/CHANGES.txt
===================================================================
--- z3c.pt/trunk/CHANGES.txt	2008-09-09 15:42:30 UTC (rev 91003)
+++ z3c.pt/trunk/CHANGES.txt	2008-09-09 15:44:35 UTC (rev 91004)
@@ -17,6 +17,8 @@
 
   Features
 
+- Made ``z3c.pt`` a namespace package. [malthe]
+  
 - Added reduce and restore operation to the compilation and rendering
   flow in the test examples to verify integrity. [malthe]
 

Modified: z3c.pt/trunk/src/z3c/pt/__init__.py
===================================================================
--- z3c.pt/trunk/src/z3c/pt/__init__.py	2008-09-09 15:42:30 UTC (rev 91003)
+++ z3c.pt/trunk/src/z3c/pt/__init__.py	2008-09-09 15:44:35 UTC (rev 91004)
@@ -1,9 +1,6 @@
-from pagetemplate import PageTemplate
-from pagetemplate import PageTemplateFile
-from pagetemplate import ViewPageTemplate
-from pagetemplate import ViewPageTemplateFile
-
-from texttemplate import TextTemplate
-from texttemplate import TextTemplateFile
-from texttemplate import ViewTextTemplate
-from texttemplate import ViewTextTemplateFile
+# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
+try:
+    __import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+    from pkgutil import extend_path
+    __path__ = extend_path(__path__, __name__)

Modified: z3c.pt/trunk/src/z3c/pt/configure.zcml
===================================================================
--- z3c.pt/trunk/src/z3c/pt/configure.zcml	2008-09-09 15:42:30 UTC (rev 91003)
+++ z3c.pt/trunk/src/z3c/pt/configure.zcml	2008-09-09 15:44:35 UTC (rev 91004)
@@ -1,4 +1,5 @@
-<configure xmlns="http://namespaces.zope.org/zope"
+<configure package="z3c.pt"
+           xmlns="http://namespaces.zope.org/zope"
            xmlns:zcml="http://namespaces.zope.org/zcml">
 
   <include package="zope.component" file="meta.zcml" />

Modified: z3c.pt/trunk/src/z3c/pt/template.txt
===================================================================
--- z3c.pt/trunk/src/z3c/pt/template.txt	2008-09-09 15:42:30 UTC (rev 91003)
+++ z3c.pt/trunk/src/z3c/pt/template.txt	2008-09-09 15:44:35 UTC (rev 91004)
@@ -6,7 +6,7 @@
 z3c.pt.pagetemplate.PageTemplate
 --------------------------------
 
-  >>> from z3c.pt import PageTemplate
+  >>> from z3c.pt.pagetemplate import PageTemplate
   >>> from z3c.pt.testing import mock_parser
   
   >>> print PageTemplate("""\
@@ -20,7 +20,7 @@
 z3c.pt.pagetemplate.PageTemplateFile
 ------------------------------------
 
-  >>> from z3c.pt import PageTemplateFile
+  >>> from z3c.pt.pagetemplate import PageTemplateFile
   >>> from z3c.pt import tests
   >>> path = tests.__path__[0]
   >>> t = PageTemplateFile(path+'/helloworld.pt')
@@ -36,7 +36,7 @@
 z3c.pt.pagetemplate.ViewPageTemplate
 ------------------------------------
 
-  >>> from z3c.pt import ViewPageTemplate
+  >>> from z3c.pt.pagetemplate import ViewPageTemplate
   
   >>> class ViewPageTemplateView(object):
   ...     __call__ = ViewPageTemplate(
@@ -57,7 +57,7 @@
 z3c.pt.pagetemplate.ViewPageTemplateFile
 ----------------------------------------
 
-  >>> from z3c.pt import ViewPageTemplateFile
+  >>> from z3c.pt.pagetemplate import ViewPageTemplateFile
   
   >>> class ViewPageTemplateView(object):
   ...     __call__ = ViewPageTemplateFile(path+'/view.pt')
@@ -77,7 +77,7 @@
 z3c.pt.texttemplate.ViewTextTemplate
 ------------------------------------
 
-  >>> from z3c.pt import ViewTextTemplate
+  >>> from z3c.pt.texttemplate import ViewTextTemplate
   
   >>> class ViewTextTemplateView(object):
   ...     __call__ = ViewTextTemplate(open(path+'/view.css').read())
@@ -94,7 +94,7 @@
 z3c.pt.texttemplate.ViewTextTemplateFile
 ----------------------------------------
 
-  >>> from z3c.pt import ViewTextTemplateFile
+  >>> from z3c.pt.texttemplate import ViewTextTemplateFile
   
   >>> class ViewTextTemplateView(object):
   ...     __call__ = ViewTextTemplateFile(path+'/view.css')
@@ -238,7 +238,6 @@
 
 Exception while evaluating expression:
 
-  >>> from z3c.pt import PageTemplate
   >>> PageTemplate("""\
   ... <div xmlns="http://www.w3.org/1999/xhtml"
   ...      xmlns:tal="http://xml.zope.org/namespaces/tal">
@@ -250,7 +249,6 @@
 
 Exception while evaluating definition:
 
-  >>> from z3c.pt import PageTemplate
   >>> PageTemplate("""\
   ... <div xmlns="http://www.w3.org/1999/xhtml"
   ...      xmlns:tal="http://xml.zope.org/namespaces/tal">
@@ -262,7 +260,6 @@
 
 Exception while evaluating interpolation:
 
-  >>> from z3c.pt import PageTemplate
   >>> PageTemplate("""\
   ... <div xmlns="http://www.w3.org/1999/xhtml"
   ...      xmlns:tal="http://xml.zope.org/namespaces/tal">



More information about the Checkins mailing list