How to use the sopel.formatting.color function in sopel

To help you get started, we’ve selected a few sopel examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github openshift / openshift-tools / openshift_tools / ircbot / openshift_sre / openshift_sre.py View on Github external
def announce_shift(bot, channel, rotation):
    """Anounces a shift and sets the topic to reflect that change"""
    debug(bot,
          'announce_shift_complete: shifts - curr:{s1}'.format(s1=rotation))

    hashline = formatting.color('###', formatting.colors.RED)
    lead = formatting.color('    Shift Lead: {curr_nick}'.format(curr_nick=rotation['Shift Lead']),
                            formatting.colors.RED)
    secondary = formatting.color('    Shift Secondary: {curr_nick}'.format(curr_nick=rotation['Shift Secondary']),
                                 formatting.colors.RED)
    oncall = formatting.color('    On-Call: {oncall_nick}'.format(oncall_nick=rotation['Oncall']),
                              formatting.colors.RED)
    oncallWeeday = formatting.color('    No oncall scheduled on weekdays, contact shift lead',
                              formatting.colors.RED)

    if bot.db.get_channel_value(channel, 'announce'):
        print("Annoucing to channel " + str(channel))
        bot.say(hashline, channel)
        bot.say(lead, channel)
        bot.say(secondary, channel)
        if rotation['Oncall']:
            bot.say(oncall, channel)
        else:
github openshift / openshift-tools / openshift_tools / ircbot / openshift_sre / openshift_sre.py View on Github external
def announce_shift(bot, channel, rotation):
    """Anounces a shift and sets the topic to reflect that change"""
    debug(bot,
          'announce_shift_complete: shifts - curr:{s1}'.format(s1=rotation))

    hashline = formatting.color('###', formatting.colors.RED)
    lead = formatting.color('    Shift Lead: {curr_nick}'.format(curr_nick=rotation['Shift Lead']),
                            formatting.colors.RED)
    secondary = formatting.color('    Shift Secondary: {curr_nick}'.format(curr_nick=rotation['Shift Secondary']),
                                 formatting.colors.RED)
    oncall = formatting.color('    On-Call: {oncall_nick}'.format(oncall_nick=rotation['Oncall']),
                              formatting.colors.RED)
    oncallWeeday = formatting.color('    No oncall scheduled on weekdays, contact shift lead',
                              formatting.colors.RED)

    if bot.db.get_channel_value(channel, 'announce'):
        print("Annoucing to channel " + str(channel))
        bot.say(hashline, channel)
        bot.say(lead, channel)
        bot.say(secondary, channel)
        if rotation['Oncall']:
            bot.say(oncall, channel)
github openshift / openshift-tools / openshift_tools / ircbot / openshift_sre / openshift_sre.py View on Github external
def announce_shift(bot, channel, rotation):
    """Anounces a shift and sets the topic to reflect that change"""
    debug(bot,
          'announce_shift_complete: shifts - curr:{s1}'.format(s1=rotation))

    hashline = formatting.color('###', formatting.colors.RED)
    lead = formatting.color('    Shift Lead: {curr_nick}'.format(curr_nick=rotation['Shift Lead']),
                            formatting.colors.RED)
    secondary = formatting.color('    Shift Secondary: {curr_nick}'.format(curr_nick=rotation['Shift Secondary']),
                                 formatting.colors.RED)
    oncall = formatting.color('    On-Call: {oncall_nick}'.format(oncall_nick=rotation['Oncall']),
                              formatting.colors.RED)
    oncallWeeday = formatting.color('    No oncall scheduled on weekdays, contact shift lead',
                              formatting.colors.RED)

    if bot.db.get_channel_value(channel, 'announce'):
        print("Annoucing to channel " + str(channel))
        bot.say(hashline, channel)
        bot.say(lead, channel)
        bot.say(secondary, channel)
        if rotation['Oncall']:
            bot.say(oncall, channel)
        else: 
            bot.say(oncallWeeday, channel)
    else:
        print("Failed to get channel value")
github openshift / openshift-tools / openshift_tools / ircbot / openshift_sre / openshift_sre.py View on Github external
def announce_shift(bot, channel, rotation):
    """Anounces a shift and sets the topic to reflect that change"""
    debug(bot,
          'announce_shift_complete: shifts - curr:{s1}'.format(s1=rotation))

    hashline = formatting.color('###', formatting.colors.RED)
    lead = formatting.color('    Shift Lead: {curr_nick}'.format(curr_nick=rotation['Shift Lead']),
                            formatting.colors.RED)
    secondary = formatting.color('    Shift Secondary: {curr_nick}'.format(curr_nick=rotation['Shift Secondary']),
                                 formatting.colors.RED)
    oncall = formatting.color('    On-Call: {oncall_nick}'.format(oncall_nick=rotation['Oncall']),
                              formatting.colors.RED)
    oncallWeeday = formatting.color('    No oncall scheduled on weekdays, contact shift lead',
                              formatting.colors.RED)

    if bot.db.get_channel_value(channel, 'announce'):
        print("Annoucing to channel " + str(channel))
        bot.say(hashline, channel)
        bot.say(lead, channel)
        bot.say(secondary, channel)
        if rotation['Oncall']:
            bot.say(oncall, channel)
        else: 
            bot.say(oncallWeeday, channel)
    else:
        print("Failed to get channel value")
github openshift / openshift-tools / openshift_tools / ircbot / openshift_sre / openshift_sre.py View on Github external
def announce_shift(bot, channel, rotation):
    """Anounces a shift and sets the topic to reflect that change"""
    debug(bot,
          'announce_shift_complete: shifts - curr:{s1}'.format(s1=rotation))

    hashline = formatting.color('###', formatting.colors.RED)
    lead = formatting.color('    Shift Lead: {curr_nick}'.format(curr_nick=rotation['Shift Lead']),
                            formatting.colors.RED)
    secondary = formatting.color('    Shift Secondary: {curr_nick}'.format(curr_nick=rotation['Shift Secondary']),
                                 formatting.colors.RED)
    oncall = formatting.color('    On-Call: {oncall_nick}'.format(oncall_nick=rotation['Oncall']),
                              formatting.colors.RED)
    oncallWeeday = formatting.color('    No oncall scheduled on weekdays, contact shift lead',
                              formatting.colors.RED)

    if bot.db.get_channel_value(channel, 'announce'):
        print("Annoucing to channel " + str(channel))
        bot.say(hashline, channel)
        bot.say(lead, channel)
        bot.say(secondary, channel)
        if rotation['Oncall']:
            bot.say(oncall, channel)
        else: 
            bot.say(oncallWeeday, channel)
    else: