Package beepy :: Package profiles :: Module echoprofile :: Class EchoProfile
[show private | hide private]
[frames | no frames]

Class EchoProfile

Profile --+
          |
         EchoProfile


A very basic example profile that just echos frames.
Method Summary
  __init__(self, session, profileInit, init_callback)
Create a new Profile object.
  processMessage(self, msg)
An EchoProfile simply sends a RPY to each MSG it receives containing the same payload as what was received.
    Inherited from Profile
  mimeDecode(self, payload)
mimeDecode() is a convenience function used to help make life easier for profile programmers, like me.
  mimeEncode(self, payload, contentType, encoding)
mimeEncode() is a convenience function used to help make life easier for profile programmers, like me.
  setChannel(self, channel)
setChannel() binds this Profile to the Channel it belongs to.

Method Details

__init__(self, session, profileInit=None, init_callback=None)
(Constructor)

Create a new Profile object.
Parameters:
session - the session to which this profile's channel belongs.
           (type=a beepy.core.session.Session object)
profileInit - initialisation data passed to the profile
           (type=bytestring)
init_callback - a method that will do further, more complex, profile initialisation at create time.
           (type=a bound method)
Overrides:
beepy.profiles.profile.Profile.__init__ (inherited documentation)

processMessage(self, msg)

An EchoProfile simply sends a RPY to each MSG it receives containing the same payload as what was received.

For demonstration purposes, this EchoProfile also asks the controlling session to shutdown() if more than 5 MSGs are received.
Raises:
profile.TerminalProfileException - if any exception occurs during processing.
Overrides:
beepy.profiles.profile.Profile.processMessage

Generated by Epydoc 2.0 on Thu Sep 30 14:39:26 2004 http://epydoc.sf.net