mirror of
https://github.com/sprockets/sprockets.handlers.redis_stats.git
synced 2024-11-27 19:29:52 +00:00
Initial commit
This commit is contained in:
commit
ed4fbdf1e4
20 changed files with 397 additions and 0 deletions
14
.editorconfig
Normal file
14
.editorconfig
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.py]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
|
[.travis.yml]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
59
.gitignore
vendored
Normal file
59
.gitignore
vendored
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
# Editor
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
|
||||||
|
# Byte-compiled / optimized / DLL files
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
|
||||||
|
# C extensions
|
||||||
|
*.so
|
||||||
|
|
||||||
|
# Distribution / packaging
|
||||||
|
.Python
|
||||||
|
env/
|
||||||
|
bin/
|
||||||
|
build/
|
||||||
|
develop-eggs/
|
||||||
|
dist/
|
||||||
|
eggs/
|
||||||
|
lib/
|
||||||
|
lib64/
|
||||||
|
parts/
|
||||||
|
sdist/
|
||||||
|
var/
|
||||||
|
*.egg-info/
|
||||||
|
.installed.cfg
|
||||||
|
*.egg
|
||||||
|
|
||||||
|
# Installer logs
|
||||||
|
pip-log.txt
|
||||||
|
pip-delete-this-directory.txt
|
||||||
|
|
||||||
|
# Unit test / coverage reports
|
||||||
|
htmlcov/
|
||||||
|
.tox/
|
||||||
|
.coverage
|
||||||
|
.cache
|
||||||
|
nosetests.xml
|
||||||
|
coverage.xml
|
||||||
|
|
||||||
|
# Translations
|
||||||
|
*.mo
|
||||||
|
|
||||||
|
# Mr Developer
|
||||||
|
.mr.developer.cfg
|
||||||
|
.project
|
||||||
|
.pydevproject
|
||||||
|
|
||||||
|
# Rope
|
||||||
|
.ropeproject
|
||||||
|
|
||||||
|
# Django stuff:
|
||||||
|
*.log
|
||||||
|
*.pot
|
||||||
|
|
||||||
|
# Sphinx documentation
|
||||||
|
docs/_build/
|
||||||
|
|
||||||
|
|
27
.travis.yml
Normal file
27
.travis.yml
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
%YAML 1.1
|
||||||
|
---
|
||||||
|
language: python
|
||||||
|
python:
|
||||||
|
- 2.6
|
||||||
|
- 2.7
|
||||||
|
- pypy
|
||||||
|
- 3.2
|
||||||
|
- 3.3
|
||||||
|
- 3.4
|
||||||
|
install:
|
||||||
|
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install unittest2; fi
|
||||||
|
- pip install -r test-requirements.txt
|
||||||
|
- pip install -e .
|
||||||
|
script: nosetests
|
||||||
|
after_success:
|
||||||
|
- coveralls
|
||||||
|
deploy:
|
||||||
|
distributions: sdist bdist_wheel
|
||||||
|
provider: pypi
|
||||||
|
on:
|
||||||
|
python: 2.7
|
||||||
|
tags: true
|
||||||
|
all_branches: true
|
||||||
|
user: sprockets
|
||||||
|
password:
|
||||||
|
secure: [REPLACE-ME]
|
25
LICENSE
Normal file
25
LICENSE
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
Copyright (c) 2014 AWeber Communications
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright notice, this
|
||||||
|
list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer in the documentation
|
||||||
|
and/or other materials provided with the distribution.
|
||||||
|
* Neither the name of Sprockets nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived from this
|
||||||
|
software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
|
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||||
|
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
|
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
7
MANIFEST.in
Normal file
7
MANIFEST.in
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
include LICENSE
|
||||||
|
include README.rst
|
||||||
|
include *requirements.txt
|
||||||
|
graft docs
|
||||||
|
graft tests.py
|
||||||
|
global-exclude __pycache__
|
||||||
|
global-exclude *.pyc
|
51
README.rst
Normal file
51
README.rst
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
sprockets.handlers.redis_stats
|
||||||
|
==============================
|
||||||
|
A Tornado handler dedicated to returning pertinent stats about your Redis database
|
||||||
|
|
||||||
|
|Version| |Downloads| |Status| |Coverage| |License|
|
||||||
|
|
||||||
|
Installation
|
||||||
|
------------
|
||||||
|
``sprockets.handlers.redis_stats`` is available on the
|
||||||
|
`Python Package Index <https://pypi.python.org/pypi/sprockets.handlers.redis_stats>`_
|
||||||
|
and can be installed via ``pip`` or ``easy_install``:
|
||||||
|
|
||||||
|
.. code:: bash
|
||||||
|
|
||||||
|
pip install sprockets.handlers.redis_stats
|
||||||
|
|
||||||
|
Documentation
|
||||||
|
-------------
|
||||||
|
https://sprocketshandlersredis_stats.readthedocs.org
|
||||||
|
|
||||||
|
Requirements
|
||||||
|
------------
|
||||||
|
- `sprockets <https://github.com/sprockets/sprockets>`_
|
||||||
|
|
||||||
|
Example
|
||||||
|
-------
|
||||||
|
This examples demonstrates how to use ``sprockets.handlers.redis_stats`` by ...
|
||||||
|
.. code:: python
|
||||||
|
|
||||||
|
from sprockets import handlers.redis_stats
|
||||||
|
|
||||||
|
# Example here
|
||||||
|
|
||||||
|
Version History
|
||||||
|
---------------
|
||||||
|
Available at https://sprocketshandlersredis_stats.readthedocs.org/en/latest/history.html
|
||||||
|
|
||||||
|
.. |Version| image:: https://badge.fury.io/py/sprockets.handlers.redis_stats.svg?
|
||||||
|
:target: http://badge.fury.io/py/sprockets.handlers.redis_stats
|
||||||
|
|
||||||
|
.. |Status| image:: https://travis-ci.org/sprockets/sprockets.handlers.redis_stats.svg?branch=master
|
||||||
|
:target: https://travis-ci.org/sprockets/sprockets.handlers.redis_stats
|
||||||
|
|
||||||
|
.. |Coverage| image:: https://img.shields.io/coveralls/sprockets/sprockets.handlers.redis_stats.svg?
|
||||||
|
:target: https://coveralls.io/r/sprockets/sprockets.handlers.redis_stats
|
||||||
|
|
||||||
|
.. |Downloads| image:: https://pypip.in/d/sprockets.handlers.redis_stats/badge.svg?
|
||||||
|
:target: https://pypi.python.org/pypi/sprockets.handlers.redis_stats
|
||||||
|
|
||||||
|
.. |License| image:: https://pypip.in/license/sprockets.handlers.redis_stats/badge.svg?
|
||||||
|
:target: https://sprocketshandlersredis_stats.readthedocs.org
|
6
dev-requirements.txt
Normal file
6
dev-requirements.txt
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
-r requirements.txt
|
||||||
|
-r test-requirements.txt
|
||||||
|
flake8>=2.1,<3
|
||||||
|
sphinx>=1.2,<2
|
||||||
|
sphinx-rtd-theme>=0.1,<1.0
|
||||||
|
sphinxcontrib-httpdomain>=1.2,<2
|
2
docs/api.rst
Normal file
2
docs/api.rst
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
.. automodule:: sprockets.handlers.redis_stats
|
||||||
|
:members:
|
29
docs/conf.py
Normal file
29
docs/conf.py
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
import sphinx_rtd_theme
|
||||||
|
|
||||||
|
from sprockets.handlers.redis_stats import version_info, __version__
|
||||||
|
|
||||||
|
needs_sphinx = '1.0'
|
||||||
|
extensions = [
|
||||||
|
'sphinx.ext.autodoc',
|
||||||
|
'sphinx.ext.intersphinx',
|
||||||
|
'sphinxcontrib.httpdomain',
|
||||||
|
]
|
||||||
|
templates_path = []
|
||||||
|
source_suffix = '.rst'
|
||||||
|
master_doc = 'index'
|
||||||
|
project = 'sprockets.handlers.redis_stats'
|
||||||
|
copyright = '2015, AWeber Communications'
|
||||||
|
version = '.'.join(__version__.split('.')[0:1])
|
||||||
|
release = __version__
|
||||||
|
if len(version_info) > 3:
|
||||||
|
release += '-{0}'.format(str(v) for v in version_info[3:])
|
||||||
|
exclude_patterns = []
|
||||||
|
pygments_style = 'sphinx'
|
||||||
|
html_theme = 'sphinx_rtd_theme'
|
||||||
|
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
|
||||||
|
intersphinx_mapping = {
|
||||||
|
'python': ('https://docs.python.org/', None),
|
||||||
|
'requests': ('https://requests.readthedocs.org/en/latest/', None),
|
||||||
|
'sprockets': ('https://sprockets.readthedocs.org/en/latest/', None),
|
||||||
|
}
|
10
docs/examples.rst
Normal file
10
docs/examples.rst
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
Examples
|
||||||
|
========
|
||||||
|
The following example ...
|
||||||
|
|
||||||
|
.. code:: python
|
||||||
|
|
||||||
|
from sprockets import handlers.redis_stats
|
||||||
|
|
||||||
|
class Foo(object):
|
||||||
|
pass
|
5
docs/history.rst
Normal file
5
docs/history.rst
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
Version History
|
||||||
|
---------------
|
||||||
|
- 0.0.0 [YYYY-MM-DD]
|
||||||
|
- Change 1
|
||||||
|
- Change 2
|
66
docs/index.rst
Normal file
66
docs/index.rst
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
sprockets.handlers.redis_stats
|
||||||
|
==============================
|
||||||
|
A Tornado handler dedicated to returning pertinent stats about your Redis database
|
||||||
|
|
||||||
|
|Version| |Downloads| |Status| |Coverage| |License|
|
||||||
|
|
||||||
|
Installation
|
||||||
|
------------
|
||||||
|
``sprockets.handlers.redis_stats`` is available on the
|
||||||
|
`Python Package Index <https://pypi.python.org/pypi/sprockets.handlers.redis_stats>`_
|
||||||
|
and can be installed via ``pip`` or ``easy_install``:
|
||||||
|
|
||||||
|
.. code:: bash
|
||||||
|
|
||||||
|
pip install sprockets.handlers.redis_stats
|
||||||
|
|
||||||
|
Requirements
|
||||||
|
------------
|
||||||
|
@TODO: Put full requirements list here, should match requirements.txt
|
||||||
|
- `sprockets <https://github.com/sprockets/sprockets>`_
|
||||||
|
|
||||||
|
API Documentation
|
||||||
|
-----------------
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
|
||||||
|
api
|
||||||
|
examples
|
||||||
|
|
||||||
|
Version History
|
||||||
|
---------------
|
||||||
|
See :doc:`history`
|
||||||
|
|
||||||
|
Issues
|
||||||
|
------
|
||||||
|
Please report any issues to the Github project at `https://github.com/sprockets/sprockets.handlers.redis_stats/issues <https://github.com/sprockets/sprockets.handlers.redis_stats/issues>`_
|
||||||
|
|
||||||
|
Source
|
||||||
|
------
|
||||||
|
``sprockets.handlers.redis_stats`` source is available on Github at `https://github.com/sprockets/sprockets.handlers.redis_stats <https://github.com/sprockets/sprockets.handlers.redis_stats>`_
|
||||||
|
|
||||||
|
License
|
||||||
|
-------
|
||||||
|
``sprockets.handlers.redis_stats`` is released under the `3-Clause BSD license <https://github.com/sprockets/sprockets.handlers.redis_stats/blob/master/LICENSE>`_.
|
||||||
|
|
||||||
|
Indices and tables
|
||||||
|
------------------
|
||||||
|
|
||||||
|
* :ref:`genindex`
|
||||||
|
* :ref:`modindex`
|
||||||
|
* :ref:`search`
|
||||||
|
|
||||||
|
.. |Version| image:: https://badge.fury.io/py/sprockets.handlers.redis_stats.svg?
|
||||||
|
:target: http://badge.fury.io/py/sprockets.handlers.redis_stats
|
||||||
|
|
||||||
|
.. |Status| image:: https://travis-ci.org/sprockets/sprockets.handlers.redis_stats.svg?branch=master
|
||||||
|
:target: https://travis-ci.org/sprockets/sprockets.handlers.redis_stats
|
||||||
|
|
||||||
|
.. |Coverage| image:: https://img.shields.io/coveralls/sprockets/sprockets.handlers.redis_stats.svg?
|
||||||
|
:target: https://coveralls.io/r/sprockets/sprockets.handlers.redis_stats
|
||||||
|
|
||||||
|
.. |Downloads| image:: https://pypip.in/d/sprockets.handlers.redis_stats/badge.svg?
|
||||||
|
:target: https://pypi.python.org/pypi/sprockets.handlers.redis_stats
|
||||||
|
|
||||||
|
.. |License| image:: https://pypip.in/license/sprockets.handlers.redis_stats/badge.svg?
|
||||||
|
:target: https://sprocketshandlersredis_stats.readthedocs.org
|
0
requirements.txt
Normal file
0
requirements.txt
Normal file
2
setup.cfg
Normal file
2
setup.cfg
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
[bdist_wheel]
|
||||||
|
universal = 1
|
68
setup.py
Normal file
68
setup.py
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
import codecs
|
||||||
|
import sys
|
||||||
|
|
||||||
|
import setuptools
|
||||||
|
|
||||||
|
|
||||||
|
def read_requirements_file(req_name):
|
||||||
|
requirements = []
|
||||||
|
try:
|
||||||
|
with codecs.open(req_name, encoding='utf-8') as req_file:
|
||||||
|
for req_line in req_file:
|
||||||
|
if '#' in req_line:
|
||||||
|
req_line = req_line[0:req_line.find('#')].strip()
|
||||||
|
if req_line:
|
||||||
|
requirements.append(req_line.strip())
|
||||||
|
except IOError:
|
||||||
|
pass
|
||||||
|
return requirements
|
||||||
|
|
||||||
|
|
||||||
|
install_requires = read_requirements_file('requirements.txt')
|
||||||
|
setup_requires = read_requirements_file('setup-requirements.txt')
|
||||||
|
tests_require = read_requirements_file('test-requirements.txt')
|
||||||
|
|
||||||
|
if sys.version_info < (2, 7):
|
||||||
|
tests_require.append('unittest2')
|
||||||
|
if sys.version_info < (3, 0):
|
||||||
|
tests_require.append('mock')
|
||||||
|
|
||||||
|
setuptools.setup(
|
||||||
|
name='sprockets.handlers.redis_stats',
|
||||||
|
version='0.0.0',
|
||||||
|
description='A Tornado handler dedicated to returning pertinent stats about your Redis database',
|
||||||
|
long_description=codecs.open('README.rst', encoding='utf-8').read(),
|
||||||
|
url='https://github.com/sprockets/sprockets.handlers.redis_stats.git',
|
||||||
|
author='AWeber Communications',
|
||||||
|
author_email='api@aweber.com',
|
||||||
|
license=codecs.open('LICENSE', encoding='utf-8').read(),
|
||||||
|
classifiers=[
|
||||||
|
'Development Status :: 4 - Beta',
|
||||||
|
'Intended Audience :: Developers',
|
||||||
|
'License :: OSI Approved :: BSD License',
|
||||||
|
'Natural Language :: English',
|
||||||
|
'Operating System :: OS Independent',
|
||||||
|
'Programming Language :: Python :: 2',
|
||||||
|
'Programming Language :: Python :: 2.6',
|
||||||
|
'Programming Language :: Python :: 2.7',
|
||||||
|
'Programming Language :: Python :: 3',
|
||||||
|
'Programming Language :: Python :: 3.2',
|
||||||
|
'Programming Language :: Python :: 3.3',
|
||||||
|
'Programming Language :: Python :: 3.4',
|
||||||
|
'Programming Language :: Python :: Implementation :: CPython',
|
||||||
|
'Programming Language :: Python :: Implementation :: PyPy',
|
||||||
|
'Topic :: Software Development :: Libraries',
|
||||||
|
'Topic :: Software Development :: Libraries :: Python Modules'
|
||||||
|
],
|
||||||
|
packages=['sprockets',
|
||||||
|
'sprockets.handlers',
|
||||||
|
'sprockets.handlers.redis_stats'],
|
||||||
|
package_data={'': ['LICENSE', 'README.md']},
|
||||||
|
include_package_data=True,
|
||||||
|
namespace_packages=['sprockets',
|
||||||
|
'sprockets.handlers'],
|
||||||
|
install_requires=install_requires,
|
||||||
|
setup_requires=setup_requires,
|
||||||
|
tests_require=tests_require,
|
||||||
|
test_suite='nose.collector',
|
||||||
|
zip_safe=False)
|
1
sprockets/__init__.py
Normal file
1
sprockets/__init__.py
Normal file
|
@ -0,0 +1 @@
|
||||||
|
__import__('pkg_resources').declare_namespace(__name__)
|
1
sprockets/handlers/__init__.py
Normal file
1
sprockets/handlers/__init__.py
Normal file
|
@ -0,0 +1 @@
|
||||||
|
__import__('pkg_resources').declare_namespace(__name__)
|
8
sprockets/handlers/redis_stats/__init__.py
Normal file
8
sprockets/handlers/redis_stats/__init__.py
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
"""
|
||||||
|
handlers.redis_stats
|
||||||
|
|
||||||
|
A Tornado handler dedicated to returning pertinent stats about your Redis database
|
||||||
|
|
||||||
|
"""
|
||||||
|
version_info = (0, 0, 0)
|
||||||
|
__version__ = '.'.join(str(v) for v in version_info)
|
3
test-requirements.txt
Normal file
3
test-requirements.txt
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
coverage>=3.7,<4
|
||||||
|
coveralls>=0.4,<1
|
||||||
|
nose>=1.3,<2
|
13
tests.py
Normal file
13
tests.py
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
"""
|
||||||
|
Tests for the sprockets.handlers.redis_stats package
|
||||||
|
|
||||||
|
"""
|
||||||
|
import mock
|
||||||
|
try:
|
||||||
|
import unittest2 as unittest
|
||||||
|
except ImportError:
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
|
||||||
|
class MyTest(unittest.TestCase):
|
||||||
|
pass
|
Loading…
Reference in a new issue