# Path: module/plugins/internal/Plugin.py
# class Plugin(object):
#     def __init__(self, core):
#     def __repr__(self):
#     def classname(self):
#     def _init(self, core):
#     def init(self):
#     def _log(self, level, plugintype, pluginname, messages):
#     def log_debug(self, *args, **kwargs):
#     def log_info(self, *args, **kwargs):
#     def log_warning(self, *args, **kwargs):
#     def log_error(self, *args, **kwargs):
#     def log_critical(self, *args, **kwargs):
#     def _print_exc(self):
#     def remove(self, path, trash=False):  # @TODO: Change to `trash=True` in 0.4.10
#     def set_permissions(self, path):
#     def skip(self, msg):
#     def fail(self, msg):
#     def load(self, url, get={}, post={}, ref=True, cookies=True, just_header=False, decode=True,
#              multipart=False, redirect=True, req=None):
#     def dump_html(self):
#     def clean(self):


import re
from .Plugin import Fail
from .SimpleHoster import SimpleHoster

        if self.DIRECT_LINK is None:
            self.direct_dl = self.__pattern__ != r'^unmatchable$' and re.match(
                self.__pattern__, self.pyfile.url)
        else:
            self.direct_dl = self.DIRECT_LINK

    def _process(self, thread):
        try:
            SimpleHoster._process(self, thread)

        except Fail, e:
            if self.config.get('revert_failed', True) and \
               self.pyload.pluginManager.hosterPlugins.get(self.classname).get('new_module'):
                hdict = self.pyload.pluginManager.hosterPlugins.get(
                    self.classname)

                tmp_module = hdict['new_module']
                tmp_name = hdict['new_name']
                hdict.pop('new_module', None)
                hdict.pop('new_name', None)

                self.pyfile.initPlugin()

                hdict['new_module'] = tmp_module
                hdict['new_name'] = tmp_name

                self.restart(_("Revert to original hoster plugin"))

            else:

# Path: module/plugins/internal/Plugin.py
# class Plugin(object):
#     def __init__(self, core):
#     def __repr__(self):
#     def classname(self):
#     def _init(self, core):
#     def init(self):
#     def _log(self, level, plugintype, pluginname, messages):
#     def log_debug(self, *args, **kwargs):
#     def log_info(self, *args, **kwargs):
#     def log_warning(self, *args, **kwargs):
#     def log_error(self, *args, **kwargs):
#     def log_critical(self, *args, **kwargs):
#     def _print_exc(self):
#     def remove(self, path, trash=False):  # @TODO: Change to `trash=True` in 0.4.10
#     def set_permissions(self, path):
#     def skip(self, msg):
#     def fail(self, msg):
#     def load(self, url, get={}, post={}, ref=True, cookies=True, just_header=False, decode=True,
#              multipart=False, redirect=True, req=None):
#     def dump_html(self):
#     def clean(self):


# Path: module/plugins/internal/MultiHoster.py
import re
from .Plugin import Fail
from .SimpleHoster import SimpleHoster


        if self.DIRECT_LINK is None:
            self.direct_dl = self.__pattern__ != r'^unmatchable$' and re.match(
                self.__pattern__, self.pyfile.url)
        else:
            self.direct_dl = self.DIRECT_LINK

    def _process(self, thread):
        try:
            SimpleHoster._process(self, thread)

        except Fail, e:
            if self.config.get('revert_failed', True) and \
               self.pyload.pluginManager.hosterPlugins.get(self.classname).get('new_module'):
                hdict = self.pyload.pluginManager.hosterPlugins.get(
                    self.classname)

                tmp_module = hdict['new_module']
                tmp_name = hdict['new_name']
                hdict.pop('new_module', None)
                hdict.pop('new_name', None)

                self.pyfile.initPlugin()

                hdict['new_module'] = tmp_module
                hdict['new_name'] = tmp_name

                self.restart(_("Revert to original hoster plugin"))

            else:

                raise Fail(e)