# Path: grazyna/utils/event_loop.py
# def loop(time_config_key, default):
#     def outter(old_func):
#         func = asyncio.coroutine(old_func)
#         @asyncio.coroutine
#         @wraps(func)
#         def inner(protocol, plugin, future):
#             while True:
#                 if future.cancelled():
#                     break
#                 cfg = protocol.config['plugin:%s' % plugin.name]
#                 time_to_sleep = cfg.getint(time_config_key, default)
#                 if time_to_sleep == 0:
#                     break
# 
#                 if protocol.ready:
#                     #special random delay
#                     yield from asyncio.sleep(random() * 3)
#                     try:
#                         yield from func(protocol, plugin, cfg)
#                     except:
#                         traceback.print_exc(file=sys.stdout)
# 
#                 yield from asyncio.sleep(time_to_sleep)
#         inner.is_loop = True
#         return inner
#     return outter
# 
# Path: grazyna/format.py
# def color(msg, front, back=None):
#     if back:
#         front = '%d,%d' % (front, back)
#     else:
#         front = str(front)
#     return "\x03%s%s\x03" % (front, msg)
# 
# def bold(msg):
#     return "\x02%s\x02" % msg


import asyncio
from aiohttp import ClientSession, ClientError
from grazyna.utils.event_loop import loop
from grazyna.format import color, bold


API_URL = "https://api.github.com/repos/{user}/{repo}/{action}"
state_colors = {
    'open': color.green,
    'closed': color.red,
    'reopened': color.green,
    'subscribed': color.green,
    'merged': color.green,
    'assigned': color.purple,
    'unassigned': color.purple,
    'milestoned': color.olive,
    'demilestoned': color.olive,
    'locked': color.red,

# Path: grazyna/utils/event_loop.py
# def loop(time_config_key, default):
#     def outter(old_func):
#         func = asyncio.coroutine(old_func)
#         @asyncio.coroutine
#         @wraps(func)
#         def inner(protocol, plugin, future):
#             while True:
#                 if future.cancelled():
#                     break
#                 cfg = protocol.config['plugin:%s' % plugin.name]
#                 time_to_sleep = cfg.getint(time_config_key, default)
#                 if time_to_sleep == 0:
#                     break
# 
#                 if protocol.ready:
#                     #special random delay
#                     yield from asyncio.sleep(random() * 3)
#                     try:
#                         yield from func(protocol, plugin, cfg)
#                     except:
#                         traceback.print_exc(file=sys.stdout)
# 
#                 yield from asyncio.sleep(time_to_sleep)
#         inner.is_loop = True
#         return inner
#     return outter
# 
# Path: grazyna/format.py
# def color(msg, front, back=None):
#     if back:
#         front = '%d,%d' % (front, back)
#     else:
#         front = str(front)
#     return "\x03%s%s\x03" % (front, msg)
# 
# def bold(msg):
#     return "\x02%s\x02" % msg


# Path: grazyna/plugins/github.py
import asyncio
from aiohttp import ClientSession, ClientError
from grazyna.utils.event_loop import loop
from grazyna.format import color, bold



API_URL = "https://api.github.com/repos/{user}/{repo}/{action}"
state_colors = {
    'open': color.green,
    'closed': color.red,
    'reopened': color.green,
    'subscribed': color.green,
    'merged': color.green,
    'assigned': color.purple,
    'unassigned': color.purple,
    'milestoned': color.olive,
    'demilestoned': color.olive,
    'locked': color.red,

    'unlocked': color.green,