_apache.py
9.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
###############################################################################
# Name: apache.py #
# Purpose: Define Apache syntax for highlighting and other features #
# Author: Cody Precord <cprecord@editra.org> #
# Copyright: (c) 2007 Cody Precord <staff@editra.org> #
# License: wxWindows License #
###############################################################################
"""
FILE: apache.py
AUTHOR: Cody Precord
@summary: Lexer configuration module for Apache Configuration Files
"""
__author__ = "Cody Precord <cprecord@editra.org>"
__svnid__ = "$Id: _apache.py 68798 2011-08-20 17:17:05Z CJP $"
__revision__ = "$Revision: 68798 $"
#-----------------------------------------------------------------------------#
# Imports
import wx.stc as stc
# Local Imports
import synglob
import syndata
#-----------------------------------------------------------------------------#
#---- Keyword Definitions ----#
DIRECTIVES = (0, 'acceptmutex acceptpathinfo accessconfig accessfilename '
'action addalt addaltbyencoding addaltbytype addcharset '
'adddefaultcharset adddescription addencoding addhandler '
'addicon addiconbyencoding addiconbytype addinputfilter '
'addlanguage addmodule addmoduleinfo addoutputfilter '
'addoutputfilterbytype addtype agentlog alias aliasmatch all '
'allow allowconnect allowencodedslashes allowoverride '
'anonymous anonymous_authoritative anonymous_logemail '
'anonymous_mustgiveemail anonymous_nouserid '
'anonymous_verifyemail assignuserid authauthoritative '
'authdbauthoritative authdbgroupfile authdbmauthoritative '
'authdbmgroupfile authdbmtype authdbmuserfile authdbuserfile '
'authdigestalgorithm authdigestdomain authdigestfile '
'authdigestgroupfile authdigestnccheck authdigestnonceformat '
'authdigestnoncelifetime authdigestqop authdigestshmemsize '
'authgroupfile authldapauthoritative authldapbinddn '
'authldapbindpassword authldapcharsetconfig '
'authldapcomparednonserver authldapdereferencealiases '
'authldapenabled authldapfrontpagehack authldapgroupattribute '
'authldapgroupattributeisdn authldapremoteuserisdn '
'authldapurl authname authtype authuserfile bindaddress '
'browsermatch browsermatchnocase bs2000account bufferedlogs '
'cachedefaultexpire cachedirlength cachedirlevels '
'cachedisable cacheenable cacheexpirycheck cachefile '
'cacheforcecompletion cachegcclean cachegcdaily '
'cachegcinterval cachegcmemusage cachegcunused '
'cacheignorecachecontrol cacheignoreheaders '
'cacheignorenolastmod cachelastmodifiedfactor cachemaxexpire '
'cachemaxfilesize cacheminfilesize cachenegotiateddocs '
'cacheroot cachesize cachetimemargin cgimapextension '
'charsetdefault charsetoptions charsetsourceenc checkspelling '
'childperuserid clearmodulelist contentdigest cookiedomain '
'cookieexpires cookielog cookiename cookiestyle '
'cookietracking coredumpdirectory customlog dav '
'davdepthinfinity davlockdb davmintimeout defaulticon '
'defaultlanguage defaulttype define deflatebuffersize '
'deflatecompressionlevel deflatefilternote deflatememlevel '
'deflatewindowsize deny directory directoryindex '
'directorymatch directoryslash documentroot dumpioinput '
'dumpiooutput enableexceptionhook enablemmap enablesendfile '
'errordocument errorlog example expiresactive expiresbytype '
'expiresdefault extendedstatus extfilterdefine '
'extfilteroptions fancyindexing fileetag files filesmatch '
'forcelanguagepriority forcetype forensiclog from group '
'header headername hostnamelookups identitycheck ifdefine '
'ifmodule imapbase imapdefault imapmenu include indexignore '
'indexoptions indexorderdefault isapiappendlogtoerrors '
'isapiappendlogtoquery isapicachefile isapifakeasync '
'isapilognotsupported isapireadaheadbuffer keepalive '
'keepalivetimeout languagepriority ldapcacheentries '
'ldapcachettl ldapconnectiontimeout ldapopcacheentries '
'ldapopcachettl ldapsharedcachefile ldapsharedcachesize '
'ldaptrustedca ldaptrustedcatype limit limitexcept '
'limitinternalrecursion limitrequestbody limitrequestfields '
'limitrequestfieldsize limitrequestline limitxmlrequestbody '
'listen listenbacklog loadfile loadmodule location '
'locationmatch lockfile logformat loglevel maxclients '
'maxkeepaliverequests maxmemfree maxrequestsperchild '
'maxrequestsperthread maxspareservers maxsparethreads '
'maxthreads maxthreadsperchild mcachemaxobjectcount '
'mcachemaxobjectsize mcachemaxstreamingbuffer '
'mcacheminobjectsize mcacheremovalalgorithm mcachesize '
'metadir metafiles metasuffix mimemagicfile minspareservers '
'minsparethreads mmapfile modmimeusepathinfo multiviewsmatch '
'namevirtualhost nocache noproxy numservers nwssltrustedcerts '
'nwsslupgradeable options order passenv pidfile port '
'protocolecho proxy proxybadheader proxyblock proxydomain '
'proxyerroroverride proxyiobuffersize proxymatch '
'proxymaxforwards proxypass proxypassreverse '
'proxypreservehost proxyreceivebuffersize proxyremote '
'proxyremotematch proxyrequests proxytimeout proxyvia qsc '
'readmename redirect redirectmatch redirectpermanent '
'redirecttemp refererignore refererlog removecharset '
'removeencoding removehandler removeinputfilter '
'removelanguage removeoutputfilter removetype requestheader '
'require resourceconfig rewritebase rewritecond rewriteengine '
'rewritelock rewritelog rewriteloglevel rewritemap '
'rewriteoptions rewriterule rlimitcpu rlimitmem rlimitnproc '
'satisfy scoreboardfile script scriptalias scriptaliasmatch '
'scriptinterpretersource scriptlog scriptlogbuffer '
'scriptloglength scriptsock securelisten sendbuffersize '
'serveradmin serveralias serverlimit servername serverpath '
'serverroot serversignature servertokens servertype setenv '
'setenvif setenvifnocase sethandler setinputfilter '
'setoutputfilter singlelisten ssiendtag ssierrormsg '
'ssistarttag ssitimeformat ssiundefinedecho '
'sslcacertificatefile sslcacertificatepath '
'sslcarevocationfile sslcarevocationpath '
'sslcertificatechainfile sslcertificatefile '
'sslcertificatekeyfile sslciphersuite sslengine sslmutex '
'ssloptions sslpassphrasedialog sslprotocol '
'sslproxycacertificatefile sslproxycacertificatepath '
'sslproxycarevocationfile sslproxycarevocationpath '
'sslproxyciphersuite sslproxyengine '
'sslproxymachinecertificatefile '
'sslproxymachinecertificatepath sslproxyprotocol '
'sslproxyverify sslproxyverifydepth sslrandomseed sslrequire '
'sslrequiressl sslsessioncache sslsessioncachetimeout '
'sslusername sslverifyclient sslverifydepth startservers '
'startthreads suexecusergroup threadlimit threadsperchild '
'threadstacksize timeout transferlog typesconfig unsetenv '
'usecanonicalname user userdir virtualdocumentroot '
'virtualdocumentrootip virtualhost virtualscriptalias '
'virtualscriptaliasip win32disableacceptex xbithack')
PARAMS = (1, 'on off standalone inetd force-response-1.0 downgrade-1.0 '
'nokeepalive indexes includes followsymlinks none x-compress '
'x-gzip warn')
#---- End Keyword Definitions ----#
#---- Syntax Style Specs ----#
SYNTAX_ITEMS = [(stc.STC_CONF_COMMENT, 'comment_style'),
(stc.STC_CONF_DEFAULT, 'default_style'),
(stc.STC_CONF_DIRECTIVE, 'keyword_style'),
(stc.STC_CONF_EXTENSION, 'pre_style'),
(stc.STC_CONF_IDENTIFIER, 'number_style'),
(stc.STC_CONF_IP, 'number2_style'),
(stc.STC_CONF_NUMBER, 'number_style'),
(stc.STC_CONF_OPERATOR, 'operator_style'),
(stc.STC_CONF_PARAMETER, 'global_style'),
(stc.STC_CONF_STRING, 'string_style')]
#---- Extra Properties ----#
#-----------------------------------------------------------------------------#
class SyntaxData(syndata.SyntaxDataBase):
"""SyntaxData object for Apache Conf files"""
def __init__(self, langid):
super(SyntaxData, self).__init__(langid)
# Setup
self.SetLexer(stc.STC_LEX_CONF)
def GetKeywords(self):
"""Returns Specified Keywords List """
return [DIRECTIVES, PARAMS]
def GetSyntaxSpec(self):
"""Syntax Specifications """
return SYNTAX_ITEMS
def GetCommentPattern(self):
"""Returns a list of characters used to comment a block of code """
return [u'#']