Bug fix: closing the file
[codimension.git] / dumplexersettings.py
blob50098da509b45d816a96f38cc7858026fca5c73a
1 #!/usr/bin/python
3 # File: dumplexersettings.py
5 # Author: Sergey Satskiy
7 # Date: Mar 24, 2011
9 # $Id$
12 from PyQt4.Qsci import QsciLexerBash, QsciLexerBatch, QsciLexerCMake, \
13 QsciLexerCPP, QsciLexerCSharp, \
14 QsciLexerCSS, QsciLexerDiff, QsciLexerD, \
15 QsciLexerFortran77, QsciLexerFortran, \
16 QsciLexerHTML, QsciLexerIDL, QsciLexerJava, \
17 QsciLexerJavaScript, QsciLexerLua, \
18 QsciLexerMakefile, QsciLexerPascal, \
19 QsciLexerPerl, QsciLexerPostScript, \
20 QsciLexerPOV, QsciLexerProperties, \
21 QsciLexerPython, QsciLexerRuby, \
22 QsciLexerSQL, QsciLexerTCL, \
23 QsciLexerTeX, QsciLexerVHDL, QsciLexerXML, \
24 QsciLexerYAML
26 def colorToString( color ):
27 " Converts the QColor to string "
28 return str( color.red() ) + "," + \
29 str( color.green() ) + "," + \
30 str( color.blue() ) + "," + \
31 str( color.alpha() )
33 def dumpLexer( lexer ):
34 " Dumps a single lexer settings to the stdout "
36 print "[" + lexer.language() + "]"
38 indexes = []
39 for style in range( 256 ):
40 description = lexer.description( style )
41 if description == "":
42 continue
43 print "description" + str( style ) + "=" + description
45 # print "defaultColor" + str( style ) + "=" + colorToString( lexer.defaultColor( style ) )
46 # print "defaultPaper" + str( style ) + "=" + colorToString( lexer.defaultPaper( style ) )
47 # print "defaultEolFill" + str( style ) + "=" + str( lexer.defaultEolFill( style ) )
48 # print "defaultFont" + str( style ) + "=" + lexer.defaultFont( style ).toString()
50 print "color" + str( style ) + "=" + colorToString( lexer.color( style ) )
51 print "paper" + str( style ) + "=" + colorToString( lexer.paper( style ) )
52 print "eolFill" + str( style ) + "=" + str( lexer.eolFill( style ) )
53 print "font" + str( style ) + "=" + lexer.font( style ).toString()
54 indexes.append( str( style ) )
56 print "indexes=" + ",".join( indexes )
57 print ""
58 return
61 dumpLexer( QsciLexerPython() )
62 dumpLexer( QsciLexerBash() )
63 dumpLexer( QsciLexerBatch() )
64 dumpLexer( QsciLexerCMake() )
65 dumpLexer( QsciLexerCPP() )
66 dumpLexer( QsciLexerCSharp() )
67 dumpLexer( QsciLexerCSS() )
68 dumpLexer( QsciLexerDiff() )
69 dumpLexer( QsciLexerD() )
70 dumpLexer( QsciLexerFortran77() )
71 dumpLexer( QsciLexerFortran() )
72 dumpLexer( QsciLexerHTML() )
73 dumpLexer( QsciLexerIDL() )
74 dumpLexer( QsciLexerJava() )
75 dumpLexer( QsciLexerJavaScript() )
76 dumpLexer( QsciLexerLua() )
77 dumpLexer( QsciLexerMakefile() )
78 dumpLexer( QsciLexerPascal() )
79 dumpLexer( QsciLexerPerl() )
80 dumpLexer( QsciLexerPostScript() )
81 dumpLexer( QsciLexerPOV() )
82 dumpLexer( QsciLexerProperties() )
83 dumpLexer( QsciLexerRuby() )
84 dumpLexer( QsciLexerSQL() )
85 dumpLexer( QsciLexerTCL() )
86 dumpLexer( QsciLexerTeX() )
87 dumpLexer( QsciLexerVHDL() )
88 dumpLexer( QsciLexerXML() )
89 dumpLexer( QsciLexerYAML() )