# Path: fiddle/helpers/linter.py
# class LinterError(Exception):
# class LinterUnexpectedError(LinterError):
# class LinterSyntaxError(LinterError):
#     def __init__(self, filename):
#     def __str__(self):
#     def __init__(self, filename):
#     def __str__(self):
#     def __init__(self, filename, msg, lineno, offset, text):
#     def __str__(self):
# def check(codeString, filename):
# 
# Path: fiddle/config.py
# EDITOR_CARET_LINE_COLOR = '#ffffe0'
# 
# EDITOR_FONT = 'Consolas'
# 
# EDITOR_FONT_SIZE = 10
# 
# EDITOR_MARGIN_COLOR = '#cccccc'
# 
# EDITOR_EDGECOL_COLOR = '#dddddd'


import os
import autopep8
from PyQt4 import QtCore
from PyQt4.QtGui import *
from PyQt4.Qsci import QsciScintilla, QsciAPIs, QsciLexerPython, QsciLexerHTML, QsciLexerJavaScript, QsciLexerCSS
from fiddle.helpers import linter
from fiddle.config import EDITOR_CARET_LINE_COLOR, EDITOR_FONT, EDITOR_FONT_SIZE, \
    EDITOR_MARGIN_COLOR, EDITOR_EDGECOL_COLOR
        Slot that catches margin clicks. The linter puts error and warning markers in the margin
        :param int marnum: marker number in the list of markers (starting at 1)
        :param int linenum: line number where marker was clicked
        :param QtCore.KeyboardModifiers modifiers: any keyboard modifiers (Ctrl, Shift, Alt)
        :return:
        """
        pass

    def _clear_all_margin_markers(self):
        self.markerDeleteAll(-1)

    def _add_error_margin_marker(self, line):
        self.markerAdd(line, self.lint_err_marker)

    def _add_warn_margin_marker(self, line):
        self.markerAdd(line, self.lint_warn_marker)

    def _init_margin_popup(self):
        self._margin_popup_lbl.setText('')
        layout = QVBoxLayout(self._margin_popup)
        layout.addWidget(self._margin_popup_lbl)
        self._margin_popup.setLayout(layout)

        self._margin_popup.setWindowFlags(QtCore.Qt.Popup)
        self._margin_popup.setFocusPolicy(QtCore.Qt.NoFocus)
        self._margin_popup.setFocusProxy(self)

        self._margin_popup.setWindowOpacity(0.95)
        self._margin_popup.setStyleSheet('background-color:%s' % self.colorWarnBackground)


# Path: fiddle/helpers/linter.py
# class LinterError(Exception):
# class LinterUnexpectedError(LinterError):
# class LinterSyntaxError(LinterError):
#     def __init__(self, filename):
#     def __str__(self):
#     def __init__(self, filename):
#     def __str__(self):
#     def __init__(self, filename, msg, lineno, offset, text):
#     def __str__(self):
# def check(codeString, filename):
# 
# Path: fiddle/config.py
# EDITOR_CARET_LINE_COLOR = '#ffffe0'
# 
# EDITOR_FONT = 'Consolas'
# 
# EDITOR_FONT_SIZE = 10
# 
# EDITOR_MARGIN_COLOR = '#cccccc'
# 
# EDITOR_EDGECOL_COLOR = '#dddddd'


# Path: fiddle/controllers/Editors.py
import os
import autopep8
from PyQt4 import QtCore
from PyQt4.QtGui import *
from PyQt4.Qsci import QsciScintilla, QsciAPIs, QsciLexerPython, QsciLexerHTML, QsciLexerJavaScript, QsciLexerCSS
from fiddle.helpers import linter
from fiddle.config import EDITOR_CARET_LINE_COLOR, EDITOR_FONT, EDITOR_FONT_SIZE, \
    EDITOR_MARGIN_COLOR, EDITOR_EDGECOL_COLOR

        Slot that catches margin clicks. The linter puts error and warning markers in the margin
        :param int marnum: marker number in the list of markers (starting at 1)
        :param int linenum: line number where marker was clicked
        :param QtCore.KeyboardModifiers modifiers: any keyboard modifiers (Ctrl, Shift, Alt)
        :return:
        """
        pass

    def _clear_all_margin_markers(self):
        self.markerDeleteAll(-1)

    def _add_error_margin_marker(self, line):
        self.markerAdd(line, self.lint_err_marker)

    def _add_warn_margin_marker(self, line):
        self.markerAdd(line, self.lint_warn_marker)

    def _init_margin_popup(self):
        self._margin_popup_lbl.setText('')
        layout = QVBoxLayout(self._margin_popup)
        layout.addWidget(self._margin_popup_lbl)
        self._margin_popup.setLayout(layout)

        self._margin_popup.setWindowFlags(QtCore.Qt.Popup)
        self._margin_popup.setFocusPolicy(QtCore.Qt.NoFocus)
        self._margin_popup.setFocusProxy(self)

        self._margin_popup.setWindowOpacity(0.95)
        self._margin_popup.setStyleSheet('background-color:%s' % self.colorWarnBackground)


    def _show_margin_popup(self, msg, bg_color=EDITOR_CARET_LINE_COLOR):