[Checkins] SVN: lovely.session/trunk/ Use zope.container instead of zope.app.container

Nikolay Kim fafhrd91 at gmail.com
Fri Dec 11 02:19:19 EST 2009


Log message for revision 106424:
  Use zope.container instead of zope.app.container

Changed:
  U   lovely.session/trunk/CHANGES.txt
  U   lovely.session/trunk/bootstrap.py
  U   lovely.session/trunk/setup.py
  U   lovely.session/trunk/src/lovely/session/interfaces.py
  U   lovely.session/trunk/src/lovely/session/memcached.py

-=-
Modified: lovely.session/trunk/CHANGES.txt
===================================================================
--- lovely.session/trunk/CHANGES.txt	2009-12-11 07:07:41 UTC (rev 106423)
+++ lovely.session/trunk/CHANGES.txt	2009-12-11 07:19:19 UTC (rev 106424)
@@ -2,10 +2,14 @@
 CHANGES
 =======
 
-0.2.3 (Unreleased)
+0.3.0 (Unreleased)
 ------------------
 
+- Use zope.container instead of zope.app.container
 
+- Removed unused dependencies
+
+
 0.2.2 (2009-08-14)
 ------------------
 

Modified: lovely.session/trunk/bootstrap.py
===================================================================
--- lovely.session/trunk/bootstrap.py	2009-12-11 07:07:41 UTC (rev 106423)
+++ lovely.session/trunk/bootstrap.py	2009-12-11 07:19:19 UTC (rev 106424)
@@ -1,6 +1,6 @@
 ##############################################################################
 #
-# Copyright (c) 2007 Lovely Systems and Contributors.
+# Copyright (c) 2006 Zope Foundation and Contributors.
 # All Rights Reserved.
 #
 # This software is subject to the provisions of the Zope Public License,
@@ -11,7 +11,12 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
 $Id$
 """
 
@@ -19,27 +24,52 @@
 
 tmpeggs = tempfile.mkdtemp()
 
-ez = {}
-exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
-                     ).read() in ez
-ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+is_jython = sys.platform.startswith('java')
 
-import pkg_resources
+try:
+    import pkg_resources
+except ImportError:
+    ez = {}
+    exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+                         ).read() in ez
+    ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
 
-cmd = 'from setuptools.command.easy_install import main; main()'
+    import pkg_resources
+
 if sys.platform == 'win32':
-    cmd = '"%s"' % cmd # work around spawn lamosity on windows
+    def quote(c):
+        if ' ' in c:
+            return '"%s"' % c # work around spawn lamosity on windows
+        else:
+            return c
+else:
+    def quote (c):
+        return c
 
-ws = pkg_resources.working_set
-assert os.spawnle(
-    os.P_WAIT, sys.executable, sys.executable,
-    '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout',
-    dict(os.environ,
-         PYTHONPATH=
-         ws.find(pkg_resources.Requirement.parse('setuptools')).location
-         ),
-    ) == 0
+cmd = 'from setuptools.command.easy_install import main; main()'
+ws  = pkg_resources.working_set
 
+if is_jython:
+    import subprocess
+
+    assert subprocess.Popen([sys.executable] + ['-c', quote(cmd), '-mqNxd',
+           quote(tmpeggs), 'zc.buildout'],
+           env=dict(os.environ,
+               PYTHONPATH=
+               ws.find(pkg_resources.Requirement.parse('setuptools')).location
+               ),
+           ).wait() == 0
+
+else:
+    assert os.spawnle(
+        os.P_WAIT, sys.executable, quote (sys.executable),
+        '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout',
+        dict(os.environ,
+            PYTHONPATH=
+            ws.find(pkg_resources.Requirement.parse('setuptools')).location
+            ),
+        ) == 0
+
 ws.add_entry(tmpeggs)
 ws.require('zc.buildout')
 import zc.buildout.buildout

Modified: lovely.session/trunk/setup.py
===================================================================
--- lovely.session/trunk/setup.py	2009-12-11 07:07:41 UTC (rev 106423)
+++ lovely.session/trunk/setup.py	2009-12-11 07:19:19 UTC (rev 106424)
@@ -22,7 +22,7 @@
     return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
 
 setup(name='lovely.session',
-    version = '0.2.3dev',
+    version = '0',
     author = "Lovely Systems GmbH",
     author_email = "office at lovelysystems.com",
     description = "memcache-based session storage",
@@ -54,17 +54,16 @@
       namespace_packages=['lovely',],
       install_requires = ['setuptools',
                           'lovely.memcached',
-                          'zope.app.container',
+                          'zope.container',
                           'zope.session',
                           'zope.schema',
                           'zope.interface',
                           ],
       extras_require = dict(test=['zope.app.testing',
                                   'zope.app.zptpage',
-                                  'zope.app.securitypolicy',
-                                  'zope.app.zcmlfiles',
                                   'zope.testing',
-                                  'zope.security']),
+                                  'zope.security',
+                                  'zope.securitypolicy']),
       include_package_data = True,
       zip_safe = False,
       )

Modified: lovely.session/trunk/src/lovely/session/interfaces.py
===================================================================
--- lovely.session/trunk/src/lovely/session/interfaces.py	2009-12-11 07:07:41 UTC (rev 106423)
+++ lovely.session/trunk/src/lovely/session/interfaces.py	2009-12-11 07:19:19 UTC (rev 106424)
@@ -26,4 +26,3 @@
     cacheName = schema.TextLine(title=u'Cachename',
                                 required=False,
                                 default=u'')
-

Modified: lovely.session/trunk/src/lovely/session/memcached.py
===================================================================
--- lovely.session/trunk/src/lovely/session/memcached.py	2009-12-11 07:07:41 UTC (rev 106423)
+++ lovely.session/trunk/src/lovely/session/memcached.py	2009-12-11 07:19:19 UTC (rev 106424)
@@ -31,7 +31,7 @@
 
 from zope.schema.fieldproperty import FieldProperty
 
-from zope.app.container.contained import Contained
+from zope.container.contained import Contained
 from zope.session.interfaces import (
     ISessionDataContainer,
     ISessionData,
@@ -90,7 +90,7 @@
         now = int(time.time())
         if self.lastAccessTime + self.resolution < now:
             self.lastAccessTime = now
-            
+
         return dm.data
 
     def __setitem__(self, key, value):



More information about the checkins mailing list