# Path: abusehelper/core/bot.py
# class ParamError(Exception):
# class Param(object):
# class ListParam(Param):
# class BoolParam(Param):
# class IntParam(Param):
# class FloatParam(Param):
# class LineFormatter(logging.Formatter):
# class Bot(object):
# class XMPPBot(Bot):
# class _Service(services.Service):
# class ServiceBot(XMPPBot):
# class FeedBot(ServiceBot):
# class PollSkipped(Exception):
# class PollingBot(FeedBot):
#     NO_VALUE = object()
#     def __init__(self, help="", short=None, default=NO_VALUE):
#     def has_default(self):
#     def parse(self, value):
#     def __init__(self, *args, **keys):
#     def parse(self, value):
#     def __init__(self, help="", short=None):
#     def parse(self, value=None):
#     def parse(self, value):
#     def parse(self, value):
# def optparse_name(name):
# def optparse_callback(option, opt_str, value, parser, callback, parsed):
#     def __init__(self):
#     def format(self, record):
#     def params(cls):
#     def param_defaults(cls, **defaults):
#     def _from_sys_argv(cls, params, **defaults):
#     def _from_dict(cls, params, **defaults):
#     def from_command_line(cls, *args, **keys):
#     def __init__(self, *args, **keys):
#     def create_logger(self, log_level=logging.INFO):
#     def execute(self):
#         def showwarning(message, category, filename, fileno, file=None, line=None):
#     def run(self):
#     def __init__(self, *args, **keys):
#     def run(self):
#     def main(self):
#     def xmpp_connect(self):
#     def __init__(self, bot, *args, **keys):
#     def main(self, *args, **keys):
#     def session(self, *args, **keys):
#     def _run(self):
#     def run(self):
#         def throw_stop_on_signal():
#     def main(self, state):
#     def session(self, state, **keys):
#     def __init__(self, *args, **keys):
#     def feed_keys(self, *args, **keys):
#     def feed(self, *args, **keys):
#     def _cutoff(self):
#     def _output_rate_limiter(self):
#     def session(self, state, dst_room, **keys):
#     def manage_room(self, name):
#     def manage_connection(self, feed_key, room_name):
#     def _stats(self, name, interval=60.0):
#         def counter(event):
#         def logger():
#     def augment(self):
#     def __init__(self, reason):
#     def reason(self):
#     def __init__(self, *args, **keys):
#     def poll(self, *key):
#     def dedup(self, key):
#     def feed(self, *key):
#     def main(self, state):
# 
# Path: abusehelper/core/events.py
# def _replace_non_xml_chars(unicode_obj, replacement=u"\ufffd"):
# def _normalize(value):
# def _unicode_quote(string):
# def _unicode_parse_part(string, start):
#     def _itemize(cls, *args, **keys):
#     def from_unicode(cls, string):
#     def from_elements(self, elements):
#     def __init__(self, *args, **keys):
#     def union(self, *args, **keys):
#     def difference(self, *args, **keys):
#     def add(self, key, value, *values):
#     def update(self, key, values):
#     def discard(self, key, value, *values):
#     def clear(self, key):
#     def _unkeyed(self):
#     def _iter(self, key, parser, filter):
#     def pop(self, key, parser=None, filter=None):
#     def values(self, key=_UNDEFINED, parser=None, filter=None):
#     def value(self, key=_UNDEFINED, default=_UNDEFINED,
#               parser=None, filter=None):
#     def contains(self, key=_UNDEFINED, value=_UNDEFINED,
#                  parser=None, filter=None):
#     def items(self, parser=None, filter=None):
#     def keys(self, parser=None, filter=None):
#     def to_elements(self, include_body=True):
#     def __reduce__(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __unicode__(self):
#     def __repr__(self):
# def hexdigest(event, func=hashlib.sha1):
# def stanzas_to_events():
# def events_to_elements():
# _NON_XML = re.compile(u"[\x00-\x08\x0b\x0c\x0e-\x1f\ud800-\udfff\ufffe\uffff]", re.U)
# EVENT_NS = "abusehelper#event"
# _UNICODE_QUOTE_CHECK = re.compile(r'[\s"\\,=]', re.U)
# _UNICODE_QUOTE = re.compile(r'["\\]', re.U)
# _UNICODE_UNQUOTE = re.compile(r'\\(.)', re.U)
# _UNICODE_PART = re.compile(r'\s*(?:(?:"((?:\\.|[^"])*)")|([^\s"=,]+)|)\s*', re.U)
#     _UNDEFINED = object()
# class Event(object):


import urllib
import getpass
import hashlib
import idiokit
from abusehelper.core import bot, events
from opencollab import wiki



def normalize(value):
    if value.startswith("[[") and value.endswith("]]"):
        return value[2:-2]
    return value


class OpenCollabReader(bot.FeedBot):
    poll_interval = bot.IntParam(default=60)

    collab_url = bot.Param()
    collab_user = bot.Param()

