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


Python StatsPaths.getAllStatsPaths方法代码示例

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


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

示例1: translateAllOfPxStatsPaths

# 需要导入模块: from pxStats.lib.StatsPaths import StatsPaths [as 别名]
# 或者: from pxStats.lib.StatsPaths.StatsPaths import getAllStatsPaths [as 别名]
 def translateAllOfPxStatsPaths( formerLanguage, newLanguage ):
     """
         
         @summary : Browses through all of pxStats paths and 
                    translate(moves) all the original path from the 
                    former language to new paths in accordance 
                    to the specified path found in the new languages's
                    translation file.
         
         
         @param formerLanguage: Former language in which the application was running.
         
         @param newLanguage: language in which the application will be running.
         
         @return : None
         
         @warning: ***THIS method should NOT be used while the applicatio nis being used.***
                   ***Make sure no process' are using any of pxStats applications prior to using.***
     
     """
     
     statsPaths = StatsPaths()
     statsPaths.setPaths()
     
     formerLanguagePaths = statsPaths.getAllStatsPaths(formerLanguage)
     newLanguagePaths    = statsPaths.getAllStatsPaths( newLanguage )
     combinedPaths = []
     
     for formerPath, newPath in formerLanguagePaths, newLanguagePaths:
         combinedPaths.append( ( formerPath, newPath ) )
     
     combinedPaths.sort()
     
     for formerPath, newPath in combinedPaths:
         destination = os.path.dirname( formerPath ) + os.path.basename( newPath )  
         print "mv %s %s" %( formerPath, destination )
         shutil.move( formerPath, destination )
开发者ID:hawkeye438,项目名称:metpx,代码行数:39,代码来源:LanguageTools.py


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