Example #1
0
 def __init__(self):
     message = Message(SuccessParagraph('IF1 was initialised'))
     dispatcher.send(
         signal=DYNAMIC_MESSAGE_SIGNAL,
         sender=self,
         message=message)
     self.count = 0
Example #2
0
 def run(self):
     self.count += 1
     message = Paragraph('IF1 run %i - running' % self.count)
     dispatcher.send(
         signal=DYNAMIC_MESSAGE_SIGNAL,
         sender=self,
         message=message)
Example #3
0
 def run(self):
     self.count += 1
     message = Paragraph('IF1 run %i - running' % self.count)
     dispatcher.send(
         signal=DYNAMIC_MESSAGE_SIGNAL,
         sender=self,
         message=message)
Example #4
0
 def __init__(self):
     message = Message(SuccessParagraph('IF1 was initialised'))
     dispatcher.send(
         signal=DYNAMIC_MESSAGE_SIGNAL,
         sender=self,
         message=message)
     self.count = 0
Example #5
0
def send_message(message):
    """Send a message using the dispatcher.

    :param message: A Message object to be sent to a message viewer.
    :type message: Message
    """
    dispatcher.send(signal=DYNAMIC_MESSAGE_SIGNAL,
                    sender=dispatcher.Anonymous,
                    message=message)
Example #6
0
    def _sendMessage(self, theMessage, dynamic=True):
        theType = STATIC_MESSAGE_SIGNAL
        if dynamic:
            theType = DYNAMIC_MESSAGE_SIGNAL

        dispatcher.send(
            signal=theType,
            sender=self,
            message=theMessage)
Example #7
0
def send_message(message):
    """Send a message using the dispatcher.

    :param message: A Message object to be sent to a message viewer.
    :type message: Message
    """
    dispatcher.send(
        signal=DYNAMIC_MESSAGE_SIGNAL,
        sender=dispatcher.Anonymous,
        message=message)
Example #8
0
    def run(self):
        message = Message(
            Text('This shows how you can create '),
            ImportantText('content inline when you create a message'), ' ',
            EmphasizedText('including different styles and so on.'))

        dispatcher.send(signal=STATIC_MESSAGE_SIGNAL,
                        sender=self,
                        message=message)

        impact_function1 = ImpactFunction1()
        # Run some tasks that will spawn dynamic messages
        for i in range(1, 10):
            _ = i
            impact_function1.run()
Example #9
0
    def run(self):
        """Run.
        """
        message = Message()
        message.add(Heading('Processing starting'))
        text = Text('This is an example application showing how the ')
        text.add(ImportantText('new Messaging system'))
        text.add(Text(' works in '))
        text.add(EmphasizedText('InaSAFE'))
        text.add(Text('.'))
        paragraph = Paragraph(text)
        message.add(paragraph)
        paragraph = Paragraph(
            'Sed ut perspiciatis unde omnis iste natus error sit voluptatem '
            'accusantium doloremque laudantium, totam rem aperiam, '
            'eaque ipsa quae ab illo inventore veritatis et quasi architecto '
            'beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem '
            'quia voluptas sit aspernatur aut odit aut fugit, sed quia '
            'consequuntur magni dolores eos qui ratione voluptatem sequi '
            'nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor '
            'sit amet, consectetur, adipisci velit, sed quia non numquam eius '
            'modi tempora incidunt ut labore et dolore magnam aliquam quaerat '
            'voluptatem. Ut enim ad minima veniam, quis nostrum '
            'exercitationem ullam corporis suscipit laboriosam, nisi ut '
            'aliquid ex ea commodi consequatur? Quis autem vel eum iure '
            'reprehenderit qui in ea voluptate velit esse quam nihil molestiae'
            ' consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla'
            ' pariatur?')
        message.add(paragraph)
        message.add(Message(
            Text('This shows how you can create '),
            ImportantText('content inline when you create a message'),
            ' ',
            EmphasizedText('including different styles and so on.')))

        dispatcher.send(
            signal=STATIC_MESSAGE_SIGNAL,
            sender=self,
            message=message)

        impact_function1 = ImpactFunction1()
        impact_function2 = ImpactFunction2()
        # Run some tasks that will spawn dynamic messages
        for i in range(1, 10):
            _ = i
            impact_function1.run()
            impact_function2.run()
Example #10
0
    def run(self):
        message = Message(
            Text('This shows how you can create '),
            ImportantText('content inline when you create a message'),
            ' ',
            EmphasizedText('including different styles and so on.'))

        dispatcher.send(
            signal=STATIC_MESSAGE_SIGNAL,
            sender=self,
            message=message)

        impact_function1 = ImpactFunction1()
        # Run some tasks that will spawn dynamic messages
        for i in range(1, 10):
            _ = i
            impact_function1.run()
Example #11
0
    def run(self):
        """Run.
        """
        message = Message()
        message.add(Heading('Processing starting'))
        text = Text('This is an example application showing how the ')
        text.add(ImportantText('new Messaging system'))
        text.add(Text(' works in '))
        text.add(EmphasizedText('InaSAFE'))
        text.add(Text('.'))
        paragraph = Paragraph(text)
        message.add(paragraph)
        paragraph = Paragraph(
            'Sed ut perspiciatis unde omnis iste natus error sit voluptatem '
            'accusantium doloremque laudantium, totam rem aperiam, '
            'eaque ipsa quae ab illo inventore veritatis et quasi architecto '
            'beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem '
            'quia voluptas sit aspernatur aut odit aut fugit, sed quia '
            'consequuntur magni dolores eos qui ratione voluptatem sequi '
            'nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor '
            'sit amet, consectetur, adipisci velit, sed quia non numquam eius '
            'modi tempora incidunt ut labore et dolore magnam aliquam quaerat '
            'voluptatem. Ut enim ad minima veniam, quis nostrum '
            'exercitationem ullam corporis suscipit laboriosam, nisi ut '
            'aliquid ex ea commodi consequatur? Quis autem vel eum iure '
            'reprehenderit qui in ea voluptate velit esse quam nihil molestiae'
            ' consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla'
            ' pariatur?')
        message.add(paragraph)
        message.add(
            Message(Text('This shows how you can create '),
                    ImportantText('content inline when you create a message'),
                    ' ',
                    EmphasizedText('including different styles and so on.')))

        dispatcher.send(signal=STATIC_MESSAGE_SIGNAL,
                        sender=self,
                        message=message)

        impact_function1 = ImpactFunction1()
        impact_function2 = ImpactFunction2()
        # Run some tasks that will spawn dynamic messages
        for i in range(1, 10):
            _ = i
            impact_function1.run()
            impact_function2.run()