# Path: sublime_jedi/console_logging.py
# def get_plugin_debug_level(default='error'):
#     def __init__(self, name):
#     def level(self):
#     def _print(self, msg):
#     def log(self, level, msg, **kwargs):
#     def _log(self, level, msg, **kwargs):
#     def debug(self, msg):
#     def info(self, msg):
#     def error(self, msg, exc_info=False):
#     def exception(self, msg):
#     def warning(self, msg):
# class Logger:
# 
# Path: sublime_jedi/daemon.py
# def ask_daemon(view, callback, ask_type, ask_kwargs=None, location=None):
#     """Jedi async request shortcut.
# 
#     :type view: sublime.View
#     :type callback: callable
#     :type ask_type: str
#     :type ask_kwargs: dict or None
#     :type location: type of (int, int) or None
#     """
#     window_id = view.window().id()
# 
#     def _async_summon():
#         answer = ask_daemon_sync(view, ask_type, ask_kwargs, location)
#         _run_in_active_view(window_id)(callback)(answer)
# 
#     if callback:
#         sublime.set_timeout_async(_async_summon, 0)
# 
# Path: sublime_jedi/utils.py
# def is_sublime_v2():
#     return sublime.version().startswith('2')
# 
# class PythonCommandMixin(object):
#     """A mixin that hides and disables command for non-python code """
# 
#     def is_visible(self):
#         """ The command is visible only for python code """
#         return is_python_scope(self.view, self.view.sel()[0].begin())
# 
#     def is_enabled(self):
#         """ The command is enabled only when it is visible """
#         return self.is_visible()


from functools import partial
from .console_logging import getLogger
from .daemon import ask_daemon
from .settings import get_plugin_settings
from .utils import is_sublime_v2, PythonCommandMixin
    from .tooltips import show_docstring_tooltip
import sublime
import sublime_plugin

logger = getLogger(__name__)


class HelpMessageCommand(sublime_plugin.TextCommand):
    """Command to insert doc-strings into Sublime output panel."""

    def run(self, edit, docstring):
        self.view.insert(edit, self.view.size(), docstring)


def show_docstring_panel(view, docstring):
    """Show docstring in output panel.

    :param view (sublime.View): current active view
    :param docstring (basestring): python __doc__ string
    """
    window = sublime.active_window()

    if docstring:
        output = window.get_output_panel('help_panel')
        output.set_read_only(False)
        output.run_command('help_message', {'docstring': docstring})
        output.set_read_only(True)
        window.run_command('show_panel', {'panel': 'output.help_panel'})
    else:
        window.run_command('hide_panel', {'panel': 'output.help_panel'})
        sublime.status_message('Jedi: No results!')



# Path: sublime_jedi/console_logging.py
# def get_plugin_debug_level(default='error'):
#     def __init__(self, name):
#     def level(self):
#     def _print(self, msg):
#     def log(self, level, msg, **kwargs):
#     def _log(self, level, msg, **kwargs):
#     def debug(self, msg):
#     def info(self, msg):
#     def error(self, msg, exc_info=False):
#     def exception(self, msg):
#     def warning(self, msg):
# class Logger:
# 
# Path: sublime_jedi/daemon.py
# def ask_daemon(view, callback, ask_type, ask_kwargs=None, location=None):
#     """Jedi async request shortcut.
# 
#     :type view: sublime.View
#     :type callback: callable
#     :type ask_type: str
#     :type ask_kwargs: dict or None
#     :type location: type of (int, int) or None
#     """
#     window_id = view.window().id()
# 
#     def _async_summon():
#         answer = ask_daemon_sync(view, ask_type, ask_kwargs, location)
#         _run_in_active_view(window_id)(callback)(answer)
# 
#     if callback:
#         sublime.set_timeout_async(_async_summon, 0)
# 
# Path: sublime_jedi/utils.py
# def is_sublime_v2():
#     return sublime.version().startswith('2')
# 
# class PythonCommandMixin(object):
#     """A mixin that hides and disables command for non-python code """
# 
#     def is_visible(self):
#         """ The command is visible only for python code """
#         return is_python_scope(self.view, self.view.sel()[0].begin())
# 
#     def is_enabled(self):
#         """ The command is enabled only when it is visible """
#         return self.is_visible()


# Path: sublime_jedi/helper.py
from functools import partial
from .console_logging import getLogger
from .daemon import ask_daemon
from .settings import get_plugin_settings
from .utils import is_sublime_v2, PythonCommandMixin
    from .tooltips import show_docstring_tooltip
import sublime
import sublime_plugin


logger = getLogger(__name__)


class HelpMessageCommand(sublime_plugin.TextCommand):
    """Command to insert doc-strings into Sublime output panel."""

    def run(self, edit, docstring):
        self.view.insert(edit, self.view.size(), docstring)


def show_docstring_panel(view, docstring):
    """Show docstring in output panel.

    :param view (sublime.View): current active view
    :param docstring (basestring): python __doc__ string
    """
    window = sublime.active_window()

    if docstring:
        output = window.get_output_panel('help_panel')
        output.set_read_only(False)
        output.run_command('help_message', {'docstring': docstring})
        output.set_read_only(True)
        window.run_command('show_panel', {'panel': 'output.help_panel'})
    else:
        window.run_command('hide_panel', {'panel': 'output.help_panel'})
        sublime.status_message('Jedi: No results!')



class SublimeJediDocstring(PythonCommandMixin, sublime_plugin.TextCommand):