[Checkins] SVN: five.hashedresource/trunk/ Package skel.

Sebastian Wehrmann sw at gocept.com
Mon Jul 13 07:26:26 EDT 2009


Log message for revision 101846:
  Package skel.
  

Changed:
  A   five.hashedresource/trunk/CHANGES.txt
  A   five.hashedresource/trunk/bootstrap.py
  A   five.hashedresource/trunk/buildout.cfg
  A   five.hashedresource/trunk/setup.py
  A   five.hashedresource/trunk/src/
  A   five.hashedresource/trunk/src/five/
  A   five.hashedresource/trunk/src/five/__init__.py
  A   five.hashedresource/trunk/src/five/hashedresource/
  A   five.hashedresource/trunk/src/five/hashedresource/README.txt
  A   five.hashedresource/trunk/src/five/hashedresource/__init__.py

-=-
Added: five.hashedresource/trunk/CHANGES.txt
===================================================================
--- five.hashedresource/trunk/CHANGES.txt	                        (rev 0)
+++ five.hashedresource/trunk/CHANGES.txt	2009-07-13 11:26:26 UTC (rev 101846)
@@ -0,0 +1,8 @@
+=======
+CHANGES
+=======
+
+0.1 (unreleased)
+================
+
+- first released version


Property changes on: five.hashedresource/trunk/CHANGES.txt
___________________________________________________________________
Added: svn:keywords
   + Id Rev Date
Added: svn:eol-style
   + native

Added: five.hashedresource/trunk/bootstrap.py
===================================================================
--- five.hashedresource/trunk/bootstrap.py	                        (rev 0)
+++ five.hashedresource/trunk/bootstrap.py	2009-07-13 11:26:26 UTC (rev 101846)
@@ -0,0 +1,55 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# 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$
+"""
+
+import os, shutil, sys, tempfile, urllib2
+
+tmpeggs = tempfile.mkdtemp()
+
+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)
+
+    import pkg_resources
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+if sys.platform == 'win32':
+    cmd = '"%s"' % cmd # work around spawn lamosity on windows
+
+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
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+shutil.rmtree(tmpeggs)


Property changes on: five.hashedresource/trunk/bootstrap.py
___________________________________________________________________
Added: svn:keywords
   + Id Rev Date
Added: svn:eol-style
   + native

Added: five.hashedresource/trunk/buildout.cfg
===================================================================
--- five.hashedresource/trunk/buildout.cfg	                        (rev 0)
+++ five.hashedresource/trunk/buildout.cfg	2009-07-13 11:26:26 UTC (rev 101846)
@@ -0,0 +1,7 @@
+[buildout]
+develop = .
+parts = test
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = five.hashedresource[test]

Added: five.hashedresource/trunk/setup.py
===================================================================
--- five.hashedresource/trunk/setup.py	                        (rev 0)
+++ five.hashedresource/trunk/setup.py	2009-07-13 11:26:26 UTC (rev 101846)
@@ -0,0 +1,43 @@
+import os
+from setuptools import setup, find_packages
+
+
+setup(
+    name='five.hashedresource',
+    version = '0.1dev',
+    author='Sebastian Wehrmann',
+    author_email='sw at gocept.com',
+    description='Provides URLs for resources that change whenever their content changes.',
+    url='http://pypi.python.org/pypi/five.hashedresource',
+    long_description= (
+        open(os.path.join('src', 'five', 'hashedresource', 'README.txt')).read()
+        + '\n\n'
+        + open('CHANGES.txt').read()),
+    classifiers = [
+        'Intended Audience :: Developers',
+        'License :: OSI Approved :: Zope Public License',
+        'Programming Language :: Python',
+        'Operating System :: OS Independent',
+        'Framework :: Zope2'],
+    license='ZPL 2.1',
+    packages=find_packages('src'),
+    package_dir = {'': 'src'},
+    namespace_packages=['five'],
+    install_requires=[
+        'setuptools',
+        'z3c.noop',
+        'zope.app.publisher',
+        'zope.component',
+        'zope.interface',
+        'zope.publisher',
+        ],
+    extras_require=dict(test=[
+        'zope.app.testing',
+        'zope.app.zcmlfiles',
+        'zope.security',
+        'zope.site',
+        'zope.testbrowser',
+        ]),
+    include_package_data = True,
+    zip_safe = False,
+)


Property changes on: five.hashedresource/trunk/setup.py
___________________________________________________________________
Added: svn:keywords
   + Id Rev Date
Added: svn:eol-style
   + native

Added: five.hashedresource/trunk/src/five/__init__.py
===================================================================
--- five.hashedresource/trunk/src/five/__init__.py	                        (rev 0)
+++ five.hashedresource/trunk/src/five/__init__.py	2009-07-13 11:26:26 UTC (rev 101846)
@@ -0,0 +1,5 @@
+try:
+    __import__('pkg_resources').declare_namespace(__name__)
+except ImportError, e:
+    from pkgutil import extend_path
+    __path__ = extend_path(__path__, __name__)


Property changes on: five.hashedresource/trunk/src/five/__init__.py
___________________________________________________________________
Added: svn:keywords
   + Id Rev Date
Added: svn:eol-style
   + native

Added: five.hashedresource/trunk/src/five/hashedresource/README.txt
===================================================================
--- five.hashedresource/trunk/src/five/hashedresource/README.txt	                        (rev 0)
+++ five.hashedresource/trunk/src/five/hashedresource/README.txt	2009-07-13 11:26:26 UTC (rev 101846)
@@ -0,0 +1,23 @@
+===================
+five.hashedresource
+===================
+
+While we want browsers to cache static resources such as CSS-stylesheets and
+JavaScript files, we also want them *not* to use the cached version if the
+files on the server have been updated. (And we don't want to make end-users
+have to empty their browser cache to get the latest version. Nor explain how
+to do that over the phone every time.)
+
+To make browsers update their caches of resources immediately when the
+resource changes, the absolute URLs of resources can now be made to contain a
+hash of the resource's contents, so it will look like
+/++noop++12345/@@/myresource instead of /@@/myresource.
+
+In developer mode the hash is recomputed each time the resource is asked for
+its URL, while in production mode the hash is computed only once, so remember
+to restart the server after changing resource files (else browsers will still
+see the old URL unchanged and use their outdated cached versions of the files).
+
+To use this package, include its configure.zcml and use
+`five.hashedresource.interfaces.IHashedResourceSkin` or a skin that inherits from
+it.


Property changes on: five.hashedresource/trunk/src/five/hashedresource/README.txt
___________________________________________________________________
Added: svn:keywords
   + Id Rev Date
Added: svn:eol-style
   + native

Added: five.hashedresource/trunk/src/five/hashedresource/__init__.py
===================================================================
--- five.hashedresource/trunk/src/five/hashedresource/__init__.py	                        (rev 0)
+++ five.hashedresource/trunk/src/five/hashedresource/__init__.py	2009-07-13 11:26:26 UTC (rev 101846)
@@ -0,0 +1 @@
+# python package


Property changes on: five.hashedresource/trunk/src/five/hashedresource/__init__.py
___________________________________________________________________
Added: svn:keywords
   + Id Rev Date
Added: svn:eol-style
   + native



More information about the Checkins mailing list