Commits

Reimar Bauer committed bae11c8

adapt XStatic-svg-edit-moin for XStatic >= 0.0.2

Comments (0)

Files changed (3)

 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`.
 
-from setuptools import setup, find_packages
-
-from xstatic.pkg.svgedit_moin import SvgEdit as xs
+from xstatic.pkg import svgedit_moin 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.
 )

xstatic/pkg/svgedit_moin/__init__.py

 """
-svgedit_moin package
+XStatic resource package
+
+See package 'XStatic' for documentation and basic tools.
 """
 
+DISPLAY_NAME = 'svg-edit-moin' # official name, upper/lowercase allowed
+PACKAGE_NAME = 'XStatic-%s' % DISPLAY_NAME # name used for PyPi
+
+NAME = __name__.split('.')[-1] # package name (e.g. 'foo' or 'foo_bar')
+                               # please use a all-lowercase valid python
+                               # package name
+
+VERSION = '2011.07.07' # 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.
+BUILD = '2' # our package build number, so we can release new builds
+            # with fixes for xstatic stuff.
+
+PACKAGE_VERSION = VERSION + '.' + BUILD # version used for PyPi
+
+DESCRIPTION = "%s %s (XStatic packaging standard)" % (DISPLAY_NAME, VERSION)
+
+PLATFORMS = 'any'
+CLASSIFIERS = []
+KEYWORDS = '%s xstatic' % NAME
+
+# XStatic-* package maintainer:
+MAINTAINER = 'Reimar Bauer'
+MAINTAINER_EMAIL = 'rb.proj@googlemail.com'
+
+# this refers to the project homepage of the stuff we packaged:
+HOMEPAGE = 'http://code.google.com/p/svg-edit/'
+
+# 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/svg-edit
 
-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.
-        """
-
-class SvgEdit(XStatic):
-    name = 'svgedit_moin' # short, all lowercase name
-    display_name = 'svg-edit-moin' # official name, upper/lowercase allowed
-    version = '2011.07.07.1'     # 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.
-
-    base_dir = join(dirname(__file__), 'data')
-    # linux package maintainers just can point to their file locations like this:
-    # base_dir = '/usr/share/java/twikidraw-moin'
-
-    description = "%s (XStatic packaging standard)" % display_name
-
-    platforms = 'any'
-    classifiers = []
-    keywords = '%s xstatic' % name
-
-    # this all refers to the XStatic-* package:
-    author = 'Reimar Bauer'
-    author_email = 'rb.proj@googlemail.com'
-    # 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://code.google.com/p/svg-edit/'
-
-    # this refers to all files:
-    license = '(same as %s)' % display_name
-
-    locations = {}
-
+LOCATIONS = {}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.