# Path: cardinal/decorators.py
# def command(triggers):
#     if isinstance(triggers, str):
#         triggers = [triggers]
# 
#     if not isinstance(triggers, list):
#         raise TypeError("Command must be a trigger string or list of triggers")
# 
#     def wrap(f):
#         f.commands = triggers
#         return f
# 
#     return wrap
# 
# def help(lines):
#     # For backwards compatibility
#     if isinstance(lines, str):
#         lines = [lines]
# 
#     if not isinstance(lines, list):
#         raise TypeError("Help must be a help string or list of help strings")
# 
#     def wrap(f):
#         # Create help list or prepend to it
#         if not hasattr(f, 'help'):
#             f.help = lines
#         else:
#             f.help = lines + f.help
# 
#         return f
# 
#     return wrap


from datetime import datetime
from cardinal.decorators import command, help
            else:
                cardinal.sendMsg(
                    channel,
                    "Unable to handle help string returned by module.")

    # Sends some basic meta information about the bot
    @command('info')
    @help("Gives some basic information about the bot.")
    @help("Syntax: .info")
    def cmd_info(self, cardinal, user, channel, msg):
        admins = self._get_admins(cardinal)
        meta = self._get_meta(cardinal)

        # Calculate uptime into readable format
        now = datetime.now()
        uptime = self._pretty_uptime((now - meta['uptime']).total_seconds())
        booted = self._pretty_uptime((now - meta['booted']).total_seconds())

        cardinal.sendMsg(
            channel,
            "I am a Python 3 IRC bot, online since {}. I initially connected "
            "{} ago. My admins are: {}. Use .help to list commands."
            .format(uptime, booted, admins)
        )
        cardinal.sendMsg(
            channel,
            "Visit https://github.com/JohnMaguire/Cardinal to learn more."
        )



# Path: cardinal/decorators.py
# def command(triggers):
#     if isinstance(triggers, str):
#         triggers = [triggers]
# 
#     if not isinstance(triggers, list):
#         raise TypeError("Command must be a trigger string or list of triggers")
# 
#     def wrap(f):
#         f.commands = triggers
#         return f
# 
#     return wrap
# 
# def help(lines):
#     # For backwards compatibility
#     if isinstance(lines, str):
#         lines = [lines]
# 
#     if not isinstance(lines, list):
#         raise TypeError("Help must be a help string or list of help strings")
# 
#     def wrap(f):
#         # Create help list or prepend to it
#         if not hasattr(f, 'help'):
#             f.help = lines
#         else:
#             f.help = lines + f.help
# 
#         return f
# 
#     return wrap


# Path: plugins/help/plugin.py
from datetime import datetime
from cardinal.decorators import command, help

            else:
                cardinal.sendMsg(
                    channel,
                    "Unable to handle help string returned by module.")

    # Sends some basic meta information about the bot
    @command('info')
    @help("Gives some basic information about the bot.")
    @help("Syntax: .info")
    def cmd_info(self, cardinal, user, channel, msg):
        admins = self._get_admins(cardinal)
        meta = self._get_meta(cardinal)

        # Calculate uptime into readable format
        now = datetime.now()
        uptime = self._pretty_uptime((now - meta['uptime']).total_seconds())
        booted = self._pretty_uptime((now - meta['booted']).total_seconds())

        cardinal.sendMsg(
            channel,
            "I am a Python 3 IRC bot, online since {}. I initially connected "
            "{} ago. My admins are: {}. Use .help to list commands."
            .format(uptime, booted, admins)
        )
        cardinal.sendMsg(
            channel,
            "Visit https://github.com/JohnMaguire/Cardinal to learn more."
        )



entrypoint = HelpPlugin