Ñò i'dWc@s×dZddkZddkZddkZddkZddkZddkZddklZddk l Z ddk l Z ddk lZddklZd„Zd efd „ƒYZd efd „ƒYZdS( sD Class for keeping track of bookkeeping information for checkpoints iÿÿÿÿN(tdeepcopy(tizip(t get_argspec(t DataObject(tINSTALL_LOGGER_NAMEc CsË|iƒ}t|ƒ}t|iƒ}tƒ}|it|i|ƒƒxV|iD]K}||jo8||jot|dƒ‚qž|i|ƒ|||iD]3}||jo td||||fƒ‚qGqGWt|ƒ} |i djo-| djo td| t|ƒfƒ‚ndS(sX Make sure all required and keyword parameters are passed in to the constructor of the checkpoint class. Python 2.7's inspect module has a getcallargs() function that does what this function does. So, when we migrate to Python 2.7 or higher, this function can be replaced with the one from Python 2.7. s#is specified twice in the argumentsisMArgument %s is required, but not specified. spec = %s, args = %s, kwargs = %sispVariable keyword argument not expected, but %d unexpected keyword argument supplied. Unexpected keywords are: %sN(tcopyRtlentargstdicttupdateRt TypeErrortpoptdefaultstNonetreversedtkeystkeywordststr(tfuncRtkwargst kwargs_copytspect num_spec_argst arg_valuetarg_t default_valtitdefaulttkeytkey_t var_kw_len((s../checkpoint_data.pytvalidate_function_args.sB            tCheckpointRegistrationDatacBsPeZdZd„Zd„Zd„Zd„Zed„ƒZed„ƒZ RS(sD All values stored here are provided during checkpoint registration cCs™||_||_||_||_||_|djotƒ|_nt|ƒ|_|djot ƒ|_ nt|ƒ|_ t i ||ƒdS(N( tcp_nametmod_namet module_pathtcheckpoint_class_nametloglevelR tlisttreg_argsRRt reg_kwargsRt__init__(tselftnameR"R#R$R%RR((s../checkpoint_data.pyR)ns       cCso|i|ijo\|i|ijoI|i|ijo6|i|ijo#|i|ijo|i|ijS(N(R!R"R#R$R'R((R*tother((s../checkpoint_data.pyt__eq__ƒs cCs|i|ƒ S(N(R-(R*R,((s../checkpoint_data.pyt__ne__‹scCsdS(s< Data to be used by engine only, will not be written to XML N(R (R*((s../checkpoint_data.pytto_xmlŽscCsdS(s; Data to be used by engine only, will not be retrieved XML N(R (tclstxml_node((s../checkpoint_data.pytfrom_xml’scCstS(s; Data to be used by engine only, will not be retrieved XML (tFalse(R0R1((s../checkpoint_data.pyt can_handle—s( t__name__t __module__t__doc__R)R-R.R/t classmethodR2R4(((s../checkpoint_data.pyR ls    tCheckpointDatacBsVeZdZd„Zd„Zed„ƒZd„Zdd„Z d„Z d„Z RS( sŒ This is used for storing checkpoint related value that's generated, and used by engine. The values here are not stored in the DOC cCsât|||||||ƒ|_titd|ƒ|_d|_d|_t |_ d|_ d|_ t idƒ|_t idƒ|_t idƒ|_|o ||_n tƒ|_|o ||_n tƒ|_dS(Nt.t0(R tcp_infotloggingt getLoggerRtloggerR tmodtcheckpoint_classR3t completedtzfs_snaptdata_cache_pathtdecimaltDecimaltprog_esttprog_est_ratiot prog_reportedRR&RR(R*R+R"R#R$R%RR((s../checkpoint_data.pyR)¢s$         cCsÑ|iidj o~t}x2tiD]'}|iii|ƒo t}Pq#q#W|p8|ii |iidƒt i |iidt ƒq‘n|i ƒddg}|i |iƒt|i||iƒdS(s6 Validate the information provided for the checkpoint s is not in sys.paths is not in sys.path.R*tcheckpoint_nameN(R<R#R R3tsystpatht startswithtTrueR?twarntwarningstRuntimeWarningt _load_moduletextendRRRAR(R*t in_sys_pathtpath_targs_chk((s../checkpoint_data.pytvalidate_checkpoint_info¼s"     cCs |iiS(s& Make it easier to get the name value (R<R!(R*((s../checkpoint_data.pyR+ÛscCs˜|iio,|iid|i|ii|iiƒn |iid|i|iiƒ|i|ii|iiƒ|_t|i|ii ƒ|_ dS(s@ Load the checkpoint into memory. This will not instantiate it s7Loading checkpoint %s by module name (%s) and path (%s)s)Loading checkpoint %s by module name (%s)N( R<R#R?tdebugR+R"t_load_module_from_pathR@tgetattrR$RA(R*((s../checkpoint_data.pyRRàs     c Cs€d|jo|iddƒ}n|}|idƒ}t|ƒ}|djo}xztd|ƒD]e}di|| ƒ}di|| ƒ}|tijo)|iid|ƒ|i ||ƒ} qaqaWnd } |tijo¢ti|} |d j o„t i i||ƒ} | i i| ƒpX|ii|d| i dd| ƒti|d| i dd| tƒd } q‚q†n| d joé|d jo/|iid|ƒti|ƒ\} } }nN|iid ||ƒti||gƒ\} } }|iid | | |ƒzCyti|} Wn+tj oti|| | |ƒ} nXWd | o| iƒnXn| S( s/ Load a module given it's name, and maybe path.t/R:isLoading parent module '%s's is previous loaded from s!. It will be overwritten by the s copy from sLoading module name '%s's(Loading module name '%s' using path '%s's;Loading module: file = %s pathname = %s description = %sN(treplacetsplitRtrangetjoinRKtmodulesR?RXRYR tosRLt__file__RMRORPRQtimpt find_moduletKeyErrort load_moduletclose(R*R"R#tpy_module_nametpy_module_name_partst num_partsRt parent_modtparent_mod_dotst_modt found_moduletfull_ptfile_tpathnametdesc((s../checkpoint_data.pyRYñsT      !       cCs%|i|ii|i|iŽ}|S(s Instantiate the checkpoint (RAR<R+RR(R*t checkpoint((s../checkpoint_data.pytload_checkpoint>s cCs |iiS(N(R<R!(R*((s../checkpoint_data.pyt__str__EsN( R5R6R7R)RWtpropertyR+RRR RYRtRu(((s../checkpoint_data.pyR9s    M (R7RERcR=RaRKRPRRt itertoolsRtsolaris_install.utilsRtsolaris_install.data_objectRtsolaris_install.loggerRRR tobjectR9(((s../checkpoint_data.pyts       >1