[Checkins] SVN: hurry.zopeyui/trunk/ Functionality moved into hurry.yui.
Martijn Faassen
faassen at infrae.com
Thu Oct 9 13:52:05 EDT 2008
Log message for revision 91927:
Functionality moved into hurry.yui.
Changed:
D hurry.zopeyui/trunk/MANIFEST.in
U hurry.zopeyui/trunk/setup.py
U hurry.zopeyui/trunk/src/hurry/zopeyui/configure.zcml
D hurry.zopeyui/trunk/yuidl.py
-=-
Deleted: hurry.zopeyui/trunk/MANIFEST.in
===================================================================
--- hurry.zopeyui/trunk/MANIFEST.in 2008-10-09 17:36:19 UTC (rev 91926)
+++ hurry.zopeyui/trunk/MANIFEST.in 2008-10-09 17:52:04 UTC (rev 91927)
@@ -1 +0,0 @@
-recursive-include src/hurry/zopeyui/yui-build *
Modified: hurry.zopeyui/trunk/setup.py
===================================================================
--- hurry.zopeyui/trunk/setup.py 2008-10-09 17:36:19 UTC (rev 91926)
+++ hurry.zopeyui/trunk/setup.py 2008-10-09 17:52:04 UTC (rev 91927)
@@ -1,22 +1,5 @@
from setuptools import setup, find_packages
-import sys, os, shutil
-import yuidl
-YUI_VERSION = '2.6.0'
-
-package_dir = os.path.dirname(__file__)
-yui_dest_path = os.path.join(package_dir, 'src', 'hurry', 'zopeyui',
- 'yui-build')
-
-def copy_yui(ex_path):
- """Copy YUI to location 'yui-build' in package."""
- yui_build_path = os.path.join(ex_path, 'yui', 'build')
- shutil.copytree(yui_build_path, yui_dest_path)
-
-# only re-download if path doesn't exist
-if not os.path.exists(yui_dest_path):
- yuidl.download(YUI_VERSION, copy_yui)
-
setup(
name='hurry.zopeyui',
version='0.1dev',
Modified: hurry.zopeyui/trunk/src/hurry/zopeyui/configure.zcml
===================================================================
--- hurry.zopeyui/trunk/src/hurry/zopeyui/configure.zcml 2008-10-09 17:36:19 UTC (rev 91926)
+++ hurry.zopeyui/trunk/src/hurry/zopeyui/configure.zcml 2008-10-09 17:52:04 UTC (rev 91927)
@@ -1,9 +1,11 @@
<configure xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser">
<include package="hurry.zoperesource" />
-
- <browser:resourceDirectory
- name="yui"
- directory="yui-build" />
+ <configure package="hurry.yui">
+ <browser:resourceDirectory
+ name="yui"
+ directory="yui-build" />
+ </configure>
+
</configure>
Deleted: hurry.zopeyui/trunk/yuidl.py
===================================================================
--- hurry.zopeyui/trunk/yuidl.py 2008-10-09 17:36:19 UTC (rev 91926)
+++ hurry.zopeyui/trunk/yuidl.py 2008-10-09 17:52:04 UTC (rev 91927)
@@ -1,45 +0,0 @@
-import urllib2
-import tempfile, shutil
-import os
-
-SF_URL_TEMPLATE = 'http://sourceforge.net/project/downloading.php?group_id=165715&filename=yui_%s.zip'
-
-def download(version, callback):
- """Download a yui of version.
-
- When downloaded, call callback with path to directory
- with an extracted YUI. The callback will then be able to copy
- this to the appropriate location.
- """
- url = SF_URL_TEMPLATE % version
- f = urllib2.urlopen(url)
- data = f.read()
- f.close()
-
- download_url = find_a_href(data, 'direct link')
-
- f = urllib2.urlopen(download_url)
- file_data = f.read()
- f.close()
-
- dirpath = tempfile.mkdtemp()
- try:
- yui_path = os.path.join(dirpath, 'yui.zip')
- ex_path = os.path.join(dirpath, 'yui_ex')
- g = open(yui_path, 'wb')
- g.write(file_data)
- g.close()
- os.system('unzip -qq "%s" -d "%s"' % (yui_path, ex_path))
- callback(ex_path)
- finally:
- shutil.rmtree(dirpath, ignore_errors=True)
-
-def find_a_href(data, content):
- """Given start of content of the <a href="">content</a> find href.
- """
- i = data.find(content)
- a = '<a href="'
- href_start = data.rfind(a, 0, i)
- href_start += len(a)
- href_end = data.find('"', href_start)
- return data[href_start:href_end]
More information about the Checkins
mailing list