[Checkins] SVN: hurry.extjs/ Initial import

Santiago Videla santiago.videla at gmail.com
Mon May 4 15:00:22 EDT 2009


Log message for revision 99737:
  Initial import
  
  

Changed:
  A   hurry.extjs/branches/
  A   hurry.extjs/tags/
  A   hurry.extjs/trunk/
  A   hurry.extjs/trunk/CHANGES.txt
  A   hurry.extjs/trunk/README.txt
  A   hurry.extjs/trunk/bootstrap.py
  A   hurry.extjs/trunk/buildout.cfg
  A   hurry.extjs/trunk/setup.py
  A   hurry.extjs/trunk/src/
  A   hurry.extjs/trunk/src/hurry/
  A   hurry.extjs/trunk/src/hurry/__init__.py
  A   hurry.extjs/trunk/src/hurry/extjs/
  A   hurry.extjs/trunk/src/hurry/extjs/__init__.py
  A   hurry.extjs/trunk/src/hurry/extjs/basic.txt
  A   hurry.extjs/trunk/src/hurry/extjs/configure.zcml
  A   hurry.extjs/trunk/src/hurry/extjs/extjs.py
  A   hurry.extjs/trunk/src/hurry/extjs/tests.py

-=-
Added: hurry.extjs/trunk/CHANGES.txt
===================================================================
--- hurry.extjs/trunk/CHANGES.txt	                        (rev 0)
+++ hurry.extjs/trunk/CHANGES.txt	2009-05-04 19:00:21 UTC (rev 99737)
@@ -0,0 +1,7 @@
+CHANGES
+*******
+
+2.2.1 (ExtJS version: 2.2.1)
+===============================================
+
+* Initial public release.

Added: hurry.extjs/trunk/README.txt
===================================================================
--- hurry.extjs/trunk/README.txt	                        (rev 0)
+++ hurry.extjs/trunk/README.txt	2009-05-04 19:00:21 UTC (rev 99737)
@@ -0,0 +1,34 @@
+hurry.extjs
+***********
+
+Introduction
+============
+
+This library packages ExtJS_ for `hurry.resource`_.
+
+.. _`hurry.resource`: http://pypi.python.org/pypi/hurry.resource
+
+.. _ExtJS: http://www.extjs.com/
+
+How to use?
+===========
+
+First download ExtJS_ and place it in your home directory.
+Once it's finished, add `hurry.extjs` to your setup.py and run ./bin/buildout::
+
+        install_requires=[
+           ...,
+           'hurry.extjs==2.2.1',
+        ],
+
+Note that you `must` use always the same versions of ExtJS and `hurry.extjs`
+
+Now, you can import ``extjs`` like this::
+
+  from hurry.extjs import extjs_all, extjs_css
+
+And then to trigger inclusion in the web page, anywhere within
+your page or widget rendering code, do this::
+
+  extjs_all.need()
+  extjs_css.need()

