# 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
    def __init__(self, parent=None, line_num_margin=3, autocomplete_list=None):
        super(PythonEditor, self).__init__(parent, line_num_margin, autocomplete_list)

        # Set Python lexer
        self.lexer = QsciLexerPython(self)
        self.lexer.setDefaultFont(self.editor_font)
        self.lexer.setFont(self.editor_font, QsciLexerPython.Comment)
        # Indentation warning ("The indentation is inconsistent when compared to the previous line")
        self.lexer.setIndentationWarning(QsciLexerPython.Inconsistent)
        # Set auto-completion
        self.api = QsciAPIs(self.lexer)
        if autocomplete_list is not None:
            # Add additional completion strings
            for i in autocomplete_list:
                self.api.add(i)
        self.api.prepare()
        self.setAutoCompletionThreshold(3)
        self.setAutoCompletionSource(QsciScintilla.AcsAll)
        self.setAutoCompletionUseSingle(QsciScintilla.AcusExplicit)
        self.setLexer(self.lexer)

        # PEP8 tabs
        self.setIndentationsUseTabs(False)
        self.setAutoIndent(True)
        self.setIndentationGuides(True)
        
        # PEP8 edge column line
        self.edgecol = 80

        # Linters

# 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

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

        # Set Python lexer
        self.lexer = QsciLexerPython(self)
        self.lexer.setDefaultFont(self.editor_font)
        self.lexer.setFont(self.editor_font, QsciLexerPython.Comment)
        # Indentation warning ("The indentation is inconsistent when compared to the previous line")
        self.lexer.setIndentationWarning(QsciLexerPython.Inconsistent)
        # Set auto-completion
        self.api = QsciAPIs(self.lexer)
        if autocomplete_list is not None:
            # Add additional completion strings
            for i in autocomplete_list:
                self.api.add(i)
        self.api.prepare()
        self.setAutoCompletionThreshold(3)
        self.setAutoCompletionSource(QsciScintilla.AcsAll)
        self.setAutoCompletionUseSingle(QsciScintilla.AcusExplicit)
        self.setLexer(self.lexer)

        # PEP8 tabs
        self.setIndentationsUseTabs(False)
        self.setAutoIndent(True)
        self.setIndentationGuides(True)
        
        # PEP8 edge column line
        self.edgecol = 80

        # Linters

        self.linter = 'internal'