from observer import Publisher

class DisplayEvents:
	UPDATE = 'update'
	KEYDOWN = 'key_down'	# callback(source, key)
	KEYUP   = 'key_up'		# callback(source, key)
	MOUSEUP = 'mouse_up'	# callback(source, button, pos)

class AbstractDisplay:
	def __init__(self):
		self.publisher = Publisher([DisplayEvents.UPDATE, 
			DisplayEvents.KEYDOWN, 
			DisplayEvents.KEYUP, 
			DisplayEvents.MOUSEUP])

	#
	# Publisher Implementation
	#
	def register(self, event, who, callback=None):
		self.publisher.register(event, who, callback)

	def unregister(self, event, who):
		self.publisher.unregister(event, who)

	# Overridden by concrete display class
	def run(self):
		pass

610ca4f6e86c7e3d1a09890f744aa6d5b9226d03
<mask token>


class AbstractDisplay:

    def __init__(self):
        self.publisher = Publisher([DisplayEvents.UPDATE, DisplayEvents.
            KEYDOWN, DisplayEvents.KEYUP, DisplayEvents.MOUSEUP])
    <mask token>

    def unregister(self, event, who):
        self.publisher.unregister(event, who)

    def run(self):
        pass

<mask token>


class AbstractDisplay:

    def __init__(self):
        self.publisher = Publisher([DisplayEvents.UPDATE, DisplayEvents.
            KEYDOWN, DisplayEvents.KEYUP, DisplayEvents.MOUSEUP])

    def register(self, event, who, callback=None):
        self.publisher.register(event, who, callback)

    def unregister(self, event, who):
        self.publisher.unregister(event, who)

    def run(self):
        pass

<mask token>


class DisplayEvents:
    UPDATE = 'update'
    KEYDOWN = 'key_down'
    KEYUP = 'key_up'
    MOUSEUP = 'mouse_up'


class AbstractDisplay:

    def __init__(self):
        self.publisher = Publisher([DisplayEvents.UPDATE, DisplayEvents.
            KEYDOWN, DisplayEvents.KEYUP, DisplayEvents.MOUSEUP])

    def register(self, event, who, callback=None):
        self.publisher.register(event, who, callback)

    def unregister(self, event, who):
        self.publisher.unregister(event, who)

    def run(self):
        pass

from observer import Publisher


class DisplayEvents:
    UPDATE = 'update'
    KEYDOWN = 'key_down'
    KEYUP = 'key_up'
    MOUSEUP = 'mouse_up'


class AbstractDisplay:

    def __init__(self):
        self.publisher = Publisher([DisplayEvents.UPDATE, DisplayEvents.
            KEYDOWN, DisplayEvents.KEYUP, DisplayEvents.MOUSEUP])

    def register(self, event, who, callback=None):
        self.publisher.register(event, who, callback)

    def unregister(self, event, who):
        self.publisher.unregister(event, who)

    def run(self):
        pass

from observer import Publisher

class DisplayEvents:
	UPDATE = 'update'
	KEYDOWN = 'key_down'	# callback(source, key)
	KEYUP   = 'key_up'		# callback(source, key)
	MOUSEUP = 'mouse_up'	# callback(source, button, pos)

class AbstractDisplay:
	def __init__(self):
		self.publisher = Publisher([DisplayEvents.UPDATE, 
			DisplayEvents.KEYDOWN, 
			DisplayEvents.KEYUP, 
			DisplayEvents.MOUSEUP])

	#
	# Publisher Implementation
	#
	def register(self, event, who, callback=None):
		self.publisher.register(event, who, callback)

	def unregister(self, event, who):
		self.publisher.unregister(event, who)

	# Overridden by concrete display class
	def run(self):
		pass
