File: Event.py

package info (click to toggle)
pyro 1%3A3.14-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,048 kB
  • ctags: 1,988
  • sloc: python: 11,194; xml: 128; sh: 52; makefile: 28
file content (19 lines) | stat: -rw-r--r-- 655 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#############################################################################
#  
#	Event Service client base classes
#
#	This is part of "Pyro" - Python Remote Objects
#	which is (c) Irmen de Jong - irmen@razorvine.net
#
#############################################################################

import time

# EVENT - the thing that is published. Has a subject and contains a message.
class Event(object):
	def __init__(self, subject, msg, creationTime=None):
		self.msg=msg
		self.subject=subject
		self.time=creationTime or time.time()
	def __str__(self):
		return "<EVENT SUBJ %s (%s): %s>" % (self.subject, time.ctime(self.time), str(self.msg))