Skip to content

Commit

Permalink
New release: 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
monkeython committed Dec 5, 2014
1 parent ef8a27e commit de361cf
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 27 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Changes
=======

0.1.0
* Added ``RatedDict.ratings`` method to read item ratings values.
0.0.4
* API refactoring.
0.0.2
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014, Luca De Vitis <luca at monkeython.com>
Copyright (c) 2014, Luca De Vitis <luca at monkeython.com>
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
24 changes: 11 additions & 13 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
:target: https://pypi.python.org/pypi/multipla/
:alt: Downloads

.. image:: https://pypip.in/version/multipla/badge.svg?text=pypi
.. image:: https://pypip.in/version/multipla/badge.svg?text=latest
:target: https://pypi.python.org/pypi/multipla/
:alt: Latest Version

Expand All @@ -27,6 +27,10 @@
:target: https://pypi.python.org/pypi/multipla/
:alt: Supported Python versions

.. image:: https://pypip.in/implementation/multipla/badge.svg
:target: https://pypi.python.org/pypi/multipla/
:alt: Supported Python implementations

.. image:: https://pypip.in/egg/multipla/badge.svg
:target: https://pypi.python.org/pypi/multipla/
:alt: Egg Status
Expand All @@ -39,25 +43,19 @@
.. :target: https://pypi.python.org/pypi/multipla/
.. :alt: License
..
.. .. image:: https://pypip.in/implementation/multipla/badge.svg
.. :target: https://pypi.python.org/pypi/multipla/
.. :alt: Supported Python implementations
(Spelled like multiplug)
(Spelled like multiplug) The purpose of this module is to provide a dead simple
plugin handler module. I wanted something:

The purpose of this module is to provide a dead simple plugin handling system.
I wanted a system:

#. Capable of handling multiple plugins
#. Multiple implementation of the same plugin
#. Capable of handling multiple plugins (and that's pretty obvious)
#. Capable of handling multiple implementation of the same plugin
#. Capable of handling multiple ``pkg_resources.WorkingSet``-s... by itself
#. Easy to initialize in your pluggable application/framework.

Is there a way to quickly setup your package for plugins? Is it also easy to
use for you and third party developers? I don't know, but I know what I like:
I wanted somthing like:

.. code-block:: python
import multipla
content_types = multipla.power_up('scriba.content_types')
def to_json(object):
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
source_suffix = '.rst'

with open('../LICENSE.rst', 'r') as LICENSE:
copyright = LICENSE.readline()
copyright = LICENSE.readline()[3:]
author = copyright.rsplit(', ', 1)[1]

rst_epilog = """
Expand Down
3 changes: 3 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Plugin handling system
:contact: |contact|
:copyright: |copyright|

.. include:: ../LICENSE.rst
:start-line: 1

Overview
========

Expand Down
13 changes: 4 additions & 9 deletions multipla.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

__author__ = "Luca De Vitis <luca at monkeython.com>"
__version__ = '0.0.4'
__version__ = '0.1.0'
__keywords__ = ['multipla', 'multi-plugs', 'multi-socket', 'plugs', 'plugin']
# 'Development Status :: 5 - Production/Stable',
__classifiers__ = [
'Development Status :: 4 - Beta',
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
Expand Down Expand Up @@ -226,11 +224,8 @@ def highest_rated(self):

@property
def ratings(self):
"""``key``-``rate`` pairs for each ``key``, sorted by ``rate``.
:rtype: iterator
"""
return iter(self._ratings.items())
"""Iterator over ``key``-``rate`` pairs, sorted by ``rate``."""
return tuple(self._ratings.items())


class MultiPlugAdapter(RatedDict):
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
source-dir = docs
build-dir = build/docs
all_files = 1
project = Plugin handling system
project = multipla

[sdist]
formats = gztar,zip
Expand Down
3 changes: 1 addition & 2 deletions test_multipla.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ def test_highest_rated(self):
self.assertEqual(self.rd.highest_rated, 1)

def test_ratings(self):
with self.assertRaises(StopIteration):
next(self.rd.ratings)
self.assertFalse(self.rd.ratings)
self.rd.update(a=1, b=2)
self.rd.rate(b=4, a=1)
self.assertEqual(list(self.rd.ratings), [('b', 4), ('a', 1)])
Expand Down

0 comments on commit de361cf

Please sign in to comment.