# 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



class BaseEditor(QsciScintilla):
    editor_changed = QtCore.pyqtSignal()

    lintErrorMarkerNum = 8
    lintWarnMarkerNum = 9
    colorErrorForeground = '#a94442'
    colorErrorBackground = '#f2dede'
    colorWarnForeground = '#8a6d3b'
    colorWarnBackground = EDITOR_CARET_LINE_COLOR

    def __init__(self, parent=None, line_num_margin=3, autocomplete_list=None):
        super(BaseEditor, self).__init__(parent)

        # Set the default font
        self.editor_font = QFont()
        self.editor_font.setFamily(EDITOR_FONT)
        self.editor_font.setFixedPitch(True)
        self.editor_font.setPointSize(EDITOR_FONT_SIZE)
        self.setFont(self.editor_font)
        self.setMarginsFont(self.editor_font)

        # Default to UTF-8 encoding
        self.setUtf8(True)

        # Margin is used for line numbers
        fontmetrics = QFontMetrics(self.editor_font)
        self.setMarginsFont(self.editor_font)

# 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




class BaseEditor(QsciScintilla):
    editor_changed = QtCore.pyqtSignal()

    lintErrorMarkerNum = 8
    lintWarnMarkerNum = 9
    colorErrorForeground = '#a94442'
    colorErrorBackground = '#f2dede'
    colorWarnForeground = '#8a6d3b'
    colorWarnBackground = EDITOR_CARET_LINE_COLOR

    def __init__(self, parent=None, line_num_margin=3, autocomplete_list=None):
        super(BaseEditor, self).__init__(parent)

        # Set the default font
        self.editor_font = QFont()
        self.editor_font.setFamily(EDITOR_FONT)
        self.editor_font.setFixedPitch(True)
        self.editor_font.setPointSize(EDITOR_FONT_SIZE)
        self.setFont(self.editor_font)
        self.setMarginsFont(self.editor_font)

        # Default to UTF-8 encoding
        self.setUtf8(True)

        # Margin is used for line numbers
        fontmetrics = QFontMetrics(self.editor_font)
        self.setMarginsFont(self.editor_font)

        margin_width = '0' * (line_num_margin + 1)