当前位置: 首页>>代码示例>>Python>>正文


Python StatsPaths.getStatsPathFromMachine方法代码示例

本文整理汇总了Python中pxStats.lib.StatsPaths.StatsPaths.getStatsPathFromMachine方法的典型用法代码示例。如果您正苦于以下问题:Python StatsPaths.getStatsPathFromMachine方法的具体用法?Python StatsPaths.getStatsPathFromMachine怎么用?Python StatsPaths.getStatsPathFromMachine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pxStats.lib.StatsPaths.StatsPaths的用法示例。


在下文中一共展示了StatsPaths.getStatsPathFromMachine方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: transfer

# 需要导入模块: from pxStats.lib.StatsPaths import StatsPaths [as 别名]
# 或者: from pxStats.lib.StatsPaths.StatsPaths import getStatsPathFromMachine [as 别名]
def transfer( login, machine ):
    """
        @summary : Transfers all the required files
                   from specified machine into local 
                   machine.
    
                   Every task is done 10 times.
        
                   This is done in hope that everything 
                   downloaded will be as coherent as possible.
        
                   If a large amount of file is to 
                   be transferred, some files that were downloaded
                   at the beginning of the transfer,wich can take 
                   up to a few hours,might not be as up to date as 
                   the file downloaded towards the end of the transfer  
   
           
    """    
    
    statsPaths = StatsPaths()
    statsPaths.setPaths()
    
    localPaths = getLocalPathsToSynchronise()
    buildLocalPaths( localPaths )
    configFiles = getConfigFiles()
            
    for i in range( 10 ):
                
        transferLogFiles()
        
        for localPath in localPaths :
            remotePath = statsPaths.getStatsPathFromMachine( localPath, machine, login )
            print "rsync -avzr  --delete-before -e ssh %[email protected]%s:%s %s"  %( login, machine, remotePath, localPath )
            output = commands.getoutput( "rsync -avzr  --delete-before -e ssh %[email protected]%s:%s %s"  %( login, machine, remotePath, localPath ) )
            print output        
             
            
    for configfile in configFiles:
        #get real path 
        localPath = os.path.dirname( configfile )
        fileName  = os.path.basename( configfile )
        remotePath = statsPaths.getStatsPathFromMachine( localPath, machine, login )
        
        print "rsync -avzr  --delete-before -e ssh %[email protected]%s:%s %s"  %( login, machine, remotePath + fileName, localPath + fileName )
        output = commands.getoutput( "rsync -avzr  --delete-before -e ssh %[email protected]%s:%s %s"  %( login, machine, remotePath + fileName, localPath + fileName ) )
        print output       
开发者ID:hawkeye438,项目名称:metpx,代码行数:49,代码来源:retreiveDataFromMachine.py


注:本文中的pxStats.lib.StatsPaths.StatsPaths.getStatsPathFromMachine方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。