/usr/lib64/python2.6/site-packages/mx/Misc
NameSizeModeActions
Cache.py67380644editdlrm
Cache.pyc64820644editdlrm
Cache.pyo64820644editdlrm
CommandLine.py187060644editdlrm
CommandLine.pyc183610644editdlrm
CommandLine.pyo183610644editdlrm
ConfigFile.py295410644editdlrm
ConfigFile.pyc330040644editdlrm
ConfigFile.pyo330040644editdlrm
Cookie.py56250644editdlrm
Cookie.pyc57070644editdlrm
Cookie.pyo57070644editdlrm
COPYRIGHT10300644editdlrm
CSV.py185200644editdlrm
CSV.pyc181440644editdlrm
CSV.pyo181440644editdlrm
ExitFunctions.py23080644editdlrm
ExitFunctions.pyc28600644editdlrm
ExitFunctions.pyo28600644editdlrm
FileLock.py124190644editdlrm
FileLock.pyc120250644editdlrm
FileLock.pyo120250644editdlrm
LazyModule.py44000644editdlrm
LazyModule.pyc42440644editdlrm
LazyModule.pyo42440644editdlrm
LICENSE45870644editdlrm
Namespace.py154550644editdlrm
Namespace.pyc180510644editdlrm
Namespace.pyo180510644editdlrm
OrderedMapping.py131070644editdlrm
OrderedMapping.pyc150530644editdlrm
OrderedMapping.pyo150530644editdlrm
PackageTools.py116810644editdlrm
PackageTools.pyc113460644editdlrm
PackageTools.pyo113460644editdlrm
__init__.py00644editdlrm
__init__.pyc1410644editdlrm
__init__.pyo1410644editdlrm
Edit: /usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyo (33004B)
Ńņ ÄÅVHc@sYdZddkZddkZddkZddkZddkZddkZddkZddkZ ddk l Z ddk Z dZ deifd„ƒYZeidƒZeied„Zd dRd „ƒYZd „Zd efd „ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZeieieed„Zeieieed„Zdefd„ƒYZeZ eZ!defd„ƒYZ"e"Z#e"Z$defd„ƒYZ%de"fd„ƒYZ&defd„ƒYZ'd efd!„ƒYZ(d"efd#„ƒYZ)d$efd%„ƒYZ*d&e(fd'„ƒYZ+d(e'fd)„ƒYZ,d*e(fd+„ƒYZ-d,e'fd-„ƒYZ.d.e+fd/„ƒYZ/d0efd1„ƒYZ0d2e0fd3„ƒYZ1d4e1fd5„ƒYZ2d6efd7„ƒYZ3d8efd9„ƒYZ4d:efd;„ƒYZ5d<efd=„ƒYZ6d>efd?„ƒYZ7d@efdA„ƒYZ8dBefdC„ƒYZ9dDefdE„ƒYZ:dFe i fdG„ƒYZ;dHe;fdI„ƒYZ<eidJƒZ=eidKƒZ>dLdSdM„ƒYZ?e@dNjoTdOe;fdP„ƒYZAdQZBddkCZCeCiDeBƒZEe?eAƒZFeFiGeEƒndS(Ts8 ConfigFile -- Interface to simple template based configuration files. The format of these files is as follows: globalvar = 2 [ABC] a = 1 b = abc.html c = text with spaces [DEF] a = 2 b = a + 3 c = a string Entries in square brackets indicate new subsections. Global variables may be set prior to starting any subsection. Emtpy lines and lines starting with '#' (comments) are ignored. Indentation is not necessary; lines can start at any column. Entries may span multiple lines by using '' continuations at the line ends, e.g. [Continuation] a = first line second line The lines are stripped of any white space before removing the trailing '' and concatenating them. Comment lines are removed as well. To parse these files, a template in form of a class including subclasses (identifying the subsections) must be given to the reader. This template defines which sections and attributes are known. All others are rejected. A sample template for the above looks like this: from mx.Misc.ConfigFile import * class Template(ConfigNamespace): global = IntegerEntry() class ABC(ConfigSection): a = IntegerEntry('0') b = StringEntry('default.html') c = StringEntry() class DEF(ConfigSection): a = IntegerEntry('0') b = EvalEntry('0') c = StringEntry('default value') The main class representing the global namespace of the ini file must have ConfigNamespace as baseclass. It may contain any number of ConfigSection subclasses each defining parsed attributes. The ini file may only contain entries defined in this template. In case an unknown section is found, the main class is looked up for a ConfigSection subclass with name 'DefaultSection'. This section object is then taken as template for a new section of the given name. The same feature is available for attributes in sections. In case a given attribute is not found in the templates, the section's 'DefaultAttribute' attribute is deepcopied and the used as attribute template. Needs mxTools to be installed. XXX Add support for long strings (including embedded control characters and spanning multiple lines) Copyright (c) 2000, Marc-Andre Lemburg; All Rights Reserved. Copyright (c) 2000-2008, eGenix.com Software GmbH; All Rights Reserved. See the documentation for further information on copyrights, or contact the author. All Rights Reserved. i’’’’N(tfreezeitErrorcBseZRS((t__name__t __module__(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyRZss"(?:\$([a-zA-Z0-9._]+)|\${([^}]*)})cCszxs|i|ƒ}|pPn|iƒ}||dp|ddƒ}|d}|i|dƒ} | djo<|i|dƒ} | djotii|dƒ} q­nxH|dD]<} yt| | ƒ} Wqøtj otd| ‚qøXqøW|i ƒ\} } t | t ƒo=| } | i t jo| i| i||ƒn| i } n|| t| ƒ|| }q|S(sś Expands all variables of the form $var or ${var} using the dictionaries locals,globals,os.environ in that order as database. Default value is the empty string, just like for shell environment variables. iit.tsattribute "%s" undefinedN(tsearchtgroupstgettNonetostenvirontgetattrtAttributeErrorRtspant isinstancetEntrytvaluetNotGiventparsetdefaulttstr(ttexttlocalstglobalstsplitt shell_vartmtgtvarpathtvarnameRtattrtltrtentry((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyt expand_varsas4       RcBsbeZdZeZdZeeefZ ed„Z d„Z e i ed„Zd„Zd„ZRS(sŁ Converts the value to another datatype depending on the .converters attribute. Each of those functions is applied to the value. The first one to not raise an exception succeeds. RcCs|tj o ||_ndS(N(RR(tselfR((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyt__init__ s cCs†|it|ƒ||ƒ}xB|iD]1}y||ƒ}PWq%tiƒd}q%Xq%W|‚d}|i|||ƒ|_}|S(s¬ Parse text according to the namespace dictionaries locals and globals. Sets self.value and returns the parsed value as well. iN(t pre_processRt converterstsystexc_infoR t post_processR(R$RRRt converterRtlastexc((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR„s  cCs|||ƒ||ƒS(sˆ Preprocess the text value. Default behaviour is to strip the text and then apply variable expansion. ((R$RRRtstripR#((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR&»s cCs|S(sŠ Postprocess the value after conversion has been applied. The default behaviour is to leave it as it is. ((R$RRR((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR*ĒscCs7|itjo|i|ihhƒnt|iƒS(sŽ Return a stringified version of self.value. The default value is parsed in case no value has yet been set. (RRRRR(R$((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyt__str__Šs(RRt__doc__RRRtinttfloatRR'R%RtstringR-R#R&R*R.(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyRŒs   cCs t|dƒS(s~ Convert value to an integer. Takes base indicators into account, such as 0x for base-16, 0 for base-7. i(R0(R((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyt integer_valueŽst IntegerEntrycBseZdZefZRS(s' Converts the value to an integer. (RRR/R3R'(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR4čst FloatEntrycBseZdZefZRS(s$ Converts the value to a float. (RRR/R1R'(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR5īst NumericEntrycBseZdZeefZRS(s8 Converts the value to a number (integer or float). (RRR/R3R1R'(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR6ōst StringEntrycBseZdZefZRS(s% Converts the value to a string. (RRR/RR'(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR7śscCs||||dƒƒS(Nt,((RR-Rtmapttuple((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyt comma_listscCs||||ƒƒS(N((RR-RR9R:((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyt spaced_listst TupleEntrycBs eZdZefZd„ZRS(sŪ Converts the value to a tuple of strings. value must be a string with entries separated by ','. Entries are split at each occurance of ',' and then stripped of surrounding spaces. cCs t|ƒS(N(R:(R$RRR((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR*s(RRR/R;R'R*(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR= s t ListEntrycBseZdZefZRS(sŚ Converts the value to a list of strings. value must be a string with entries separated by ','. Entries are split at each occurance of ',' and then stripped of surrounding spaces. (RRR/R;R'(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR>stSpacedTupleEntrycBseZdZefZRS(sŲ Converts the value to a tuple of strings. value must be a string with entries separated by whitespace. Entries are split at each occurance of whitespace; surrounding spaces is removed. (RRR/R<R'(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR?.stSpacedListEntrycBseZdZefZRS(s× Converts the value to a list of strings. value must be a string with entries separated by whitespace. Entries are split at each occurance of whitespace; surrounding spaces is removed. (RRR/R<R'(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR@9st FileEntrycBseZdZefZRS(s! Entry field for an OS file. (RRR/RR'(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyRADst PathEntrycBs eZdZefZd„ZRS(sV Entry field for an OS path. Paths will always end with os.sep if given. cCs0|o%|dtijo|ti}n|S(Ni’’’’(R tsep(R$RRR((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR*Rs(RRR/RR'R*(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyRBJs tAbsoluteFileEntrycBs eZdZefZd„ZRS(sm Entry field for an absolute OS pathname. The pathname will always start with os.sep if given. cCs0|o%|dtijoti|}n|S(Ni(R RC(R$RRR((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR*as(RRR/RR'R*(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyRDXs tAbsolutePathEntrycBs eZdZefZd„ZRS(sq Entry field for an absolute OS path. The pathname will always start and end with os.sep if given. cCsY|oN|dtijoti|}n|dtijo|ti}qUn|S(Nii’’’’(R RC(R$RRR((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR*ps (RRR/RR'R*(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyREgs tRelativePathEntrycBs#eZdZed„Zd„ZRS(sŌ Entry field for relative paths. The path stored is the result of joining the given parameter with a basepath. basepath is subject to variable expansion at parsing time. cCs||_ti||ƒdS(N(tbasepathRBR%(R$RGR((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR%‚s cCs"tiit|i||ƒ|ƒS(N(R tpathtjoinR#RG(R$RRR((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR*‡s(RRR/RR%R*(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyRFys tRelativeFileEntrycBs#eZdZed„Zd„ZRS(sį Entry field for relative pathnames to files. The path stored is the result of joining the given parameter with a basepath. basepath is subject to variable expansion at parsing time. cCs||_ti||ƒdS(N(RGRBR%(R$RGR((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR%”s cCs"tiit|i||ƒ|ƒS(N(R RHRIR#RG(R$RRR((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR*™s(RRR/RR%R*(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyRJ‹s tExistingPathEntrycBseZdZd„ZRS(sl Checks value to point to an existing OS path. Raises an exception if the path does not exist. cCsT|o%|dtijo|ti}ntii|ƒptd|‚n|S(Ni’’’’snon existing path "%s"(R RCRHtexistsR(R$RRR((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR*£s (RRR/R*(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyRKstExistingFileEntrycBseZdZd„ZRS(si Checks value to point to an existing file. Raises an exception if the file does not exist. cCs1| ptii|ƒ otd|‚n|S(Nsnon existing file "%s"(R RHRLR(R$RRR((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR*±s(RRR/R*(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyRM«stExistingRelativePathEntrycBseZdZd„ZRS(sŹ Entry field for relative paths. The path stored is the result of joining the given parameter with a basepath. Raises an exception if the path does not exist. cCsLtiit|i||ƒ|ƒ}tii|ƒptd|‚n|S(Nsnon existing path "%s"(R RHRIR#RGRLR(R$RRR((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR*Ąs$(RRR/R*(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyRN·stURLEntrycBseZdZd„ZRS(s Entry field for URLs. The field takes a default value as argument. Needs mxHTMLTools to be installed. cCsddkl}|i|ƒS(Ni’’’’(t HTMLTools(tmxRPtURL(R$RRRRP((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR*Šs(RRR/R*(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyROĒstRelativeURLEntrycBs&eZdZded„Zd„ZRS(sĢ Entry field for relative URLs. A base URL can be set which is then urljoined with the value given. The field also takes a default value. Needs mxHTMLTools to be installed. RcCs||_ti||ƒdS(N(tbaseurlR7R%(R$RTR((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR%ßs cCs/ddkl}|it|i||ƒ|ƒS(Ni’’’’(RP(RQRPturljoinR#RT(R$RRRRP((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR*äs(RRR/RR%R*(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyRSÕs tAbsoluteURLEntrycBseZdZd„ZRS(sŗ Entry field for absolute URLs. A base URL can be set which is then urljoined with the value given. The field also takes a default value as second argument. cCs7ti||||ƒ}|iptd|‚n|S(Nsneed an absolute URL: "%s"(RSR*tabsoluteR(R$RRRturl((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR*ņs (RRR/R*(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyRVźst DateEntrycBseZdZd„ZRS(s› Date entry field. The value is stored using a DateTime instance. A time part is ignored. Needs mxDateTime to be installed. cCsddkl}||ƒS(Ni’’’’(tDateFromString(tmx.DateTime.ParserRZ(R$RRRRZ((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR*s(RRR/R*(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyRYłs t DateTimeEntrycBseZdZd„ZRS(s€ Date/time entry field. The value is stored using a DateTime instance. Needs mxDateTime to be installed. cCsddkl}||ƒS(Ni’’’’(tDateTimeFromString(R[R](R$RRRR]((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR*s(RRR/R*(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR\st TimeEntrycBseZdZd„ZRS(s  Time entry field. The value is stored using a DateTimeDelta instance. A date part is ignored. Needs mxDateTime to be installed. cCsddkl}||ƒS(Ni’’’’(tTimeFromString(R[R_(R$RRRR_((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR* s(RRR/R*(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR^s tDateTimeDeltaEntrycBseZdZd„ZRS(s‹ Date/time delta entry field. The value is stored using a DateTimeDelta instance. Needs mxDateTime to be installed. cCsddkl}||ƒS(Ni’’’’(tDateTimeDeltaFromString(R[Ra(R$RRRRa((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR*.s(RRR/R*(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR`%stRelativeDateTimeEntrycBseZdZd„ZRS(s‘ Relative date/time entry field. The value is stored using a RelativeDateTime instance. Needs mxDateTime to be installed. cCsddkl}||ƒS(Ni’’’’(tRelativeDateTimeFromString(R[Rc(R$RRRRc((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyR*<s(RRR/R*(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyRb3st EvalEntrycBseZdZed„ZRS(s  Allows simple calculations to be done using the current locals (the symbols defined in the class where the entry is located) and globals. cCs||||ƒ|_|iS(N(R(R$RRRteval((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyRHs(RRR/ReR(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyRdAst SafeEvalEntrycBseZdZed„ZRS(sÅ Allows simple calculations to be done using the current locals (the symbols defined in the class where the entry is located) and globals. Builtins are not available. cCs||||ƒ|_|iS(N(R(R$RRRtreval((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyRXs(RRR/RgR(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyRfOst DictEntrycBseZdZd„ZRS(s± Allows the construction of a Python dictionary. The entries value is taken as list of key: value pairs which are evaluated in the current locals (the symbols defined in the class where the entry is located) and globals. Parsing is left to the Python interpreter. The needed curly brackets {} are added by the parsing method. Sample: dict = 'a': (1,2,3), 'b': (3,4,5) cCs$td|d||ƒ|_|iS(Nt{t}(ReR(R$RRR((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyRos(RRR/R(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pyRh_stConfigNamespacecBs†eZdZdZeeieiei ei fei ei ei eifeieid„Zd„Zd„Zd„Zd„ZRS(c Cs|i}t|ƒ|i}|i|iƒxģ|iƒD]Ž\}} |d djo ||=nt| ƒ} | |jo2|djo!t| tƒo| ƒ||tStringListEntrytCommaListEntryR?R@RARBRDRERFRJRKRMRNRORSRVRYR\R^R`RbRdRfRhRkRsRR R•RR®Rt cStringIOtStringIOtftcfR¬(((s8/usr/lib64/python2.6/site-packages/mx/Misc/ConfigFile.pytOspT  )R     sĒ G