Esempio n. 1
0
    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)
Esempio n. 2
0
 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 )