Added: hurry.extjs/trunk/bootstrap.py
===================================================================
--- hurry.extjs/trunk/bootstrap.py	                        (rev 0)
+++ hurry.extjs/trunk/bootstrap.py	2009-05-04 19:00:21 UTC (rev 99737)
@@ -0,0 +1,62 @@
+##############################################################################
+#
+# 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: bootstrap.py 85041 2008-03-31 15:57:30Z andreasjung $
+"""
+
+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
+
+if sys.platform == 'win32':
+    def quote(c):
+        if ' ' in c:
+            return '"%s"' % c # work around spawn lamosity on windows
+        else:
+            return c
+else:
+    def quote (c):
+        return c
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+ws  = pkg_resources.working_set
+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
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+shutil.rmtree(tmpeggs)

Added: hurry.extjs/trunk/buildout.cfg
===================================================================
--- hurry.extjs/trunk/buildout.cfg	                        (rev 0)
+++ hurry.extjs/trunk/buildout.cfg	2009-05-04 19:00:21 UTC (rev 99737)
@@ -0,0 +1,20 @@
+[buildout]
+develop = . 
+parts = scripts devpython test
+versions = versions
+
+[versions]
+
+[scripts]
+recipe = zc.recipe.egg:scripts
+eggs = hurry.extjs
+
+[devpython]
+recipe = zc.recipe.egg
+interpreter = devpython
+eggs = hurry.extjs
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = hurry.extjs
+defaults = ['--tests-pattern', '^f?tests$', '-v']

Added: hurry.extjs/trunk/setup.py
===================================================================
--- hurry.extjs/trunk/setup.py	                        (rev 0)
+++ hurry.extjs/trunk/setup.py	2009-05-04 19:00:21 UTC (rev 99737)
@@ -0,0 +1,60 @@
+from setuptools import setup, find_packages
+import sys, os, shutil, tempfile
+
+EXTJS_VERSION = '2.2.1'
+
+extzip = os.path.expanduser('~') + '/ext-%s.zip' % EXTJS_VERSION
+
+dirpath = tempfile.mkdtemp()
+extjs_path = os.path.join(dirpath, 'extjs.zip')
+ex_path = os.path.join(dirpath, 'extjs_ex')
+
+shutil.copy(extzip, extjs_path)
+os.system('unzip -qq "%s" -d "%s"' % (extjs_path, ex_path))
+
+package_dir = './src/hurry/extjs/'
+dest_path = os.path.join(package_dir, 'extjs-build')
+
+# remove previous ExtJS
+shutil.rmtree(dest_path, ignore_errors=True)
+
+build_path = os.path.join(ex_path, 'ext-%s' % EXTJS_VERSION)
+shutil.copytree(build_path, dest_path)
+
+shutil.rmtree(dirpath, ignore_errors=True)
+
+def read(*rnames):
+    return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
+
+long_description = (
+    read('README.txt')
+    + '\n' +
+    read('CHANGES.txt')
+    + '\n' +
+    'Download\n'
+    '********\n'
+    )
+
+setup(
+    name='hurry.extjs',
+    version=EXTJS_VERSION,
+    description="ExtJS for hurry.resource.",
+    long_description=long_description,
+    classifiers=[],
+    keywords='',
+    author='Santiago Videla',
+    author_email='santiago.videla at gmail.com',
+    license='ZPL 2.1',
+    packages=find_packages('src'),
+    package_dir={'': 'src'},
+    namespace_packages=['hurry'],
+    include_package_data=True,
+    zip_safe=False,
+    install_requires=[
+        'setuptools',
+        'hurry.resource',
+        ],
+    entry_points= {
+    },
+
+    )

Added: hurry.extjs/trunk/src/hurry/__init__.py
===================================================================
--- hurry.extjs/trunk/src/hurry/__init__.py	                        (rev 0)
+++ hurry.extjs/trunk/src/hurry/__init__.py	2009-05-04 19:00:21 UTC (rev 99737)
@@ -0,0 +1,7 @@
+# this is a namespace package
+try:
+    import pkg_resources
+    pkg_resources.declare_namespace(__name__)
+except ImportError:
+    import pkgutil
+    __path__ = pkgutil.extend_path(__path__, __name__)

Added: hurry.extjs/trunk/src/hurry/extjs/__init__.py
===================================================================
--- hurry.extjs/trunk/src/hurry/extjs/__init__.py	                        (rev 0)
+++ hurry.extjs/trunk/src/hurry/extjs/__init__.py	2009-05-04 19:00:21 UTC (rev 99737)
@@ -0,0 +1 @@
+from hurry.extjs.extjs import *

Added: hurry.extjs/trunk/src/hurry/extjs/basic.txt
===================================================================
--- hurry.extjs/trunk/src/hurry/extjs/basic.txt	                        (rev 0)
+++ hurry.extjs/trunk/src/hurry/extjs/basic.txt	2009-05-04 19:00:21 UTC (rev 99737)
@@ -0,0 +1,44 @@
+hurry.extjs basic tests
+=======================
+
+Here are some basic tests for hurry.extjs.
+
+Let's set up a way to render URLs; typically the framework has already
+done this::
+
+  >>> def get_library_url(library):
+  ...    return 'http://localhost/static/%s' % (
+  ...      library.name)
+  >>> from hurry.resource import Library
+  >>> from hurry.resource.interfaces import ILibraryUrl
+  >>> from zope import component
+  >>> component.provideAdapter(
+  ...     factory=get_library_url,
+  ...     adapts=(Library,),
+  ...     provides=ILibraryUrl)
+
+
+Let's check the ExtJS libraries. First we just include the default styles::
+
+  >>> from hurry import extjs
+  >>> from hurry.resource import NeededInclusions
+  >>> needed = NeededInclusions()
+  >>> needed.need(extjs.extjs_css)
+  >>> print needed.render()
+  <link rel="stylesheet" type="text/css" href="http://localhost/static/extjs/resources/css/ext-all.css" />
+
+Now, we will include all the ExtJS framework
+
+  >>> needed.need(extjs.extjs_all)
+  >>> print needed.render()
+  <link rel="stylesheet" type="text/css" href="http://localhost/static/extjs/resources/css/ext-all.css" />
+  <script type="text/javascript" src="http://localhost/static/extjs/ext-base.js"></script>
+  <script type="text/javascript" src="http://localhost/static/extjs/ext-all.js"></script>
+
+  >>> needed.mode('debug')
+  >>> print needed.render()
+  <link rel="stylesheet" type="text/css" href="http://localhost/static/extjs/resources/css/ext-all.css" />
+  <script type="text/javascript" src="http://localhost/static/extjs/ext-base-debug.js"></script>
+  <script type="text/javascript" src="http://localhost/static/extjs/ext-all-debug.js"></script>
+
+

Added: hurry.extjs/trunk/src/hurry/extjs/configure.zcml
===================================================================
--- hurry.extjs/trunk/src/hurry/extjs/configure.zcml	                        (rev 0)
+++ hurry.extjs/trunk/src/hurry/extjs/configure.zcml	2009-05-04 19:00:21 UTC (rev 99737)
@@ -0,0 +1,9 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           xmlns:browser="http://namespaces.zope.org/browser">
+  <include package="hurry.zoperesource" />
+
+  <browser:resourceDirectory 
+      name="extjs"
+      directory="extjs-build" />
+
+</configure>

Added: hurry.extjs/trunk/src/hurry/extjs/extjs.py
===================================================================
--- hurry.extjs/trunk/src/hurry/extjs/extjs.py	                        (rev 0)
+++ hurry.extjs/trunk/src/hurry/extjs/extjs.py	2009-05-04 19:00:21 UTC (rev 99737)
@@ -0,0 +1,11 @@
+from hurry.resource import Library, ResourceInclusion
+
+extjs = Library('extjs')
+
+extjs_base = ResourceInclusion(extjs, 'ext-base.js',
+                               debug='ext-base-debug.js')
+
+extjs_all = ResourceInclusion(extjs, 'ext-all.js', depends=[extjs_base],
+                              debug='ext-all-debug.js')
+
+extjs_css = ResourceInclusion(extjs, 'resources/css/ext-all.css')

Added: hurry.extjs/trunk/src/hurry/extjs/tests.py
===================================================================
--- hurry.extjs/trunk/src/hurry/extjs/tests.py	                        (rev 0)
+++ hurry.extjs/trunk/src/hurry/extjs/tests.py	2009-05-04 19:00:21 UTC (rev 99737)
@@ -0,0 +1,14 @@
+import unittest, doctest
+
+def test_suite():
+    globs = {}
+    optionflags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS
+
+    suite = unittest.TestSuite()
+    
+    suite.addTest(doctest.DocFileSuite(
+        'basic.txt',
+        globs=globs,
+        optionflags=optionflags))
+    return suite
+



More information about the Checkins mailing list