# Path: abusehelper/core/bot.py
# class ParamError(Exception):
# class Param(object):
# class ListParam(Param):
# class BoolParam(Param):
# class IntParam(Param):
# class FloatParam(Param):
# class LineFormatter(logging.Formatter):
# class Bot(object):
# class XMPPBot(Bot):
# class _Service(services.Service):
# class ServiceBot(XMPPBot):
# class FeedBot(ServiceBot):
# class PollSkipped(Exception):
# class PollingBot(FeedBot):
#     NO_VALUE = object()
#     def __init__(self, help="", short=None, default=NO_VALUE):
#     def has_default(self):
#     def parse(self, value):
#     def __init__(self, *args, **keys):
#     def parse(self, value):
#     def __init__(self, help="", short=None):
#     def parse(self, value=None):
#     def parse(self, value):
#     def parse(self, value):
# def optparse_name(name):
# def optparse_callback(option, opt_str, value, parser, callback, parsed):
#     def __init__(self):
#     def format(self, record):
#     def params(cls):
#     def param_defaults(cls, **defaults):
#     def _from_sys_argv(cls, params, **defaults):
#     def _from_dict(cls, params, **defaults):
#     def from_command_line(cls, *args, **keys):
#     def __init__(self, *args, **keys):
#     def create_logger(self, log_level=logging.INFO):
#     def execute(self):
#         def showwarning(message, category, filename, fileno, file=None, line=None):
#     def run(self):
#     def __init__(self, *args, **keys):
#     def run(self):
#     def main(self):
#     def xmpp_connect(self):
#     def __init__(self, bot, *args, **keys):
#     def main(self, *args, **keys):
#     def session(self, *args, **keys):
#     def _run(self):
#     def run(self):
#         def throw_stop_on_signal():
#     def main(self, state):
#     def session(self, state, **keys):
#     def __init__(self, *args, **keys):
#     def feed_keys(self, *args, **keys):
#     def feed(self, *args, **keys):
#     def _cutoff(self):
#     def _output_rate_limiter(self):
#     def session(self, state, dst_room, **keys):
#     def manage_room(self, name):
#     def manage_connection(self, feed_key, room_name):
#     def _stats(self, name, interval=60.0):
#         def counter(event):
#         def logger():
#     def augment(self):
#     def __init__(self, reason):
#     def reason(self):
#     def __init__(self, *args, **keys):
#     def poll(self, *key):
#     def dedup(self, key):
#     def feed(self, *key):
#     def main(self, state):
# 
# Path: abusehelper/core/events.py
# def _replace_non_xml_chars(unicode_obj, replacement=u"\ufffd"):
# def _normalize(value):
# def _unicode_quote(string):
# def _unicode_parse_part(string, start):
#     def _itemize(cls, *args, **keys):
#     def from_unicode(cls, string):
#     def from_elements(self, elements):
#     def __init__(self, *args, **keys):
#     def union(self, *args, **keys):
#     def difference(self, *args, **keys):
#     def add(self, key, value, *values):
#     def update(self, key, values):
#     def discard(self, key, value, *values):
#     def clear(self, key):
#     def _unkeyed(self):
#     def _iter(self, key, parser, filter):
#     def pop(self, key, parser=None, filter=None):
#     def values(self, key=_UNDEFINED, parser=None, filter=None):
#     def value(self, key=_UNDEFINED, default=_UNDEFINED,
#               parser=None, filter=None):
#     def contains(self, key=_UNDEFINED, value=_UNDEFINED,
#                  parser=None, filter=None):
#     def items(self, parser=None, filter=None):
#     def keys(self, parser=None, filter=None):
#     def to_elements(self, include_body=True):
#     def __reduce__(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __unicode__(self):
#     def __repr__(self):
# def hexdigest(event, func=hashlib.sha1):
# def stanzas_to_events():
# def events_to_elements():
# _NON_XML = re.compile(u"[\x00-\x08\x0b\x0c\x0e-\x1f\ud800-\udfff\ufffe\uffff]", re.U)
# EVENT_NS = "abusehelper#event"
# _UNICODE_QUOTE_CHECK = re.compile(r'[\s"\\,=]', re.U)
# _UNICODE_QUOTE = re.compile(r'["\\]', re.U)
# _UNICODE_UNQUOTE = re.compile(r'\\(.)', re.U)
# _UNICODE_PART = re.compile(r'\s*(?:(?:"((?:\\.|[^"])*)")|([^\s"=,]+)|)\s*', re.U)
#     _UNDEFINED = object()
# class Event(object):


# Path: abusehelper/bots/opencollab/opencollabreader.py
import urllib
import getpass
import hashlib
import idiokit
from abusehelper.core import bot, events
from opencollab import wiki




def normalize(value):
    if value.startswith("[[") and value.endswith("]]"):
        return value[2:-2]
    return value


class OpenCollabReader(bot.FeedBot):
    poll_interval = bot.IntParam(default=60)

    collab_url = bot.Param()
    collab_user = bot.Param()

    collab_password = bot.Param(default=None)