<commit_before>"""
Sijax
=====

Sijax stands for "Simple ajax" and provides just that.
It's a simple Python/jQuery library providing easy ajax integration for python web apps.

The main idea is to use javascript code that calls server-side callbacks, which generate a response (manipulating the DOM, etc) and pass it back to the client.
This way, you don't need to manually dispatch ajax requests to certain URIs and go over each XML/JSON response manually.

Here's a tiny snippet of code to show what it's capable of doing::

    # Function definition in Python
    def say_hello_handler(obj_response, hello_from, hello_to):
        obj_response.alert("Hello from %s to %s" % (hello_from, hello_to))
        obj_response.alert("Redirecting you..")
        obj_response.redirect("https://github.com/spantaleev/sijax-python")

    # Expose the above function publicly by the name of "say_hello"
    sijax_instance.register_callback("say_hello", say_hello_handler)

    //The above function can be called from javascript using
    Sijax.request('say_hello', ['John', 'Greg']);

Links
-----

* `source <https://github.com/spantaleev/sijax-python>`_
* `documentation <http://packages.python.org/Sijax>`_
"""

from setuptools import setup, find_packages

import sijax


def run_tests():
    import os, sys
    sys.path.append(os.path.join(os.path.dirname(__file__), 'tests'))
    from sijax_tests import suite
    return suite()


setup(
    name = "Sijax",
    packages = find_packages(),
    include_package_data = True,
    version = sijax.__version__,
    description = "An easy to use AJAX library based on jQuery.ajax",
    long_description = __doc__,
    author = "<NAME>",
    author_email = "<EMAIL>",
    url = "https://github.com/spantaleev/sijax-python",
    keywords = ["ajax", "jQuery"],
    platforms = "any",
    license = "BSD",
    zip_safe = False,
    classifiers = [
        "Programming Language :: Python",
        "Development Status :: 4 - Beta",
        "Environment :: Web Environment",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: BSD License",
        "Operating System :: OS Independent",
        "Topic :: Internet :: WWW/HTTP :: Dynamic Content",
        "Topic :: Software Development :: Libraries :: Python Modules",
    ],
    test_suite='__main__.run_tests'
)<commit_msg>Install simplejson if needed (Python < 2.6)<commit_after>"""
Sijax
=====

Sijax stands for "Simple ajax" and provides just that.
It's a simple Python/jQuery library providing easy ajax integration for python web apps.

The main idea is to use javascript code that calls server-side callbacks, which generate a response (manipulating the DOM, etc) and pass it back to the client.
This way, you don't need to manually dispatch ajax requests to certain URIs and go over each XML/JSON response manually.

Here's a tiny snippet of code to show what it's capable of doing::

    # Function definition in Python
    def say_hello_handler(obj_response, hello_from, hello_to):
        obj_response.alert("Hello from %s to %s" % (hello_from, hello_to))
        obj_response.alert("Redirecting you..")
        obj_response.redirect("https://github.com/spantaleev/sijax-python")

    # Expose the above function publicly by the name of "say_hello"
    sijax_instance.register_callback("say_hello", say_hello_handler)

    //The above function can be called from javascript using
    Sijax.request('say_hello', ['John', 'Greg']);

Links
-----

* `source <https://github.com/spantaleev/sijax-python>`_
* `documentation <http://packages.python.org/Sijax>`_
"""

import sys
from setuptools import setup, find_packages
import sijax

def run_tests():
    import os
    sys.path.append(os.path.join(os.path.dirname(__file__), 'tests'))
    from sijax_tests import suite
    return suite()

requirements = []
if sys.version_info[:2] < (2, 6):
    requirements.append('simplejson')

setup(
    name = "Sijax",
    packages = find_packages(),
    include_package_data = True,
    version = sijax.__version__,
    description = "An easy to use AJAX library based on jQuery.ajax",
    long_description = __doc__,
    author = "<NAME>",
    author_email = "<EMAIL>",
    url = "https://github.com/spantaleev/sijax-python",
    keywords = ["ajax", "jQuery"],
    platforms = "any",
    license = "BSD",
    zip_safe = False,
    install_requires = requirements,
    classifiers = [
        "Programming Language :: Python",
        "Development Status :: 5 - Production/Stable",
        "Environment :: Web Environment",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: BSD License",
        "Operating System :: OS Independent",
        "Topic :: Internet :: WWW/HTTP :: Dynamic Content",
        "Topic :: Software Development :: Libraries :: Python Modules",
    ],
    test_suite='__main__.run_tests'
)
{'fraction_non_alphanumeric': 0.11576557985967809, 'fraction_numerical': 0.0014444903012794056, 'mean_word_length': 3.521455223880597, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4162903', 'n_tokens_mistral': 1463, 'n_tokens_neox': 1394, 'n_words': 458}