Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    python-Observable 0.1.0

    Download button

    No screenshots available
    Downloads: 382  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Manuel Amador | More programs
    GPL / FREE
    December 5th, 2005, 20:09 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    python-Observable description

    python-observable lets Python developers build loosely coupled object meshes with a complete Observer/Observable implementation.

    python-observable library lets Python developers build loosely coupled object meshes with a complete Observer/Observable implementation.

    In software development literature, Observer/Observable is a software
    pattern. From an Observer/Observable perspective, there are two kinds
    of objects:

    - objects which experience events or state changes (Observables)
    - objects which need to know about other objects' events (Observers)

    If you have any experience with event-based programming, such as with
    toolkits like GTK+ or Qt, you'll be familiar with the Observer/Observable
    pattern. Observer objects register themselves with the Observable object
    of their interest, and when Observables experience events, these events
    are relayed to the Observers.

    Observer/Observable lets software developers build loosely coupled object meshes. What this means to you: your software will be more stable and easier to refactor.

    This module has a complete Observer/Observable implementation. To take advantage of this module, all you have to do is:

    - Make your Observable classes inherit from Observable (don't forget to call Observable.__init__(self) in the constructor)
    - Make your Observer classes inherit from Observer (don't forget to call Observer.__init__(self) in the constructor)
    - At runtime, for each object you want to observe, call self.observe(observable_object) in a method of your Observer object.
    - In your Observable object, every time an event happens, call:
    ...
    self.broadcastEvent("MyEventName",argument1,argument2...)
    ...
    - In your Observer object, implement a method named: def processEvent(self,notifierObject,eventName,*args): which will receive the notifier object, an event name, and a variable number of arguments, every time broadcastEvent is called in any of the Observable objects that have been observe'd()

    That's it. Keep in mind that processEvent() will be invoked in the same thread context as the code which called broadcastEvent() in the Observable object. Thus, processEvent() methods should return quickly and never do blocking operations (suggested technique for coping with blocking operations: run them in a separate thread, which sleeps until a flag is raised, and raise the flag in the processEvent() method as appropriate).

    Requirements:

    · Python 2.2 or later



    Product's homepage

    Requirements:

    · Python 2.2 or later

      


    TAGS:

    python module | python library | observable module | Python | module | library

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM