|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /proc/22697/root/usr/lib64/python2.4/site-packages/ |
Upload File : |
mò
äûEc @ sW d k Z d k Z d k Z d k Z d k l Z d „ Z d e i f d „ ƒ YZ d S( N( s Processorc C s! | d j o
t ‚ n t | ƒ S( sä
getBox: get a BlackBox from this module
@box_cfg: a box_cfg conformant AdmList element containing
the following elements:
path: type string, the path to the context file (required)
returns: Forge object
N( t box_cfgt Nonet
ValueErrort
ForgeBlackBox( R ( ( t3 /usr/lib64/python2.4/site-packages/ForgeBlackBox.pyt getBox s
R c B s t Z d Z d „ Z d „ Z RS( sŽ o
The ForgeBlackBox is the class which handles converting the xml with a XSLT
stylesheet and writing this as a configuration file
c C s[ d | _ | i i | _ d | _ d | _ d | _ d | _ t
i | ƒ | i
d ƒ i ƒ | _ yT t i | i t i ƒ o7 t i | i ƒ t i } t i | ƒ p
t ‚ q´ n Wn t d | i d ‚ n XyB | i
d ƒ i ƒ | _ | i d j o
d | _ n
d | _ Wn t d ‚ n Xy | i
d ƒ i ƒ | _ Wn t d
‚ n Xd S( s@
__init__: Initialize a ForgeBlackBox
@self: the class instance
@box_cfg: a box_cfg conformant AdmList element containing
the following elements:
xslstylesheetpath: a string
configfilepath: a string
mode: an integer
i i t xslstylesheetpaths\ ForgeBlackBox box_cfg must contain a 'xslstylesheetpath' entry pointing at a readable file (t )t configfilepatht
SPLITFILESs; ForgeBlackBox box_cfg must contain a 'configfilepath' entryt modes1 ForgeBlackBox box_cfg must contain a 'mode' entryN( t selft statust __class__t
__module__t met _errNoR t _errStrt readablet writablet Alchemistt validateBoxCfgR t getChildByNamet getValuet sspatht ost accesst R_OKt statt ST_MODER
t S_ISREGR t cfgpatht
splitfiles( R R R
( ( R t __init__ s6
c C so | i ƒ } | p d Sn t ƒ } | i | i ƒ | i | ƒ } | i
d j oY t i | i
t i t i Bt i B| i ƒ } t i | d ƒ } | i | ƒ | i ƒ nÀ t i d t i t i Bƒ } d } xš | o’ | i | ƒ } | p PqÑ | i d ƒ } t i | i d ƒ t i t i Bt i B| i ƒ } t i | d ƒ } | i | i d ƒ ƒ | i ƒ qÑ Wd S( sÛ
Extract xml, stylesheetpath and target file from the context
and create the configuration file.
@self: the class instance
@context: the context from which to extract information
i t ws^ ^--------CUTFILEHERE: (?P<filename>.*?)$(?P<content>.*?)^--------ENDFILEHERE?(?P<remaining>.*)i t remainingt filenamet contentN( t contextt toXMLt
xml_stringt Processort processort appendStylesheetFileR R t runStringt resultR R t openR t O_WRONLYt O_CREATt O_TRUNCR
t fdt fdopent filet writet closet ret compilet MULTILINEt DOTALLt myregt matcht searcht group( R R&