[Zope3-checkins] SVN: Zope3/branches/jim-adapter/src/zope/ More on
MakeZopeAppSmaller:
Philipp von Weitershausen
philikon at philikon.de
Mon Apr 3 04:16:57 EDT 2006
Log message for revision 66348:
More on MakeZopeAppSmaller:
* Move zope.app.size to zope.size
Changed:
U Zope3/branches/jim-adapter/src/zope/app/DEPENDENCIES.cfg
D Zope3/branches/jim-adapter/src/zope/app/size/
A Zope3/branches/jim-adapter/src/zope/size/
A Zope3/branches/jim-adapter/src/zope/size/DEPENDENCIES.cfg
U Zope3/branches/jim-adapter/src/zope/size/__init__.py
U Zope3/branches/jim-adapter/src/zope/size/configure.zcml
U Zope3/branches/jim-adapter/src/zope/size/tests.py
-=-
Modified: Zope3/branches/jim-adapter/src/zope/app/DEPENDENCIES.cfg
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/DEPENDENCIES.cfg 2006-04-03 05:10:52 UTC (rev 66347)
+++ Zope3/branches/jim-adapter/src/zope/app/DEPENDENCIES.cfg 2006-04-03 08:16:56 UTC (rev 66348)
@@ -26,6 +26,7 @@
zope.schema
zope.security
zope.server
+zope.size
zope.tal
zope.tales
zope.testbrowser
Copied: Zope3/branches/jim-adapter/src/zope/size (from rev 66345, Zope3/branches/jim-adapter/src/zope/app/size)
Added: Zope3/branches/jim-adapter/src/zope/size/DEPENDENCIES.cfg
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/size/DEPENDENCIES.cfg 2006-04-03 05:00:01 UTC (rev 66345)
+++ Zope3/branches/jim-adapter/src/zope/size/DEPENDENCIES.cfg 2006-04-03 08:16:56 UTC (rev 66348)
@@ -0,0 +1,2 @@
+zope.interface
+zope.i18nmessageid
\ No newline at end of file
Modified: Zope3/branches/jim-adapter/src/zope/size/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/size/__init__.py 2006-04-03 05:00:01 UTC (rev 66345)
+++ Zope3/branches/jim-adapter/src/zope/size/__init__.py 2006-04-03 08:16:56 UTC (rev 66348)
@@ -15,9 +15,10 @@
$Id$
"""
-from zope.app.i18n import ZopeMessageFactory as _
-from zope.app.size.interfaces import ISized
from zope.interface import implements
+from zope.size.interfaces import ISized
+from zope.i18nmessageid import MessageFactory
+_ = MessageFactory('zope')
class DefaultSized(object):
implements(ISized)
Modified: Zope3/branches/jim-adapter/src/zope/size/configure.zcml
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/size/configure.zcml 2006-04-03 05:00:01 UTC (rev 66345)
+++ Zope3/branches/jim-adapter/src/zope/size/configure.zcml 2006-04-03 08:16:56 UTC (rev 66348)
@@ -1,13 +1,10 @@
-<configure
- xmlns="http://namespaces.zope.org/zope"
- xmlns:global_translation="http://namespaces.zope.org/gts"
- i18n_domain="zope"
- >
+<configure xmlns="http://namespaces.zope.org/zope">
<adapter
for="*"
- factory="zope.app.size.DefaultSized"
- provides="zope.app.size.interfaces.ISized"
- permission="zope.View" />
+ factory="zope.size.DefaultSized"
+ provides="zope.size.interfaces.ISized"
+ permission="zope.View"
+ />
-</configure>
+</configure>
\ No newline at end of file
Modified: Zope3/branches/jim-adapter/src/zope/size/tests.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/size/tests.py 2006-04-03 05:00:01 UTC (rev 66345)
+++ Zope3/branches/jim-adapter/src/zope/size/tests.py 2006-04-03 08:16:56 UTC (rev 66348)
@@ -16,9 +16,8 @@
$Id$
"""
import unittest
+from zope.size.interfaces import ISized
-from zope.app.size.interfaces import ISized
-
class DummyObject(object):
def __init__(self, size):
@@ -30,32 +29,32 @@
class Test(unittest.TestCase):
def testImplementsISized(self):
- from zope.app.size import DefaultSized
+ from zope.size import DefaultSized
sized = DefaultSized(object())
self.assert_(ISized.providedBy(sized))
def testSizeWithBytes(self):
- from zope.app.size import DefaultSized
+ from zope.size import DefaultSized
obj = DummyObject(1023)
sized = DefaultSized(obj)
self.assertEqual(sized.sizeForSorting(), ('byte', 1023))
self.assertEqual(sized.sizeForDisplay(), u'1 KB')
def testSizeWithNone(self):
- from zope.app.size import DefaultSized
+ from zope.size import DefaultSized
obj = DummyObject(None)
sized = DefaultSized(obj)
self.assertEqual(sized.sizeForSorting(), (None, None))
self.assertEqual(sized.sizeForDisplay(), u'not-available')
def testSizeNotAvailable(self):
- from zope.app.size import DefaultSized
+ from zope.size import DefaultSized
sized = DefaultSized(object())
self.assertEqual(sized.sizeForSorting(), (None, None))
self.assertEqual(sized.sizeForDisplay(), u'not-available')
def testVariousSizes(self):
- from zope.app.size import DefaultSized
+ from zope.size import DefaultSized
sized = DefaultSized(DummyObject(0))
self.assertEqual(sized.sizeForSorting(), ('byte', 0))
@@ -76,7 +75,7 @@
self.assertEqual(sized.sizeForDisplay().mapping, {'size': '1.91'})
def test_byteDisplay(self):
- from zope.app.size import byteDisplay
+ from zope.size import byteDisplay
self.assertEqual(byteDisplay(0), u'0 KB')
self.assertEqual(byteDisplay(1), u'1 KB')
self.assertEqual(byteDisplay(2048), u'${size} KB')
More information about the Zope3-Checkins
mailing list