'Disable a Channel
- Remove schedule for Polling for new messages
- Disable all associated Parsers
CLI API for shell scripts & to be called by S3Method'

@staticmethod
def channel_disable(tablename, channel_id):

    db = current.db
    s3db = current.s3db
    table = s3db.table(tablename)
    record = db((table.channel_id == channel_id)).select(table.id, table.enabled, limitby=(0, 1)).first()
    if record.enabled:
        record.update_record(enabled=False)
        s3db.update_super(table, record)
    ptable = s3db.msg_parser
    parsers = db((ptable.channel_id == channel_id)).select(ptable.id)
    for parser in parsers:
        s3db.msg_parser_disable(parser.id)
    ttable = db.scheduler_task
    args = ('["%s",    %s]' % (tablename, channel_id))
    query = (((ttable.function_name == 'msg_poll') & (ttable.args == args)) & ttable.status.belongs(['RUNNING', 'QUEUED', 'ALLOCATED']))
    exists = db(query).select(ttable.id, limitby=(0, 1)).first()
    if exists:
        db(query).update(status='STOPPED')
        return 'Channel    disabled'
    else:
        return 'Channel    already    disabled'
