;ò èF6Fc@sÓdkZdkZdkZdkZdklZdkTdklZl Z dk Tdk l Z dk Td„ZdddgZd „Zhad aead „ZhZd „Zd „Zd d„Zd„ZdS(N(s str2dictlist(s*(s recipe_errors option_error(s getrpstackc CsÊ|odpd}tƒo t|||d|ƒdSnt||ƒ}dk l }hdd<dd<dd <d d <d d <d d <d d <d d<dd<dd<dd<dd<dd<} |oY| i hdd<dd<dd<dd<dd<dd<dd<dd<ƒn||||| ƒ\}} }| ot|| |ƒnt|ƒdjot|tdƒ|ƒnt||||d |d|dddƒdS( sÏImplementation of ":copy -x from to" and ":move -x from to". When "copy" is non-zero copying is done, otherwise moving. "arg" is the whole argument. "line_nr" is used for error messages.s:copys:moves N(sget_argssfsforcesis interactivesesexistsexistssmsmkdirscscontinuesqsquietsusunlinkspspreservesrs recursiveskskeepdiris*%s command requires at least two argumentsiÿÿÿÿiserrmsg(scopyscmdnames skip_commandssmsg_skipsline_nrsrecdictsargs getrpstacksrpstacksCommandssget_argssoptsupdates optiondictsattrdicts argdictlists option_errorslens recipe_errors_sremote_copy_move( sline_nrsrecdictsargscopys optiondictsrpstacks argdictlistscmdnamesget_argssoptsattrdict((s-/mnt/gmirror/ports/devel/aap/work/CopyMove.pys copy_moves"  {YsrcpsscpsrsynccCsÇdkl}||||ƒdkl} l} l}|djo d| |ƒ|||f}n_|djo d||ƒ|||f}n2t idd|ƒ}d| |ƒ|||f}tidjot||ƒ\} }n t|d |ƒd j} d }|o¯t||ƒti|d ƒ}|d joHti|d |ƒ} | d joti|d|| ƒ}q„d}n|d jpti|dƒd jo d } q¿ti|dƒd jo d } q¿ti|dƒd jo d } q¿ti|dƒd jo d } q¿ti|dƒd jo…d } t|tdƒƒ|djo |} ntii|ƒ} d|| f}t||ƒd jot||ƒd j} q»q¿n| SdS(s¨ Use rcp, scp or rsync, specified with "scheme" to copy "fromfile" (with "fcount" file names in quotes) to tmach:destpath. Return non-zero for success. (s assert_pkg(sget_progname_rsyncsget_progname_rcpsget_progname_scpsrcps %s %s '%s:%s'sscps([()])s\\\1sposixs{interactive} iss connection tos srefusediÿÿÿÿslost connectionsPermission deniedsRead-only file systemsNot a directorysNo such file or directorys4looks like the directory does not exist, creating itisssh %s mkdir -p %sN(!s DoInstalls assert_pkgsrpstacksrecdictsschemesRemotesget_progname_rsyncsget_progname_rcpsget_progname_scpsfromfilestmachsdestpathscmdsressubsdsossnamesredir_system_intsokstexts logged_systemsmsg_logsstringsfindsisesmsg_infos_sfcountsdirnamespathsmkdircmd(srpstacksrecdictsschemesfromfilestmachsdestpathsfcountsmkdircmdstextsget_progname_rcpsdirnamesget_progname_rsyncsesoksdsiscmds assert_pkgsget_progname_scp((s-/mnt/gmirror/ports/devel/aap/work/CopyMove.pys scheme_copyDsR         &       !icCs|dk}to tƒnxTtiƒD]F}y|iƒWq(|ij o }tht dƒ|ƒq(Xq(WhadS(s= Close all cached ftp connections. Invoked on exit. Ns$could not quit an ftp connection: %s( sftplibs old_exitfuncsftp_connsvaluessftpsquits all_errorssesmsg_logs_(sftplibsesftp((s-/mnt/gmirror/ports/devel/aap/work/CopyMove.pys ftpCloseAll—s    cCs |tiƒjot|dfSnd} d}t} d}ti |dƒ}|djoÈ|| } ||d}ti | dƒ}|djo| |d} | | } qŸ| d|} t i| ƒ} | oLtdƒ| |f}ydk}|i|ƒ} Wq t|ƒ} q XqŸn|d} |}dk}yE|iƒ}|i|ƒ}|tjo d} n|\} }} Wnt|ifj o } nXdk} yÌ| iƒ}ti |dƒ}|djo#|i|d|!||dƒn|i|ƒ| djoV| djo8|djo|i| | |ƒqe|i| | ƒqs|i| ƒn |iƒWn4| i j o%} tdƒ|t!| ƒf}nUX| o| o| t | ¢sskeepdirsexistsfile already exists: "%s"s interactives"%s" exists, overwrite? (y/n) s#yY up to four chars that mean yesisfile not copiedsfile not moved(s dir_contentscCs hd|ósspreservesCannot copy "%s" to "%s": %ssCopied "%s" to "%s"sMoved "%s" to "%s"(s url_downloads Cannot download "%s" to "%s": %ssUploading to "%s"sMoving "%s" to "%s"sUploading "%s" to "%s"s/cCsŒdk}t}yt|dƒ}Wntj o }|SnXy|i d||dƒWn|i j o}|}nX|i ƒ|SdS(NsrbsSTOR i ( sftplibsNoneserrorsopensfromfilesfsIOErrorsesftps storbinarysdestpaths all_errorssclose(sftpsfromfilesdestpathsftplibsesfserror((s-/mnt/gmirror/ports/devel/aap/work/CopyMove.pys store_fileJs    s-Directory created, attempt uploading again...sCannot upload "%s" to "%s": %ss's' sCannot upload "%s" to "%s"sUploaded to "%s"sUploaded "%s" to "%s"(s url_cleanup(^sRemotes url_split3sglobsfailedsfromlists from_itemssasfnamesfschemesfmachsfpathsosspaths expandusersfs argexpandsflslens optiondictsgets has_wildcards recipe_errorsrpstacks_scopyslsisdirsextendsexpand_unescapesappendsto_itemstnamestschemestmachstpathsdirpathsdirnamesmay_create_dirsrecdictsmsgs ftpConnectsftpsscheme_copy_namess msg_errorsmaps scheme_filessscheme_filelistsschemesjoinsdestsdestpathsbasenamesexistssmsg_notes raw_inputsreplysrenamesdonesshutilsmkdirsCommandss dir_contentssflistshas_keysoptsremote_copy_moveserrmsgscopy2sIOErrorsOSErrorsesstrsdeltreesremoves shorten_namesmsg_infos url_downloadstmpfilesrtimesfromfiles postponedssepsstringsreplaces store_fileserrors ftp_may_mkdirs scheme_copys url_cleanupsfilessfilelistsshorten_dictlists str2dictlistsdl(2srpstacksrecdictscopys from_itemssto_items optiondicts argexpandserrmsgsfromlistsfiless dir_contentssscheme_filelistsrtimestmpfilesdonesfilelistsdirpathsshutilsftps url_downloads url_split3sfmachsfschemes store_filesfailedsfnamestnamesreplysfromfilesoptsdlsdestsdestpathsglobstschemesflistsflsmsgsasschemesesfstpaths scheme_filesslsfpaths url_cleanupstmachserrors postponed((s-/mnt/gmirror/ports/devel/aap/work/CopyMove.pysremote_copy_move,s           4     @  !%   /         !%           !                '/     ! cCs‹tii|ƒ osy4ti|ƒ| ot|tdƒ|ƒnWq‡t j o,}t |tdƒ|t |ƒfƒq‡XndS(s6 Create directory "dir" if it does not exist. sCreated directory "%s"s0Destination directory "%s" cannot be created: %sN(sosspathsexistssdirsmakedirssquietsmsg_infosrecdicts_s StandardErrorses recipe_errorsrpstacksstr(srecdictsrpstacksdirsquietse((s-/mnt/gmirror/ports/devel/aap/work/CopyMove.pysmay_create_dir°s (sossos.pathsstringsresDictlists str2dictlistsErrorsProcesss recipe_errors option_errorsUtilsWorks getrpstacksMessages copy_movesscheme_copy_namess scheme_copysftp_connsdid_set_exitfuncsNones old_exitfuncs ftpCloseAllsftp_passs ftpConnects ftp_may_mkdirsremote_copy_movesmay_create_dir(s getrpstacksstrings str2dictlistsmay_create_dirs scheme_copys option_errorsresftp_passs recipe_errors ftpConnects copy_movesremote_copy_movesoss ftpCloseAlls ftp_may_mkdirsscheme_copy_names((s-/mnt/gmirror/ports/devel/aap/work/CopyMove.pys? s,       ) O  f  ÿ…