# 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
# 
# Path: cardinal/decorators.py
# 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 twisted.internet import defer
from twisted.internet.threads import deferToThread
from cardinal.decorators import command
from cardinal.decorators import help
import logging
import requests
    airdate = data['airdate'].strftime("%d %b %Y") \
        if data['airdate'] else \
        "TBA"

    return "{} - {} [{}]".format(ep_marker, data['name'], airdate)


class TVPlugin:
    def __init__(self, cardinal, config):
        self.logger = logging.getLogger(__name__)
        self.cardinal = cardinal

        if config is None:
            config = {}

        self.default_output = config.get('default_output', 'short')
        self.private_output = config.get('private_output', 'full')
        self.channels = config.get('channels', {})

    def get_output_format(self, channel):
        chantypes = self.cardinal.supported.getFeature("CHANTYPES") or ('#',)
        if channel[0] not in chantypes:
            return self.private_output

        # Fetch channel-specific output format, or default
        return self.channels.get(channel, {}) \
            .get('output', self.default_output)

    @command('ep')
    @help('Get air date info for a TV show.')

# 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
# 
# Path: cardinal/decorators.py
# 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/tv/plugin.py
from datetime import datetime
from twisted.internet import defer
from twisted.internet.threads import deferToThread
from cardinal.decorators import command
from cardinal.decorators import help
import logging
import requests

    airdate = data['airdate'].strftime("%d %b %Y") \
        if data['airdate'] else \
        "TBA"

    return "{} - {} [{}]".format(ep_marker, data['name'], airdate)


class TVPlugin:
    def __init__(self, cardinal, config):
        self.logger = logging.getLogger(__name__)
        self.cardinal = cardinal

        if config is None:
            config = {}

        self.default_output = config.get('default_output', 'short')
        self.private_output = config.get('private_output', 'full')
        self.channels = config.get('channels', {})

    def get_output_format(self, channel):
        chantypes = self.cardinal.supported.getFeature("CHANTYPES") or ('#',)
        if channel[0] not in chantypes:
            return self.private_output

        # Fetch channel-specific output format, or default
        return self.channels.get(channel, {}) \
            .get('output', self.default_output)

    @command('ep')
    @help('Get air date info for a TV show.')

    @help('Syntax: .ep <tv show>')