File: PKG-INFO

package info (click to toggle)
obsub 0.2-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 156 kB
  • sloc: python: 350; makefile: 3; sh: 2
file content (203 lines) | stat: -rw-r--r-- 7,474 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
Metadata-Version: 1.1
Name: obsub
Version: 0.2
Summary: Implementation of the observer pattern via a decorator
Home-page: https://github.com/aepsil0n/obsub
Author: Eduard Bopp
Author-email: eduard.bopp@aepsil0n.de
License: Public Domain
Description: obsub
        =====
        
        |Build Status| |Coverage| |Version| |Downloads| |License|
        
        Small python module that implements the observer pattern via a
        decorator.
        
        
        Description
        -----------
        
        This is based on a `thread on stackoverflow
        <http://stackoverflow.com/questions/1904351/python-observer-pattern-examples-tips>`_
        (the example of C#-like events by Jason Orendorff), so I don't take any
        credit for the idea. I merely made a fancy module with documentation and
        tests out of it, since I needed it in a bigger project. It is quite
        handy and I've been using it in a couple of projects, which require some
        sort of event handling.
        
        Thus it is `licensed as
        CC0 <http://creativecommons.org/publicdomain/zero/1.0/>`__, so basically
        do-whatever-you-want to the extent legally possible.
        
        
        Installation
        ------------
        
        *obsub* is available on PyPI, so you can simply install it using
        ``pip install obsub`` or you do it manually using ``setup.py`` as with
        any python package.
        
        
        Usage
        -----
        
        The ``event`` decorator from the ``obsub`` module is used as follows:
        
        .. code:: python
        
            from obsub import event
        
            # Define a class with an event
            class Subject(object):
                @event
                def on_stuff(self, arg):
                    print('Stuff {} happens'.format(arg))
        
            # Now define an event handler, the observer
            def handler(subject, arg):
                print('Stuff {} is handled'.format(arg))
        
            # Wire everything up...
            sub = Subject()
            sub.on_stuff += handler
        
            # And try it!
            sub.on_stuff('foo')
        
        You should now get both print messages from the event itself and the
        event handler function, like so:
        
        ::
        
            Stuff foo happens
            Stuff foo is handled
        
        
        Continuous integration
        ----------------------
        
        For the fun of it, `Travis CI <https://travis-ci.org/aepsil0n/obsub>`__
        is used for continuous integration. As long as everything is fine, the
        button below should be green and shiny!
        
        |Build Status|
        
        The continuous integration ensures that our tests run on the following
        platforms:
        
        -  Python 2.6, 2.7
        -  Python 3.2, 3.3
        -  pypy
        
        It might also work on Python 2.5, but is not automatically tested with this
        version.
        
        We also track the coverage of our tests with coveralls.io
        
        |Coverage|
        
        Use `coverage <https://pypi.python.org/pypi/coverage>`__ to generate local
        coverage reports like this:
        
        ::
        
            coverage run setup.py nosetests
        
        Note: on some platforms (e.g. Ubuntu) the executable is called
        ``python-coverage``.
        
        
        Contribution and feedback
        -------------------------
        
        *obsub* is developed on `github <https://github.com/aepsil0n/obsub>`__.
        
        If you have any questions about this software or encounter bugs, you're welcome
        to open a `new issue on github <https://github.com/aepsil0n/obsub/issues/new>`__.
        
        In case you do not want to use github for some reason, you can alternatively
        send an email one of us:
        
        - `Eduard Bopp <eduard.bopp@aepsil0n.de>`__
        - `André-Patrick Bubel <code@andre-bubel.de>`__
        - `Thomas Gläßle <t_glaessle@gmx.de>`__
        
        Feel free to contribute patches as pull requests as you see fit. Try to be
        consistent with PEP 8 guidelines as far as possible and test everything.
        Otherwise, your commit messages should start with a capitalized verb for
        consistency. Unless your modification is completely trivial, also add a message
        body to your commit.
        
        
        
        Credits
        -------
        
        Thanks to Jason Orendorff on for the idea on stackoverflow. I also want
        to thank @coldfix and @Moredread for contributions and feedback.
        
        .. |Downloads| image:: https://pypip.in/d/obsub/badge.png
           :target: https://pypi.python.org/pypi/obsub/
           :alt: Downloads
        .. |Version| image:: https://pypip.in/v/obsub/badge.png
           :target: https://pypi.python.org/pypi/obsub/
           :alt: Latest Version
        .. |License| image:: https://pypip.in/license/obsub/badge.png
           :target: https://pypi.python.org/pypi/obsub/
           :alt: License
        .. |Build Status| image:: https://api.travis-ci.org/aepsil0n/obsub.png?branch=master
           :target: https://travis-ci.org/aepsil0n/obsub
        .. |Coverage| image:: https://coveralls.io/repos/aepsil0n/obsub/badge.png?branch=master
           :target: https://coveralls.io/r/aepsil0n/obsub
        
        Changelog
        ---------
        
        v0.2
        ~~~~
        
        From a user perspective the preservation of function signatures and a couple of
        bug fixes are probably most relevant. Python 2.5 is no longer tested by
        continuous integration, though we try to avoid unnecessary changes that might
        break backwards compatibility.
        
        In addition, there are quite a number of changes that mostly concern
        developers.
        
        - Function signatures are now preserved correctly by the event decorator. This
          is true only for python3. On python2 there is no support for default
          arguments, currently
        - Some fixes to memory handling and tests thereof. This includes a more generic
          handling of the garbage collection process within the test suite to make it
          pass on pypy, too.
        - Massive refactoring of test suite from one very long doctest to more focussed
          unit tests.
        - The documentation has been converted from Markdown to reStructuredText, since
          it is compatible with both PyPI and GitHub.
        - Various improvements and some streamlining of the documentation.
        - Fix package name in license.
        - Continuous integration now includes coveralls.io support.
        - Support for Python 2.5 is no longer tested using Travis CI, since they have
          dropped support for this version.
        
        
        v0.1.1
        ~~~~~~
        
        - Add __all__ attribute to module
        - Fix a couple of documentation issues
        
        
        v0.1
        ~~~~
        
        *Initial release*
        
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development