Beispiel #1
0
    def __init__( self, displayedLanguage = 'en', filesLanguage='en', days = None, \
                  weeks = None, months = None, years = None, \
                  pathsTowardsGraphics = None, pathsTowardsOutputFiles = None  ):
        """
        
            @summary : Constructor 
            
            @param displayedLanguage: Languages in which to display 
                                      the different captions found within 
                                      the generated web page.  
            
            @param fileLanguages: Language in which the files that 
                                  will be referenced within this page
                                  have been generated.
                                  
            @param days : List of days that the web page covers.
        
            @note : Will set two global translators to be used throughout this module 
                    _ which translates every caption that is to be printed.
                    _F which translates every filename that is to be linked.     
        """
        
        configParameters = StatsConfigParameters()
        configParameters.getGeneralParametersFromStatsConfigurationFile()
      
        global _ 
        _ =  self.getTranslatorForModule( CURRENT_MODULE_ABS_PATH, displayedLanguage )
        
        if days == None:
            self.setDays()
        else:    
            self.days = days 
            
        if weeks == None:
            self.setWeeks()
        else:    
            self.weeks = weeks             
            
        if months == None:
            self.setMonths()
        else:    
            self.months = months 
                            
        if years == None:
            self.setYears()
        else:    
            self.years = years                 
                
        self.displayedLanguage = displayedLanguage
        self.filesLanguage     = filesLanguage
       
        self.pathsTowardsGraphics = StatsPaths()
        self.pathsTowardsGraphics.setPaths( filesLanguage )
        
        self.pathsTowardsOutputFiles = StatsPaths()
        self.pathsTowardsOutputFiles.setPaths( self.displayedLanguage )

        StatsDateLib.setLanguage(filesLanguage)