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 :  /proc/21585/root/usr/lib64/python2.4/site-packages/sabayon/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21585/root/usr/lib64/python2.4/site-packages/sabayon/userprofile.pyc
mò
»fEOc@sdkZdkZdkZdkZeidƒdkZdkTdkZdkZdk	Z	d„Z
dfd„ƒYZda
d„Zdeifd„ƒYZeieƒd	fd
„ƒYZdeifd„ƒYZeieƒd
eifd„ƒYZeieƒd„ZdS(Ns2.0(t*cGstiti||ƒdS(N(tutiltdebug_printtDEBUG_USERPROFILEtfmttargs(RR((t9/usr/lib64/python2.4/site-packages/sabayon/userprofile.pytdprintstModuleLoadercBs;tZdZd„Zd„Zd„Zd„Zd„ZRS(s–Loads all python modules from a directory allows objects
    to be constructed from said modules using specific constructors
    for each object type.cCs ||_g|_|iƒdS(sgConstruct a ModuleLoader and will load all available
        python modules from @module_path.
        N(tmodule_pathtselftmodulest_ModuleLoader__load_modules(R
R	((Rt__init__%s		cBsoed|ƒd|}y|dUWn5eid||fIJeideiƒdSnX|ii	|ƒdS(s#Load a python module named @module.sLoading module: %ssfrom sources import %sNs%Failed to import module '%s' cmd="%s"tfile(
Rtmoduletcmdtsyststderrt	tracebackt	print_excR
Rtappend(R
RR((Rt
__load_module-s

cCs™td|iƒtii|iƒxoti|iƒD][}|ddjoq6n|ddjoq6n|djoq6n|i	|d ƒq6WdS(s1Load all available modules from self.module_path.sLoading modules from %sit.iýÿÿÿs.pys__init__.pyN(
RR
R	RtpathRtostlistdirRt_ModuleLoader__load_module(R
R((Rt__load_modules9s
cBs“ed||ƒd|||||f}y|dUWn3d||eifGHeideiƒdSnXy
|}Wnej
odSnX|S(s‡Construct an object by invoking a function named @constructor,
        with @arg as an argument, in the module called @module.
        s2Constructing object from loaded module using %s.%ssJfrom sources import %s
if %s.__dict__.has_key ('%s'):    ret = %s.%s (arg)Ns%Failed to invoke function '%s.%s': %sR(RRtconstructorRRtexc_typeRRRtNonetrett	NameError(R
RRtargRR ((Rt__construct_objectFs
	cCsQg}xD|iD]9}|i|||ƒ}|djo|i	|ƒqqW|S(såConstruct and return a list of objects by invoking a function
        named @constructor, with @arg as an argument, in each of the
        python modules in self.module_path which contain a function
        by that name.
        N(
tobjectsR
RRt_ModuleLoader__construct_objectRR"toRR(R
RR"R&R$R((Rtconstruct_objects[s

(t__name__t
__module__t__doc__R
RRR%R'(((RR s			
	cCs<tdjo+ttiitiitƒdƒƒantS(s'Return a singleton ModuleLoader object.tsourcesN(t
module_loaderRRRRtjointdirnamet__file__(((Rtget_module_loaderis

+t
ProfileChangecBsPtZdZed„Zd„Zd„Zd„Zd„Zd„Z	d„Z
RS(s6Abstract base class for encapsulating profile changes.cCs&tii|ƒ||_||_dS(siConstruct a ProfileChange object.

        source: the ProfileSource from which the change came.
        N(tgobjecttGObjectR
R
tsourcetdelegate(R
R4R5((RR
ss	cCs|iS(s2Get the ProfileSource from which this change came.N(R
R4(R
((Rt
get_source|scCstdƒ‚dS(s?Return and identifier for the configuration item which changed.sNot implementedN(t	Exception(R
((Rtget_id€scCstdƒ‚dS(s7Return a short description of the configuration change.sNot implementedN(R7(R
((Rtget_short_description„scCstS(s>Returns the default value for the ignore item for this change.N(tFalse(R
((Rtget_ignore_defaultˆscCsdS(sEReturns the mandatory value of the change, or None to use the defaultN(R(R
((Rt
get_mandatoryŒscCstS(sYMerges info from previous change into this change. Return True to discard the new change.N(R:(R
t
old_change((Rtmerge_old_changes(R(R)R*RR
R6R8R9R;R<R>(((RR1ps						tSourceDelegatecBsktZdZd„Zd„Zd„Zd„Zed„Zd„Z	d„Z
d„Zd	„Zd
„Z
RS(s†An abstract base class for helper classes which can be used
    to intercept and modify changes from a given configuration
    source.cCs||_||_||_dS(sÿConstruct a SourceDelegate object.

        @source: the ProfileSource whose changes the delegate wishes
        to inspect.
        @namepsace_section: the section of @source's configuration
        namespace that the delegate wishes to inspect.
        N(t
delegate_nameR
tnameR4tnamespace_section(R
R@R4RB((RR
›s		cCs|iS(s*Returns the configuration delegate's name.N(R
RA(R
((Rtget_name§scCs|S(s–Returns a human readable description for @path.
        @path must have been previously added by the delegate to the
        #ProfileStorage.
        N(R(R
R((Rtget_path_description«scCstdƒ‚dS(sÊInspect a ProfileChange. Return #True if the change should
        not be passed on any further (i.e. #True == 'handled') and
        return #False if the change should be passed on unmodified.
        sNot implementedN(R7(R
tchange((Rt
handle_change²scCstdƒ‚dS(sCommit a change to profile.

        mandatory: whether the change should be committed such
        that it overrides the user's value.
        sNot implementedN(R7(R
REt	mandatory((Rt
commit_change¹scCstdƒ‚dS(s+Start monitoring for configuration changes.sNot implementedN(R7(R
((Rtstart_monitoringÁscCstdƒ‚dS(s*Stop monitoring for configuration changes.sNot implementedN(R7(R
((Rtstop_monitoringÅscCstdƒ‚dS(s#Save all committed changes to disk.sNot implementedN(R7(R
((Rtsync_changesÉscCstdƒ‚dS(s/Temporary make mandatory setting non-mandatory.sNot implementedN(R7(R
tenforce((Rtset_enforce_mandatoryÍscCstdƒ‚dS(s0Apply profile to the current user's environment.sNot implementedN(R7(R
tis_sabayon_session((RtapplyÑs(R(R)R*R
RCRDRFR:RHRIRJRKRMRO(((RR?–s								t
ProfileSourcecBs˜tZdZhdeieieff<Zed„Z	d„Z
d„Zd„Zd„Z
ed„Zd„Zd	„Zd
„Zd„Zd„ZRS(
sJAn abstract base class which each configuration source must
    implement.tchangedcCsOtii|ƒ||_tƒ}g|_|o|i
||ƒ|_ndS(s!Construct a ProfileSource object.N(R2R3R
R
tsource_nameRAR0R,t	delegatestdelegate_constructorR'(R
RRRTR,((RR
Ýs			cCs3x,|iD]!}|iƒ|jo|Sq
q
WdS(s'Return a delegate named @delegate_name.N(R
RSR5RCR@R(R
R@R5((Rtget_delegateès
cCs|iS(s(Returns the configuration source's name.N(R
RA(R
((RRCïscCs|S(s”Returns a human readable description for @path.
        @path must have been previously added by the source to the
        #ProfileStorage.
        N(R(R
R((RRDóscCs|xe|iD]Z}|iƒi|iƒpq
n|i|ƒo$td|i	ƒ|iƒƒdSq
q
W|i
d|ƒdS(sŸPass @change to all register delegates for this source and
        emit a 'changed' signal with @change if none of the delegates
        return #True.
        s!Delegate '%s' handled change '%s'NRQ(R
RSR5RER8t
startswithRBRFRRCtemit(R
RER5((Rtemit_changeús
cCsH|io:|ii||ƒtd|iiƒ|iƒƒtSntS(sCommit a change to profile.

        mandatory: whether the change should be committed such
        that it overrides the user's value.
        s$Delegate '%s' committed changes '%s'N(	RER5RHRGRRCR8tTrueR:(R
RERG((RRHs
cCstdƒ‚dS(s+Start monitoring for configuration changes.sNot implementedN(R7(R
((RRIscCstdƒ‚dS(s*Stop monitoring for configuration changes.sNot implementedN(R7(R
((RRJscCstdƒ‚dS(s#Save all committed changes to disk.sNot implementedN(R7(R
((RRKscCstdƒ‚dS(s/Temporary make mandatory setting non-mandatory.sNot implementedN(R7(R
RL((RRMscCstdƒ‚dS(s0Apply profile to the current user's environment.sNot implementedN(R7(R
RN((RRO#s(R(R)R*R2tSIGNAL_RUN_LASTt	TYPE_NONER1t__gsignals__RR
RURCRDRXR:RHRIRJRKRMRO(((RRPÕs!				
				tUserProfilecBs€tZdZhdeieieff<Zd„Zd„Z	d„Z
d„Zd„Zd„Z
d„Zd	„Zd
„ZRS(s9An encapsulation of the user profile and backend sources.RQcCs¶tii|ƒtd|ƒ||_ti|ƒ|_tƒ}g|_
|id|iƒ|_
tdt|i
ƒƒx7|i
D],}td|iƒƒ|id|iƒq‚WdS(s®Construct a UserProfile

	profile_name: name of the profile to be loaded
        module_path: optional path from which configuration modules
        should be loaded
        sConstructing profile from %sR6s%d sources loaded:s  %sRQN(R2R3R
R
Rtprofile_nametstoragetProfileStorageR0R,R+R'tlenR4RCtconnectt#_UserProfile__handle_source_changed(R
R^R4R,((RR
0s
			
cCs|id|ƒdS(NRQ(R
RWRE(R
R4RE((Rt__handle_source_changedKscCs3x,|iD]!}|iƒ|jo|Sq
q
WdS(s#Return a source named @source_name.N(R
R+R4RCRRR(R
RRR4((RR6Ns
cCs<x5|iD]*}|i|ƒ}|dj	o|Sq
q
WdS(s'Return a delegate named @delegate_name.N(R
R+R4RUR@R5R(R
R@R4R5((RRUUs

cCsJtdƒx9|iD].}|iƒx|iD]}|iƒq.WqWdS(s+Start monitoring for configuration changes.sStarting monitoringN(RR
R+tsRIRSR5(R
R5Re((RRI]s



cCsJtdƒx9|iD].}x|iD]}|iƒq$W|iƒqWdS(s*Stop monitoring for configuration changes.sStopping monitoringN(RR
R+ReRSR5RJ(R
R5Re((RRJhs


cCsWtdƒx9|iD].}x|iD]}|iƒq$W|iƒqW|iiƒdS(s#Save all committed changes to disk.s%Syncing all committed changes to diskN(	RR
R+ReRSR5RKR_tsave(R
R5Re((RRKps


cCsPtdƒx?|iD]4}|i|ƒx|iD]}|i|ƒq1WqWdS(s/Temporary make mandatory setting non-mandatory.s4Changing mandatory enforcement in user's environmentN(RR
R+ReRMRLRSR5(R
RLReR5((RRMys



cCsPtdƒx?|iD]4}|i|ƒx|iD]}|i|ƒq1WqWdS(s0Apply profile to the current user's environment.s&Applying profile to user's environmentN(RR
R+ReRORNRSR5(R
RNReR5((RROs



(R(R)R*R2RZR[R1R\R
RcR6RURIRJRKRMRO(((RR])s!									c
Csdtfd„ƒY}dtfd„ƒY}dtfd„ƒY}tdƒ}t|i	ƒdjpt
‚d}x/|i	D]$}|iƒd	jo|}Pq{q{W|djpt
‚t|iƒd
jpt
‚|ƒ}|i	i|ƒd„}|id||ƒt|i	ƒd
jpt
‚||ƒ}|ii|ƒdad
„}	|id|	ƒ|i||ddƒƒ|i||ddƒƒ|i||ddƒƒ|i|iddƒƒ|i|iddƒƒ|i|iddƒƒtdjpt
‚dS(NtLocalTestChangecBs#tZd„Zd„Zd„ZRS(NcCs&ti||ƒ||_||_dS(N(R1R
R
R4tkeytvalue(R
R4RhRi((RR
s	cCs|iS(N(R
Rh(R
((RR8”scCs|iS(N(R
Rh(R
((RR9–s(R(R)R
R8R9(((RRgs		tLocalTestDelegatecBstZd„Zd„ZRS(NcCsti|d|dƒdS(Ntlocals/bar(R?R
R
R4(R
R4((RR
šscCs|iƒdjotSntS(Ns	/bar/foo1(RER8RYR:(R
RE((RRFœs(R(R)R
RF(((RRj™s	tLocalTestSourcecBstZd„ZRS(NcCsti|dƒdS(NRk(RPR
R
(R
((RR
¢s(R(R)R
(((RRl¡ssfoo-storageittesticCs|id|ƒdS(NRQ(tprofileRWRE(R4RERn((Rthandle_source_changed²sRQcCstd7adS(Ni(t	n_signals(RnRE((Rthandle_changed¼ss	/bar/foo1t1s	/bar/foo2t2s	/bar/foo3t3s	/foo/bar1s	/foo/bar2s	/foo/bar3i(R1RgR?RjRPRlR]RnRaR+tAssertionErrorRt
testsourceR4RCRStlocalsourceRRoRbt
localdelegateRpRqRXtget_test_change(
RlRwRgR4RjRvRnRoRxRq((Rtrun_unit_testsŽs>

				(Rtos.pathRtpygtktrequireR2tconfigR_RRRRRR,R0R3R1t
type_registerR?RPR]Rz(R?RR0RzRR_R|RRR1RPR2RRR]((Rt?s(								H	$
?R
`


Anon7 - 2021