«

»

Sep 01

Sublime Dark IEP

[important] Updates for Pyzo 4.X can be found here : Blog Callicode [/important]

From IEP Website :

—- snip —
IEP is a cross-platform Python IDE aimed at interactivity and introspection.
Its practical design is aimed at simplicity and efficiency.
IEP consists of an editor, a shell, and a set of tools to
help the programmer in various ways.
— snip —

I use IEP in every day work and I like it. From my point of view, everything is perfect… except the syntax hilighter colors.
And IEP is not themable yet.
Nevertheless, IEP is written in Python and you just have to edit one file to change the editor colors. I recently tried Sublime Text (wonderful… but not free) and found the colors theme very nice.

This post shows you how to use IEP with (not exactly) Sublime Text colors.
Open iep/source/iep/codeeditor/base.py and look for the __init__ method :

    def __init__(self,*args, **kwds):
        ....
        S["Editor.Line numbers"] = "back:%s, fore:%s" % (back2, back3)
 
        # Apply style
        self.setStyle(S)
        ....

Just add a few lines :

    def __init__(self,*args, **kwds):
        ....
        S["Editor.Line numbers"] = "back:%s, fore:%s" % (back2, back3)
 
        theme = "SubInsp"
        if theme == "SubInsp":
            back1, back2, back3 = "#272822", base02, base01
            fore1, fore2, fore3, fore4 = "#00ff00", "#0000ff", "#96df2b", base3
            lsyellow  = "#e6db72"
            lspink = "#f92672"
            lsgreen = "#96df2b"
            lsgrey = "#686c58"
            lslightpink = "#f9aeca" #"#f9d9e3"
            lsorange = "#f9da42"
            lslightblue = "#c5d9ff"
            lswhite = "#ffffff"
            lsflashyyellow="#fdff41"
            lsviolet = "#ae81f0"
            lsblueviolet = "#71a2ff"
            lsnightblue = "#073642"
            lsnightbluelight = "#586e75"
            lsdarkgrey = "#272822"
            lsflashyblue = "#128ee5"
            lsverydarkgrey = "#1b1c18"
 
            S  = {}
            S["Editor.text"] = "back:%s, fore:%s" % (lsdarkgrey, lslightblue)
            S['Syntax.identifier'] = "fore:%s, bold:no, italic:no, underline:no" % lswhite
            S["Syntax.nonidentifier"] = "fore:%s, bold:no, italic:no, underline:no" % lslightpink
            S["Syntax.keyword"] = "fore:%s, bold:no, italic:no, underline:no" % lspink
 
            S["Syntax.functionname"] = "fore:%s, bold:yes, italic:no, underline:no" % lsgreen
            S["Syntax.classname"] = "fore:%s, bold:yes, italic:no, underline:no" % lsorange
 
            S["Syntax.string"] = "fore:%s, bold:no, italic:no, underline:no" %lsyellow
            S["Syntax.unterminatedstring"] = "fore:%s, bold:no, italic:no, underline:dotted" % lsflashyyellow
            S["Syntax.python.multilinestring"] = "fore:%s, bold:no, italic:no, underline:no" % lsyellow
 
            S["Syntax.number"] = "fore:%s, bold:no, italic:no, underline:no" % lsviolet
            S["Syntax.comment"] ="fore:%s, bold:no, italic:no, underline:no" % lsgrey
            S["Syntax.todocomment"] = "fore:%s, bold:yes, italic:no, underline:yes" % lsflashyblue
            S["Syntax.python.cellcomment"] = "fore:%s, bold:yes, italic:no, underline:full" % lsorange
 
            S["Editor.Long line indicator"] = "linestyle:solid, fore:%s" % lsnightblue
            S["Editor.Highlight current line"] = "back:%s" % lsverydarkgrey
            S["Editor.Indentation guides"] = "linestyle:solid, fore:%s" % lsnightbluelight
            S["Editor.Line numbers"] = "back:%s, fore:%s" % (lsverydarkgrey, lsnightbluelight)
            S["Editor.BreakPoints"] = 'fore:%s,back:%s' %(lsflashyyellow, lsdarkgrey)
        self.setStyle(S)

[warning]Note the line: S[« Editor.BreakPoints »], necessary in IEP 3.3 to customize the new integrated debugger
[/warning]
Restart IEP et voilà !
To disable the theme, just comment the line  : theme = "SubInsp"

Take a look at the result before having a try :

dark_iep

Sur le même thème :

Featuring WPMU Bloglist Widget by YD WordPress Developer