本文整理汇总了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 )