Exemple #1
0
def main():
    from tests.testapp import testapp
    from tests.mock.mockbuddy import MockBuddy
    from path import path

    a = testapp('../../..')

    from gui.imwin.messagearea import MessageArea
    from gui.imwin.styles import get_theme
    from common.logger import history_from_files
    from gui import skin

    f = wx.Frame(None, title = 'Conversation Preview')
    msgarea = MessageArea(f)

    buddy = MockBuddy('digsby01')

    theme = get_theme('GoneDark', 'Steel')
    msgarea.init_content(theme, buddy.alias, buddy, show_history = False)

    msgs = history_from_files([skin.resourcedir() / 'Example Conversation.html'])
    msgarea.replay_messages(msgs, buddy)

    f.Show()
    a.MainLoop()
Exemple #2
0
def build_example_message_area(parent, theme):
    buddy = MockBuddy('Friend')

    msgarea = MessageArea(parent)
    msgarea.SetMinSize((-1, 150))
    msgarea.init_content(theme, buddy.alias, buddy, show_history = False)

    # load an example conversation from the resource directory.
    bytes = (skin.resourcedir() / EXAMPLE_CONVO_FILENAME).bytes()
    bytes = Template(bytes).safe_substitute({'Me': profile.username})
    msgs  = parent._examplehistory = list(common.logger.parse_html(bytes))

    log.info('  %d messages', len(msgs))
    msgarea.replay_messages(msgs, buddy, context = False)

    return msgarea
Exemple #3
0
def build_example_message_area(parent, theme):
    buddy = MockBuddy('Friend')

    msgarea = MessageArea(parent)
    msgarea.SetMinSize((-1, 150))
    msgarea.init_content(theme, buddy.alias, buddy, show_history=False)

    # load an example conversation from the resource directory.
    bytes = (skin.resourcedir() / EXAMPLE_CONVO_FILENAME).bytes()
    bytes = Template(bytes).safe_substitute({'Me': profile.username})
    msgs = parent._examplehistory = list(common.logger.parse_html(bytes))

    log.info('  %d messages', len(msgs))
    msgarea.replay_messages(msgs, buddy, context=False)

    return msgarea