summaryrefslogtreecommitdiff
path: root/xstatic
diff options
context:
space:
mode:
authorThomas Waldmann <tw AT waldmann-edv DOT de@localhost>2011-07-09 21:24:02 +0200
committerThomas Waldmann <tw AT waldmann-edv DOT de@localhost>2011-07-09 21:24:02 +0200
commitfb43a4b255d981d6f725082d8becc195b9096512 (patch)
tree1fe3479c0bda3861c76762d3011c91043d3e0bcc /xstatic
parent140a77d325c4dfb32aefc360d8bd7180c5eb9098 (diff)
downloadxstatic-jquery-git-fb43a4b255d981d6f725082d8becc195b9096512.tar.gz
adapt XStatic-jQuery for XStatic >= 0.0.2
Diffstat (limited to 'xstatic')
-rw-r--r--xstatic/pkg/jquery/__init__.py106
1 files changed, 51 insertions, 55 deletions
diff --git a/xstatic/pkg/jquery/__init__.py b/xstatic/pkg/jquery/__init__.py
index a963d08..3fe984b 100644
--- a/xstatic/pkg/jquery/__init__.py
+++ b/xstatic/pkg/jquery/__init__.py
@@ -1,68 +1,64 @@
"""
-jQuery package
+XStatic resource package
+
+See package 'XStatic' for documentation and basic tools.
"""
-from os.path import join, dirname
+DISPLAY_NAME = 'jQuery' # official name, upper/lowercase allowed, no spaces
+PACKAGE_NAME = 'XStatic-%s' % DISPLAY_NAME # name used for PyPi
-try:
- from xstatic.main import XStatic
-except ImportError:
- class XStatic(object):
- """
- just a dummy for the time when setup.py is running and
- for the case that xstatic is not already installed.
- """
+NAME = __name__.split('.')[-1] # package name (e.g. 'foo' or 'foo_bar')
+ # please use a all-lowercase valid python
+ # package name
-class JQuery(XStatic):
- name = 'jquery' # short, all lowercase name
- display_name = 'jQuery' # official name, upper/lowercase allowed
- version = '1.6.1.3' # for simplicity, use same version x.y.z as bundled files
- # additionally we append .b for our build number, so we
- # can release new builds with fixes for xstatic stuff.
+VERSION = '1.6.1' # version of the packaged files, please use the upstream
+ # version number
+BUILD = '4' # our package build number, so we can release new builds
+ # with fixes for xstatic stuff.
+PACKAGE_VERSION = VERSION + '.' + BUILD # version used for PyPi
- base_dir = join(dirname(__file__), 'data')
- # linux package maintainers just can point to their file locations like this:
- # base_dir = '/usr/share/javascript/jquery'
+DESCRIPTION = "%s %s (XStatic packaging standard)" % (DISPLAY_NAME, VERSION)
- description = "%s (XStatic packaging standard)" % display_name
+PLATFORMS = 'any'
+CLASSIFIERS = []
+KEYWORDS = '%s xstatic' % NAME
- platforms = 'any'
- classifiers = []
- keywords = '%s xstatic' % name
+# XStatic-* package maintainer:
+MAINTAINER = 'Thomas Waldmann'
+MAINTAINER_EMAIL = 'tw@waldmann-edv.de'
- # this all refers to the XStatic-* package:
- author = 'Thomas Waldmann'
- author_email = 'tw@waldmann-edv.de'
- # XXX shall we have another bunch of entries for the bundled files?
- # like upstream_author/homepage/download/...?
- # note: distutils/register can't handle author and maintainer at once.
+# this refers to the project homepage of the stuff we packaged:
+HOMEPAGE = 'http://jquery.com/'
- # this refers to the project homepage of the stuff we packaged:
- homepage = 'http://jquery.com/'
+# this refers to all files:
+LICENSE = '(same as %s)' % DISPLAY_NAME
- # this refers to all files:
- license = '(same as %s)' % display_name
+from os.path import join, dirname
+BASE_DIR = join(dirname(__file__), 'data')
+# linux package maintainers just can point to their file locations like this:
+#BASE_DIR = '/usr/share/javascript/jquery'
- locations = {
- # if value is a string, it is a base location, just append relative
- # path/filename. if value is a dict, do another lookup using the
- # relative path/filename you want.
- # your relative path/filenames should usually be without version
- # information, because either the base dir/url is exactly for this
- # version or the mapping will care for accessing this version.
- ('google', 'http'): 'http://ajax.googleapis.com/ajax/libs/jquery/%s' % version,
- ('google', 'https'): 'https://ajax.googleapis.com/ajax/libs/jquery/%s' % version,
- ('jquery', 'http'): {
- 'jquery.js': 'http://code.jquery.com/jquery-%s.js' % version,
- 'jquery.min.js': 'http://code.jquery.com/jquery-%s.min.js' % version,
- },
- ('microsoft', 'http'): {
- 'jquery.js': 'http://ajax.aspnetcdn.com/ajax/jquery/jquery-%s.js' % version,
- 'jquery.min.js': 'http://ajax.aspnetcdn.com/ajax/jquery/jquery-%s.min.js' % version,
- },
- ('microsoft', 'https'): {
- 'jquery.js': 'https://ajax.aspnetcdn.com/ajax/jquery/jquery-%s.js' % version,
- 'jquery.min.js': 'https://ajax.aspnetcdn.com/ajax/jquery/jquery-%s.min.js' % version,
- },
- }
+LOCATIONS = {
+ # CDN locations (if no public CDN exists, use an empty dict)
+ # if value is a string, it is a base location, just append relative
+ # path/filename. if value is a dict, do another lookup using the
+ # relative path/filename you want.
+ # your relative path/filenames should usually be without version
+ # information, because either the base dir/url is exactly for this
+ # version or the mapping will care for accessing this version.
+ ('google', 'http'): 'http://ajax.googleapis.com/ajax/libs/jquery/%s' % VERSION,
+ ('google', 'https'): 'https://ajax.googleapis.com/ajax/libs/jquery/%s' % VERSION,
+ ('jquery', 'http'): {
+ 'jquery.js': 'http://code.jquery.com/jquery-%s.js' % VERSION,
+ 'jquery.min.js': 'http://code.jquery.com/jquery-%s.min.js' % VERSION,
+ },
+ ('microsoft', 'http'): {
+ 'jquery.js': 'http://ajax.aspnetcdn.com/ajax/jquery/jquery-%s.js' % VERSION,
+ 'jquery.min.js': 'http://ajax.aspnetcdn.com/ajax/jquery/jquery-%s.min.js' % VERSION,
+ },
+ ('microsoft', 'https'): {
+ 'jquery.js': 'https://ajax.aspnetcdn.com/ajax/jquery/jquery-%s.js' % VERSION,
+ 'jquery.min.js': 'https://ajax.aspnetcdn.com/ajax/jquery/jquery-%s.min.js' % VERSION,
+ },
+}