2011-02-01 17:33:31 +03:00
|
|
|
import urllib
|
2011-03-22 22:28:55 +03:00
|
|
|
import os
|
2011-02-01 17:33:31 +03:00
|
|
|
|
|
|
|
|
2012-09-11 22:03:57 +04:00
|
|
|
def process(url, destination):
|
|
|
|
destination = "jslibs/%s" % destination
|
|
|
|
|
|
|
|
if os.path.exists(destination):
|
|
|
|
return
|
|
|
|
|
|
|
|
try:
|
|
|
|
print url
|
|
|
|
urllib.urlretrieve(url, destination)
|
|
|
|
except Exception:
|
|
|
|
print "Failed"
|
|
|
|
|
|
|
|
|
|
|
|
def get_pattern(prefix, url_pattern, versions):
|
2011-02-01 17:33:31 +03:00
|
|
|
for version in versions:
|
|
|
|
url = url_pattern % version
|
2012-09-11 22:03:57 +04:00
|
|
|
process(url, "%s.%s.%s" % (prefix, version, url.split("/")[-1]))
|
|
|
|
|
2011-03-22 22:28:55 +03:00
|
|
|
|
2012-09-11 22:03:57 +04:00
|
|
|
process("https://addons.cdn.mozilla.net/en-US/firefox/files/browse/149703/"
|
|
|
|
"file-serve/bootstrap.js?token=e9d0767e-643c-48ad-b09e-fc075ca60b77",
|
|
|
|
"PersonasInteractive_bootstrap.js")
|
2011-03-22 22:28:55 +03:00
|
|
|
|
2011-02-01 17:33:31 +03:00
|
|
|
|
|
|
|
DOJO_VERSIONS = ("1.1.1", "1.2.0", "1.2.3", "1.3.0", "1.3.1", "1.3.2", "1.4.0",
|
2012-08-31 01:59:26 +04:00
|
|
|
"1.4.1", "1.4.3", "1.5", "1.5.1", "1.6", "1.6.1", "1.7.0",
|
|
|
|
"1.7.1", "1.7.2", "1.7.3", "1.8.0")
|
2011-11-30 08:39:12 +04:00
|
|
|
# Google doesn't yet host EXT4.*
|
2011-02-01 17:33:31 +03:00
|
|
|
EXT_VERSIONS = ("3.0.0", "3.1.0")
|
|
|
|
JQUERY_CODE_VERSIONS = ("1.0.pack", "1.0.1.pack", "1.0.1", "1.0.2.pack",
|
|
|
|
"1.0.2", "1.0.3.pack", "1.0.3", "1.0.4.pack", "1.0.4",
|
|
|
|
"1.1.pack", "1.1", "1.1.1.pack", "1.1.1", "1.1.2.pack",
|
2011-11-30 08:39:12 +04:00
|
|
|
"1.1.2", "1.1.3.pack", "1.4.min", "1.4", "1.4.1.min",
|
|
|
|
"1.4.1", "1.4.2.min", "1.4.2", "1.4.3.min", "1.4.4",
|
|
|
|
"1.5.min", "1.5", "1.5.1.min", "1.5.1", "1.5.2.min",
|
|
|
|
"1.5.2", "1.6.min", "1.6", "1.6.1.min", "1.6.1",
|
|
|
|
"1.6.2.min", "1.6.2", "1.6.3.min", "1.6.3",
|
|
|
|
"1.6.4.min", "1.6.4", "1.7.min", "1.7", "1.7.1.min",
|
2012-10-19 23:02:51 +04:00
|
|
|
"1.7.1", "1.7.2.min", "1.7.2", "1.8.0.min", "1.8.0",
|
|
|
|
"1.8.1.min", "1.8.1", "1.8.2.min", "1.8.2" )
|
2011-02-01 17:33:31 +03:00
|
|
|
JQUERY_GCODE_VERSIONS = ("1.1.3", "1.1.3.1.pack", "1.1.3.1", "1.1.4.pack",
|
2011-11-30 08:39:12 +04:00
|
|
|
"1.1.4", "1.2.min", "1.2.pack", "1.2", "1.2.1.min",
|
|
|
|
"1.2.1.pack", "1.2.1", "1.2.2.pack", "1.2.2.min",
|
|
|
|
"1.2.2", "1.2.3.pack", "1.2.3.min", "1.2.3",
|
|
|
|
"1.2.4.min", "1.2.4.pack", "1.2.4", "1.2.5.min",
|
|
|
|
"1.2.5.pack", "1.2.5", "1.2.6.min", "1.2.6.pack",
|
|
|
|
"1.2.6", "1.3.min", "1.3", "1.3.1.min", "1.3.1",
|
|
|
|
"1.3.2.min", "1.3.2")
|
2011-02-01 17:33:31 +03:00
|
|
|
JQUERYUI_VERSIONS = ("1.5.2", "1.5.3", "1.6.0", "1.7.0", "1.7.1", "1.7.2",
|
|
|
|
"1.7.3", "1.8.0", "1.8.1", "1.8.2", "1.8.4", "1.8.5",
|
2011-05-21 01:47:48 +04:00
|
|
|
"1.8.6", "1.8.7", "1.8.8", "1.8.9", "1.8.10", "1.8.11",
|
2012-07-03 22:50:20 +04:00
|
|
|
"1.8.12", "1.8.13", "1.8.14", "1.8.15", "1.8.16", "1.8.17",
|
2012-08-31 01:59:26 +04:00
|
|
|
"1.8.18", "1.8.19", "1.8.20", "1.8.21", "1.8.22", "1.8.23")
|
2011-02-01 17:33:31 +03:00
|
|
|
MOOTOOLS_VERSIONS = ("1.1.1", "1.1.2", "1.2.1", "1.2.2", "1.2.3", "1.2.4",
|
2012-08-31 01:59:26 +04:00
|
|
|
"1.2.5", "1.3.0", "1.3.1", "1.3.2", "1.4.0", "1.4.1",
|
|
|
|
"1.4.2", "1.4.3", "1.4.4", "1.4.5")
|
|
|
|
PROTOTYPE_VERSIONS = ("1.6.0.2", "1.6.0.3", "1.6.1.0", "1.7.0.0", "1.7.1.0")
|
2011-05-21 01:47:48 +04:00
|
|
|
SCRIPTACULOUS_VERSIONS = ("1.8.1", "1.8.2", "1.8.3", "1.9.0")
|
2011-02-01 17:33:31 +03:00
|
|
|
SWFOBJECT_VERSIONS = ("2.1", "2.2")
|
2012-04-16 21:56:16 +04:00
|
|
|
UNDERSCORE_VERSIONS = ("1.3.3", "1.3.2", "1.3.1", "1.3.0", "1.2.4", "1.2.3",
|
|
|
|
"1.2.2", "1.2.1", "1.2.0", "1.1.7", "1.1.6", "1.1.5",
|
|
|
|
"1.1.4", "1.1.3", "1.1.2", "1.1.1", "1.1.0", "1.0.4",
|
|
|
|
"1.0.3", "1.0.2", "1.0.1", "1.0.0")
|
2011-11-30 08:39:12 +04:00
|
|
|
YUI_VERSIONS = ("2.6.0", "2.7.0", "2.8.0r4", "2.8.1", "2.8.2", "2.9.0")
|
2012-08-31 01:59:26 +04:00
|
|
|
YUI_NEW_VERSIONS = ("3.3.0", "3.4.0", "3.4.1", "3.5.0", "3.5.1", "3.6.0")
|
2011-02-01 17:33:31 +03:00
|
|
|
|
|
|
|
|
|
|
|
get_pattern("dojo",
|
|
|
|
"https://ajax.googleapis.com/ajax/libs/dojo/%s/dojo/dojo.xd.js",
|
|
|
|
DOJO_VERSIONS)
|
|
|
|
get_pattern("dojo",
|
|
|
|
"https://ajax.googleapis.com/ajax/libs/dojo/%s/dojo/dojo.xd.js.uncompressed.js",
|
|
|
|
DOJO_VERSIONS)
|
|
|
|
DOJO_V = lambda v:"http://download.dojotoolkit.org/" \
|
|
|
|
"release-%s/dojo-release-%s/release/dojo-release-%s/" \
|
|
|
|
"dojo/%%s" % (v, v, v)
|
|
|
|
urllib.urlretrieve(DOJO_V("1.0.3") % "dojo.js",
|
|
|
|
"jslibs/dojo.1.0.3.js")
|
|
|
|
urllib.urlretrieve(DOJO_V("1.0.3") % "dojo.js.uncompressed.js",
|
|
|
|
"jslibs/dojo.uncompressed.1.0.3.js")
|
|
|
|
|
|
|
|
urllib.urlretrieve(DOJO_V("1.1.2") % "dojo.js",
|
|
|
|
"jslibs/dojo.1.1.2.js")
|
|
|
|
urllib.urlretrieve(DOJO_V("1.1.2") % "dojo.js.uncompressed.js",
|
|
|
|
"jslibs/dojo.uncompressed.1.1.2.js")
|
|
|
|
|
|
|
|
urllib.urlretrieve(DOJO_V("1.2.4") % "dojo.js",
|
|
|
|
"jslibs/dojo.1.2.4.js")
|
|
|
|
urllib.urlretrieve(DOJO_V("1.2.4") % "dojo.js.uncompressed.js",
|
|
|
|
"jslibs/dojo.uncompressed.1.2.4.js")
|
|
|
|
|
|
|
|
urllib.urlretrieve(DOJO_V("1.3.3") % "dojo.js",
|
|
|
|
"jslibs/dojo.1.3.3.js")
|
|
|
|
urllib.urlretrieve(DOJO_V("1.3.3") % "dojo.js.uncompressed.js",
|
|
|
|
"jslibs/dojo.uncompressed.1.3.3.js")
|
|
|
|
|
2011-11-30 08:39:12 +04:00
|
|
|
# EXT.js
|
2011-02-01 17:33:31 +03:00
|
|
|
get_pattern("ext-core",
|
|
|
|
"https://ajax.googleapis.com/ajax/libs/ext-core/%s/ext-core.js",
|
|
|
|
EXT_VERSIONS)
|
|
|
|
get_pattern("ext-debug",
|
2011-11-30 08:39:12 +04:00
|
|
|
"https://ajax.googleapis.com/ajax/libs/ext-core/%s/ext-core-debug.js",
|
2011-02-01 17:33:31 +03:00
|
|
|
EXT_VERSIONS)
|
2011-11-30 08:39:12 +04:00
|
|
|
|
|
|
|
# jQuery
|
2011-02-01 17:33:31 +03:00
|
|
|
get_pattern("jquery",
|
|
|
|
"http://code.jquery.com/jquery-%s.js",
|
|
|
|
JQUERY_CODE_VERSIONS)
|
|
|
|
get_pattern("jquery",
|
|
|
|
"http://jqueryjs.googlecode.com/files/jquery-%s.js",
|
|
|
|
JQUERY_GCODE_VERSIONS)
|
2011-11-30 08:39:12 +04:00
|
|
|
|
|
|
|
# jQueryUI
|
2011-02-01 17:33:31 +03:00
|
|
|
get_pattern("jqueryui",
|
|
|
|
"https://ajax.googleapis.com/ajax/libs/jqueryui/%s/jquery-ui.min.js",
|
|
|
|
JQUERYUI_VERSIONS)
|
|
|
|
get_pattern("jqueryui",
|
|
|
|
"https://ajax.googleapis.com/ajax/libs/jqueryui/%s/jquery-ui.js",
|
|
|
|
JQUERYUI_VERSIONS)
|
|
|
|
|
2011-11-30 08:39:12 +04:00
|
|
|
# MooTools
|
2011-02-01 17:33:31 +03:00
|
|
|
get_pattern("mootools",
|
|
|
|
"https://ajax.googleapis.com/ajax/libs/mootools/%s/mootools-yui-compressed.js",
|
|
|
|
MOOTOOLS_VERSIONS)
|
|
|
|
get_pattern("mootools",
|
|
|
|
"https://ajax.googleapis.com/ajax/libs/mootools/%s/mootools.js",
|
|
|
|
MOOTOOLS_VERSIONS)
|
|
|
|
|
2011-11-30 08:39:12 +04:00
|
|
|
# Prototype.js
|
2011-02-01 17:33:31 +03:00
|
|
|
get_pattern("prototype",
|
|
|
|
"https://ajax.googleapis.com/ajax/libs/prototype/%s/prototype.js",
|
|
|
|
PROTOTYPE_VERSIONS)
|
2011-11-30 08:39:12 +04:00
|
|
|
|
|
|
|
# Scriptaculous
|
2011-02-01 17:33:31 +03:00
|
|
|
get_pattern("scriptaculous",
|
|
|
|
"https://ajax.googleapis.com/ajax/libs/scriptaculous/%s/scriptaculous.js",
|
|
|
|
SCRIPTACULOUS_VERSIONS)
|
|
|
|
|
2011-11-30 08:39:12 +04:00
|
|
|
# SWFObject
|
2011-02-01 17:33:31 +03:00
|
|
|
get_pattern("swfobject",
|
|
|
|
"https://ajax.googleapis.com/ajax/libs/swfobject/%s/swfobject.js",
|
|
|
|
SWFOBJECT_VERSIONS)
|
|
|
|
get_pattern("swfobject",
|
|
|
|
"https://ajax.googleapis.com/ajax/libs/swfobject/%s/swfobject_src.js",
|
|
|
|
SWFOBJECT_VERSIONS)
|
|
|
|
|
2012-04-16 21:56:16 +04:00
|
|
|
# Underscore
|
|
|
|
get_pattern("underscore",
|
|
|
|
"https://raw.github.com/documentcloud/underscore/%s/underscore.js",
|
|
|
|
UNDERSCORE_VERSIONS)
|
|
|
|
get_pattern("underscore",
|
|
|
|
"https://raw.github.com/documentcloud/underscore/%s/underscore-min.js",
|
|
|
|
UNDERSCORE_VERSIONS)
|
|
|
|
|
2011-11-30 08:39:12 +04:00
|
|
|
# Old-style YUI loader libraries:
|
2011-02-01 17:33:31 +03:00
|
|
|
get_pattern("yui",
|
2012-08-31 01:59:26 +04:00
|
|
|
"http://yui.yahooapis.com/%s/build/yuiloader/yuiloader-min.js",
|
2011-02-01 17:33:31 +03:00
|
|
|
YUI_VERSIONS)
|
|
|
|
get_pattern("yui",
|
2012-08-31 01:59:26 +04:00
|
|
|
"http://yui.yahooapis.com/%s/build/yuiloader/yuiloader.js",
|
2011-02-01 17:33:31 +03:00
|
|
|
YUI_VERSIONS)
|
2011-11-30 08:39:12 +04:00
|
|
|
|
|
|
|
# New-style YUI libraries
|
|
|
|
get_pattern("yui",
|
2012-08-31 01:59:26 +04:00
|
|
|
"http://yui.yahooapis.com/%s/build/yui-base/yui-base-min.js",
|
2011-11-30 08:39:12 +04:00
|
|
|
YUI_NEW_VERSIONS)
|
|
|
|
get_pattern("yui",
|
2012-08-31 01:59:26 +04:00
|
|
|
"http://yui.yahooapis.com/%s/build/yui-base/yui-base.js",
|
2011-11-30 08:39:12 +04:00
|
|
|
YUI_NEW_VERSIONS)
|