summaryrefslogtreecommitdiff
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
parent140a77d325c4dfb32aefc360d8bd7180c5eb9098 (diff)
downloadxstatic-jquery-git-fb43a4b255d981d6f725082d8becc195b9096512.tar.gz
adapt XStatic-jQuery for XStatic >= 0.0.2
-rw-r--r--README.txt4
-rw-r--r--setup.py28
-rw-r--r--xstatic/pkg/jquery/__init__.py106
3 files changed, 67 insertions, 71 deletions
diff --git a/README.txt b/README.txt
index a3bc308..cb1b4d1 100644
--- a/README.txt
+++ b/README.txt
@@ -6,8 +6,8 @@ jQuery javascript library packaged for setuptools (easy_install) / pip.
This package is intended to be used by **any** project that needs these files.
It intentionally does **not** provide any extra code except some metadata
-**nor** has any extra requirements except the minimal support code in the
-XStatic base package.
+**nor** has any extra requirements. You MAY use some minimal support code from
+the XStatic base package, if you like.
You can find more info about the xstatic packaging way in the package `XStatic`.
diff --git a/setup.py b/setup.py
index 9829f90..bf9da86 100644
--- a/setup.py
+++ b/setup.py
@@ -1,27 +1,27 @@
-from setuptools import setup, find_packages
-
-from xstatic.pkg.jquery import JQuery as xs
+from xstatic.pkg import jquery as xs
# The README.txt file should be written in reST so that PyPI can use
# it to generate your project's PyPI page.
long_description = open('README.txt').read()
+from setuptools import setup, find_packages
setup(
- name='XStatic-' + xs.display_name,
- version=xs.version,
- description=xs.description,
+ name=xs.PACKAGE_NAME,
+ version=xs.PACKAGE_VERSION,
+ description=xs.DESCRIPTION,
long_description=long_description,
- classifiers=xs.classifiers,
- keywords=xs.keywords,
- author=xs.author,
- author_email=xs.author_email,
- license=xs.license,
- url=xs.homepage,
- platforms=xs.platforms,
+ classifiers=xs.CLASSIFIERS,
+ keywords=xs.KEYWORDS,
+ maintainer=xs.MAINTAINER,
+ maintainer_email=xs.MAINTAINER_EMAIL,
+ license=xs.LICENSE,
+ url=xs.HOMEPAGE,
+ platforms=xs.PLATFORMS,
packages=find_packages(),
namespace_packages=['xstatic', 'xstatic.pkg', ],
include_package_data=True,
zip_safe=False,
- install_requires=['XStatic==0.0.1'], # this is just a MINIMAL support code package
+ install_requires=[], # nothing! :)
+ # if you like, you MAY use the 'XStatic' package.
)
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,
+ },
+}