KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
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 :  /usr/lib64/python2.4/site-packages/sabayon/sources/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/python2.4/site-packages/sabayon/sources/gconfsource.pyc
mς
ΊfEOc@s>dkZdkZdkZdkZdkZdkZdkZdkZdkZy&dk	Z	dk
Z
dkZdkTWn5dk
l	Z	dk
l
Z
dk
lZdkTnXd„Zd„Zd„Zd„Zd	„Zd
e	ifd„ƒYZeieƒde	ifd
„ƒYZeieƒd„Zd„ZdS(N(t*(suserprofile(sstorage(sutilcGstiti||ƒdS(N(tutiltdebug_printtDEBUG_GCONFSOURCEtfmttargs(RR((tA/usr/lib64/python2.4/site-packages/sabayon/sources/gconfsource.pytdprint(scCs,tidd|dd|d|gƒdS(Nsgconftool-2s--config-source=%ss--apply-schemas%s(t
subprocesstcallt
config_sourcet
schema_keytkey(R
RR((Rtassociate_schema,scCslx;|i|ƒD]*}|io|i|i|iƒqqWx'|i|ƒD]}t
|||ƒqNWdS(N(t
src_clienttall_entriestdirtentrytvaluet
dst_clienttsetRtall_dirstsubdirt	copy_tree(RRRRR((RR/s
cCsUx'|i|ƒD]}|i|iƒqWx$|i|ƒD]}t||ƒq:WdS(N(	tclientRRRtunsetRRRtrecursive_unset(RRRR((RR7scCsryti|ƒWn2tj
o&}|itijo
|‚qFnXd|}ti	|ƒ}ti|ƒ|fS(Nsxml:readwrite:(tostmakedirstpathtOSErrorterrterrnotEEXISTtaddresstgconftengine_get_for_addresstenginetclient_get_for_engine(RR%RR"((Rtget_client_and_address_for_path=s
tGConfChangecBs;tZdZd„Zd„Zd„Zd„Zd„ZRS(s%Encapsulates a change to a GConf key.cCs2tii||ƒ||_||_d|_dS(s*Construct a GConfChange from a GConfEntry.N(	tuserprofilet
ProfileChanget__init__tselftsourceRRtNonet	mandatory(R,R-RR((RR+Js
		cCs|iS(s/Return the path to the GConf key which changed.N(R,R(R,((Rtget_idQscCsΩ|iptdƒ|iSn·|iitijo$tdƒ|i|iiƒfSn}|iitijo$tdƒ|i|iiƒfSnC|iiti	jo$tdƒ|i|iiƒfSn	|iiti
jo$tdƒ|i|iiƒfSnΟ|iitijo$tdƒ|i|iiƒfSn•|iitijo$tdƒ|i|iiƒfSn[|iiti
jo$tdƒ|i|iiƒfSn!td	ƒ|i|iiƒfSd
S(s3Return a short description of the GConf key change.sGConf key '%s' unsets!GConf key '%s' set to string '%s's"GConf key '%s' set to integer '%s's GConf key '%s' set to float '%s's"GConf key '%s' set to boolean '%s's!GConf key '%s' set to schema '%s'sGConf key '%s' set to list '%s'sGConf key '%s' set to pair '%s'sGConf key '%s' set to '%s'N(R,Rt_RttypeR#tVALUE_STRINGt	to_stringt	VALUE_INTtVALUE_FLOATt
VALUE_BOOLtVALUE_SCHEMAt
VALUE_LISTt
VALUE_PAIR(R,((Rtget_short_descriptionUs$
$$$$$$$cCs
||_dS(N(RR,R/(R,R((Rt
set_mandatoryjscCs|iS(N(R,R/(R,((Rt
get_mandatoryms(t__name__t
__module__t__doc__R+R0R;R<R=(((RR(Gs				tGConfSourcecBstZdZd„Zd„Zd„Zed„Zd„Zd„Z	d„Z
d„Zd	„Zd
„Z
d„Zd„Zd
„Zd„ZRS(sGConf user profile source.cCsntii|tdƒdƒ||_tiƒ|_d|_
d|_d|_d|_
d|_t|_dS(sBConstruct a GConfSource

        @storage: storage object
        tGConftget_gconf_delegateiN(R)t
ProfileSourceR+R,R1tstorageRtget_home_dirthome_dirR.Rt	notify_idtdefaults_clienttmandatory_clienttmandatory_alt_clienttTruetenforce_mandatory(R,RE((RR+us						cCs>|djotdƒSn |djotdƒSn|SdS(Ns.gconf.xml.defaultssDefault GConf settingss.gconf.xml.mandatorysMandatory GConf settings(RR1(R,R((Rtget_path_description…s


cCs|pX|ip:ttii|idƒƒ\}}||_||_
n|i|i
fSn·|ioX|ip:ttii|idƒƒ\}}||_||_
n|i|i
fSnU|ip:ttii|idƒƒ\}}||_||_n|i|ifSdS(sΪGet a GConfClient using either .gconf.xml.defaults or
        .gconf.xml.mandatory (in the temporary profile location)
        as its source.

        mandatory: whether to get the mandatory or defaults source
        s.gconf.xml.defaultss.gconf.xml.mandatorys.gconf.xml.mandatory-altN(R/R,RIR'RRtjoinRGRR"tdefaults_addressRMRJtmandatory_addressRKtmandatory_alt_address(R,R/RR"((Rt!get_committing_client_and_addresss$
$	


$	

$	
cCs§tii|||ƒodSn|i|ƒ\}}t	d|i
|ƒ|io|i|i
|iƒn|i
|i
ƒ|i|ƒ\}}|i
|i
ƒdS(s%Commit a GConf change to the profile.Ns!Committing change to '%s' to '%s'(R)RDt
commit_changeR,tchangeR/RSRR"RRRRR(R,RUR/RR"((RRT©s
cCs}|idjodSnd„}ttii|idƒƒ\|_}|ii
dtiƒ|ii
d||ƒ|_dS(sStart monitoring for GConf changes. Note that this
        is seriously resource intensive as must load the value
        of all existing keys so that we can determine whether
        a write to the database resulted in an actual change
        in the value of the key.
        iNcCs’td|iƒx?tD]7}ti|i|ƒotd|i|ƒdSqqWd}|i	ƒp
|i}n|it||i|ƒƒdS(NsGot GConf notification on '%s's;Ignoring GConf notification on '%s' because it matches '%s'(
RRRtGCONF_KEYS_TO_IGNOREtignore_patterntfnmatchtfnmatchcaseR.Rtget_is_defaultR,temit_changeR((Rtcnx_idRR,RWR((Rt
handle_notifyΖs


s.gconft/(R,RHR]R'RRRORGRR"tadd_dirR#tCLIENT_PRELOAD_RECURSIVEt
notify_add(R,R"R]((Rtstart_monitoringΌs	'cCsQ|idjodSn|ii|iƒd|_|iidƒd|_dS(s"Stop monitoring for GConf changes.iNR^(R,RHRt
notify_removet
remove_dirR.(R,((Rtstop_monitoringΪs	cCs|io|iiƒn|io|iiƒn|io|iiƒntidƒtii	tii
|idƒƒo |ii
d|i|iƒn|io
d}nd}tii	tii
|i|ƒƒo&|ii
d|i|id|ƒndS(s4Ensure that all committed changes are saved to disk.is.gconf.xml.defaultss.gconf.xml.mandatorys.gconf.xml.mandatory-alttsrc_pathN(R,RItsuggest_syncRJRKttimetsleepRRtexistsRORGREtaddtnameRMt
mandatory_src(R,Rm((Rtsync_changesδs



% 

%cCsy||ijodSntd|ƒ|itƒ\}}||_|itƒ\}}t
||dƒt|dƒdS(NsSetting enforce mandatory to %dR^(tenforceR,RMRRSRLt
old_clienttold_addressRR"RR(R,RoRpRqRR"((Rtset_enforce_mandatoryώs
	cCs2d„}|ii|iƒ}d|jo|iid|itƒndt	i
i|idƒ}|o(dt	i
i|idƒd|}n|t	i
i|idƒ|ƒd|jo|iid|itƒn|t	i
i|id	ƒdt	i
i|idƒƒtd
ƒtiddgƒd
S(s—Apply the profile by writing the default and mandatory
        sources location to ~/.gconf.path.defaults and
        ~/.gconf.path.mandatory.

        Note that $(sysconfdir)/gconf/2/path needs to contain
        something like the following in order for this to work:

        include $(HOME)/.gconf.path.mandatory
        xml:readwrite:$(HOME)/.gconf
        include $(HOME)/.gconf.path.defaults
        cCs»td||ƒ|d}yt|dƒ}Wnd}t|dƒ}nXy|i|dƒ|iƒWn(|djot	i
|ƒn‚nX|djot	i||ƒndS(s°Write a GConf path file. First try writing to a
            temporary file and move it over the original. Failing
            that, write directly to the original.
            s)Writing GConf path file with '%s' to '%s's.newtws
N(RR-tfilenamettemptfiletfR.twritetcloseRtremovetrename(RtR-RuRw((Rtwrite_path_files"


RBs.gconf.xml.defaultss
xml:readonly:s.gconf.xml.mandatory-alts
s.gconf.path.defaultss.gconf.xml.mandatorys.gconf.path.mandatorys1Shutting down gconfd so it kill pick up new pathssgconftool-2s
--shutdownN(sGConfs.gconf.xml.defaults(sGConfs.gconf.xml.mandatory(R|R,REtlistRltstorage_contentstextractRGRLRRROtdefault_pathtis_sabayon_sessionRRR	(R,RR€R~R|((Rtapplys	
(

cCs|ii|||ƒS(N(R,RRaRthandlertdata(R,RRƒR„((Rtadd_gconf_notifyDscCs|ii|ƒS(N(R,RRctid(R,R†((Rtremove_gconf_notifyGscCsG|itƒ\}}|i|dtƒ}|o|iotSnt	S(Nt(
R,RSRLRR"t	get_entryRRRtFalse(R,RRR"R((Rtget_gconf_key_is_mandatoryJs
cCsbtitiƒ}|i|ƒt|||ƒ}|i
|ƒ|ii||ƒ|i
|ƒdS(N(R#tValueR7tgconf_valuetset_boolRR(R,RRUR<R/RR[(R,RRR/RRU((Rtset_gconf_booleanQs

c
CsΜtitiƒ}g}xQ|D]I}ti|ƒ}|ti	jo|i
|ƒnt‚|i|ƒqW|i
|ƒ|i|ƒt|||ƒ}	|	i|ƒ|ii|||ƒ|i|	ƒdS(N(R#RŒR9RR}Rtitemt	list_typet
item_valueR3t
set_stringtNotImplementedErrortappendt
set_list_typetset_listR(R,RRUR<R/RR[(
R,RR‘RR/R’RR}RRU((Rtset_gconf_listYs


(R>R?R@R+RNRSRŠRTRbReRnRrR‚R…R‡R‹RR˜(((RRArs					
		
	9				cCs
t|ƒS(N(RARE(RE((Rt
get_sourcelscCs’tiƒ}tiitiƒdƒ}tii|ƒoti	|ƒnt
tidƒƒ}yHti	tiitiƒdƒƒti	tiitiƒdƒƒWnnXtiddgƒtidƒtiddd	gƒtidƒgad
„}|id|ƒ|iƒd„}|iid
tƒ||ƒ|iid
tƒ||ƒ|iidtƒ||ƒ|iiddƒ||ƒ|iƒti ƒ|_t!tƒdjpt"‚tdi#djpt"‚|i$tdƒtdi#djpt"‚|i$tdtƒtdi#d
jpt"‚tdi#d
jpt"‚tiddd	gƒ|i%ƒ|i&tƒti'tiitiƒdƒti(ƒpt"‚ti'tiitiƒdƒti(ƒpt"‚|ii)ƒ|ii*ddtƒ}|i,pt"‚|i,i-ti.jpt"‚|i,i/ƒdjpt"‚|i0ƒpt"‚|i1ƒpt"‚|ii*ddtƒ}|i,pt"‚|i,i-ti2jpt"‚|i,i3ƒtjpt"‚|i0ƒpt"‚|i1ƒpt"‚tiddgƒtidƒti	tiitiƒdƒƒti	tiitiƒdƒƒtii|ƒoti	|ƒndS(Nsgconf-test.zipt	GConfTests.gconf.path.defaultss.gconf.path.mandatorysgconftool-2s
--shutdownis--recursive-unsets/tmp/test-gconfprofilecCsti|ƒdS(N(tchangesR•RU(R-RU((Rthandle_changedŽstchangedcCs2x+|iƒiƒo|iƒitƒqWdS(N(t	main_looptget_contexttpendingt	iterationRŠ(Rž((Rtpollšss/tmp/test-gconfprofile/t1s/tmp/test-gconfprofile/t2s/tmp/test-gconfprofile/t3iiiiRˆ(4tgobjecttMainLoopRžRRROtgetcwdtprofile_pathRjRzR™REtProfileStorageR-RRFRR	RhRiR›RœtconnectRbR’RRŽRLRŠtset_intReR#tclient_get_defaulttlentAssertionErrorRRTRnR‚taccesstF_OKtclear_cacheR‰RRR2R5tget_intRZtget_is_writableR7tget_bool(R’RRžR-RœR¦((Rtrun_unit_testsrsz"&

	
	






22

""(Rtos.pathtshutilRhR R£R#RXRR)RERtconfigtsabayontsabayon.configRR
RRR'R*R(t
type_registerRDRAR™R³(R
R™R³R R(RRER'RRRXRRRhR#R£R΅RRAR)((Rt?s:												


					
)
ψ
	

Anon7 - 2021