[Zope3-checkins] SVN: Zope3/branches/jim-adapter/src/zope/ Move
zope.app.content_types not to zope.app.contenttypes but to
zope.contenttype.
Philipp von Weitershausen
philikon at philikon.de
Wed Apr 12 15:19:26 EDT 2006
Log message for revision 66901:
Move zope.app.content_types not to zope.app.contenttypes but to zope.contenttype.
Changed:
U Zope3/branches/jim-adapter/src/zope/app/__init__.py
D Zope3/branches/jim-adapter/src/zope/app/content_types.py
D Zope3/branches/jim-adapter/src/zope/app/contenttypes/
U Zope3/branches/jim-adapter/src/zope/app/file/DEPENDENCIES.cfg
U Zope3/branches/jim-adapter/src/zope/app/file/browser/file.py
U Zope3/branches/jim-adapter/src/zope/app/file/image.py
U Zope3/branches/jim-adapter/src/zope/app/onlinehelp/DEPENDENCIES.cfg
U Zope3/branches/jim-adapter/src/zope/app/onlinehelp/onlinehelptopic.py
U Zope3/branches/jim-adapter/src/zope/app/publisher/DEPENDENCIES.cfg
U Zope3/branches/jim-adapter/src/zope/app/publisher/fileresource.py
A Zope3/branches/jim-adapter/src/zope/contenttype/
U Zope3/branches/jim-adapter/src/zope/contenttype/tests/testContentTypes.py
-=-
Modified: Zope3/branches/jim-adapter/src/zope/app/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/__init__.py 2006-04-12 18:27:10 UTC (rev 66900)
+++ Zope3/branches/jim-adapter/src/zope/app/__init__.py 2006-04-12 19:19:25 UTC (rev 66901)
@@ -60,6 +60,7 @@
'zope.app.security.adapter': 'zope.security.adapter',
'zope.app.component.interface': 'zope.component.interface',
+ 'zope.app.content_types': 'zope.contenttype',
}
msg_35 = "%s has been moved to %s. This alias will be removed in Zope 3.5."
Deleted: Zope3/branches/jim-adapter/src/zope/app/content_types.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/content_types.py 2006-04-12 18:27:10 UTC (rev 66900)
+++ Zope3/branches/jim-adapter/src/zope/app/content_types.py 2006-04-12 19:19:25 UTC (rev 66901)
@@ -1,9 +0,0 @@
-from zope.app.contenttypes import text_type, guess_content_type, add_files
-from zope.deprecation import deprecated
-
-msg = ('zope.app.content_types has moved to zope.app.contenttypes. '
- 'This reference go away in Zope 3.4.')
-
-deprecated('text_type', msg)
-deprecated('guess_content_type', msg)
-deprecated('add_files', msg)
Modified: Zope3/branches/jim-adapter/src/zope/app/file/DEPENDENCIES.cfg
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/file/DEPENDENCIES.cfg 2006-04-12 18:27:10 UTC (rev 66900)
+++ Zope3/branches/jim-adapter/src/zope/app/file/DEPENDENCIES.cfg 2006-04-12 19:19:25 UTC (rev 66901)
@@ -1,8 +1,8 @@
persistent
transaction
zope.app
-zope.app.contenttypes
zope.app.onlinehelp
+zope.contenttype
zope.interface
zope.publisher
zope.schema
Modified: Zope3/branches/jim-adapter/src/zope/app/file/browser/file.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/file/browser/file.py 2006-04-12 18:27:10 UTC (rev 66900)
+++ Zope3/branches/jim-adapter/src/zope/app/file/browser/file.py 2006-04-12 19:19:25 UTC (rev 66901)
@@ -19,11 +19,11 @@
import zope.event
from zope import lifecycleevent
+from zope.contenttype import guess_content_type
from zope.publisher import contenttype
from zope.schema import Text
from zope.exceptions.interfaces import UserError
-from zope.app import contenttypes
from zope.app.file.file import File
from zope.app.file.interfaces import IFile
from zope.app.i18n import ZopeMessageFactory as _
@@ -58,7 +58,7 @@
contenttype = form.get("field.contentType")
if filename:
if not contenttype:
- contenttype = contenttypes.guess_content_type(filename)[0]
+ contenttype = guess_content_type(filename)[0]
if not form.get("add_input_name"):
form["add_input_name"] = filename
return self.update_object(form["field.data"], contenttype)
Modified: Zope3/branches/jim-adapter/src/zope/app/file/image.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/file/image.py 2006-04-12 18:27:10 UTC (rev 66900)
+++ Zope3/branches/jim-adapter/src/zope/app/file/image.py 2006-04-12 19:19:25 UTC (rev 66901)
@@ -23,8 +23,8 @@
from zope.interface import implements
from zope.size.interfaces import ISized
from zope.size import byteDisplay
+from zope.contenttype import guess_content_type
-from zope.app.contenttypes import guess_content_type
from zope.app.i18n import ZopeMessageFactory as _
from zope.app.file.file import File
from zope.app.file.interfaces import IImage
Modified: Zope3/branches/jim-adapter/src/zope/app/onlinehelp/DEPENDENCIES.cfg
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/onlinehelp/DEPENDENCIES.cfg 2006-04-12 18:27:10 UTC (rev 66900)
+++ Zope3/branches/jim-adapter/src/zope/app/onlinehelp/DEPENDENCIES.cfg 2006-04-12 19:19:25 UTC (rev 66901)
@@ -1,10 +1,10 @@
persistent
zope.app
zope.app.file
-zope.app.contenttypes
zope.app.renderer
zope.app.i18n
zope.configuration
+zope.contenttype
zope.interface
zope.proxy
zope.schema
Modified: Zope3/branches/jim-adapter/src/zope/app/onlinehelp/onlinehelptopic.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/onlinehelp/onlinehelptopic.py 2006-04-12 18:27:10 UTC (rev 66900)
+++ Zope3/branches/jim-adapter/src/zope/app/onlinehelp/onlinehelptopic.py 2006-04-12 19:19:25 UTC (rev 66901)
@@ -23,9 +23,9 @@
from persistent import Persistent
from zope.interface import implements
from zope.configuration.exceptions import ConfigurationError
+from zope.contenttype import guess_content_type
from zope.app.container.sample import SampleContainer
-from zope.app.contenttypes import guess_content_type
from zope.app.file.image import getImageInfo
from zope.app.onlinehelp.interfaces import IOnlineHelpTopic
Modified: Zope3/branches/jim-adapter/src/zope/app/publisher/DEPENDENCIES.cfg
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/publisher/DEPENDENCIES.cfg 2006-04-12 18:27:10 UTC (rev 66900)
+++ Zope3/branches/jim-adapter/src/zope/app/publisher/DEPENDENCIES.cfg 2006-04-12 19:19:25 UTC (rev 66901)
@@ -1 +1 @@
-zope.app.contenttypes
+zope.contenttype
Modified: Zope3/branches/jim-adapter/src/zope/app/publisher/fileresource.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/publisher/fileresource.py 2006-04-12 18:27:10 UTC (rev 66900)
+++ Zope3/branches/jim-adapter/src/zope/app/publisher/fileresource.py 2006-04-12 19:19:25 UTC (rev 66901)
@@ -17,10 +17,9 @@
"""
import os
import posixpath
-
from time import time
-from zope.app.contenttypes import guess_content_type
+from zope.contenttype import guess_content_type
from zope.datetime import rfc1123_date
Copied: Zope3/branches/jim-adapter/src/zope/contenttype (from rev 66899, Zope3/branches/jim-adapter/src/zope/app/contenttypes)
Modified: Zope3/branches/jim-adapter/src/zope/contenttype/tests/testContentTypes.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/contenttypes/tests/testContentTypes.py 2006-04-12 18:09:30 UTC (rev 66899)
+++ Zope3/branches/jim-adapter/src/zope/contenttype/tests/testContentTypes.py 2006-04-12 19:19:25 UTC (rev 66901)
@@ -13,7 +13,7 @@
##############################################################################
"""Tests of the contenttypes extension mechanism.
-$Id: testContentTypes.py 24763 2004-05-17 05:59:28Z philikon $
+$Id: testContenttype.py 24763 2004-05-17 05:59:28Z philikon $
"""
import mimetypes
@@ -21,7 +21,7 @@
import sys
import unittest
-from zope.app import contenttypes
+from zope import contenttype
try:
__file__
@@ -49,22 +49,22 @@
def test_add_one_file(self):
ntypes = len(mimetypes.types_map)
- contenttypes.add_files([MIME_TYPES_1])
- ctype, encoding = contenttypes.guess_content_type("foo.ztmt-1")
+ contenttype.add_files([MIME_TYPES_1])
+ ctype, encoding = contenttype.guess_content_type("foo.ztmt-1")
self.assert_(encoding is None)
self.assertEqual(ctype, "text/x-vnd.zope.test-mime-type-1")
- ctype, encoding = contenttypes.guess_content_type("foo.ztmt-1.gz")
+ ctype, encoding = contenttype.guess_content_type("foo.ztmt-1.gz")
self.assertEqual(encoding, "gzip")
self.assertEqual(ctype, "text/x-vnd.zope.test-mime-type-1")
self.check_types_count(1)
def test_add_two_files(self):
ntypes = len(mimetypes.types_map)
- contenttypes.add_files([MIME_TYPES_1, MIME_TYPES_2])
- ctype, encoding = contenttypes.guess_content_type("foo.ztmt-1")
+ contenttype.add_files([MIME_TYPES_1, MIME_TYPES_2])
+ ctype, encoding = contenttype.guess_content_type("foo.ztmt-1")
self.assert_(encoding is None)
self.assertEqual(ctype, "text/x-vnd.zope.test-mime-type-1")
- ctype, encoding = contenttypes.guess_content_type("foo.ztmt-2")
+ ctype, encoding = contenttype.guess_content_type("foo.ztmt-2")
self.assert_(encoding is None)
self.assertEqual(ctype, "text/x-vnd.zope.test-mime-type-2")
self.check_types_count(2)
More information about the Zope3-Checkins
mailing list