Module cvtool.core.logo

The file which determines the logo splash screen

Expand source code
'''
The file which determines the logo splash screen 

'''

import shutil , math, os 

content = '''                      @@@        @@@        @@@         /@@@&                    @@@@@@                    @@@@          @@@        @@@        @@@                                                      
                     @@@       &@@,       @@@        .@@@             &@@@@@@@@@        @@@@@@@@@&            *@@@(        @@@        @@&       .@@                                                     
                   *@@*       @@@       @@@        @@@.          @@@@@&                          (@@@@&          #@@@        @@@       @@@        @@&                                                   
                  (@@       %@@       @@@       ,@@@         %@@@@                                    @@@@/         @@@        @@@       @@/       @@@                                                  
                 &@@       @@@      ,@@.       @@@        (@@@              #@@@@@@@@@@@@@@#             .@@@,        @@@       *@@       @@&       @@@                                                 
                @@@       @@@      @@@       @@@        @@@(             .@@/              /@@@@@%          &@@&        @@@       @@&      @@@       @@@                                                
               *@@       @@@      @@@      ,@@.       @@@                                        @@@@.        .@@@       #@@       @@@      @@@       @@@                                               
               @@.      @@@      @@@      &@@        @@.                                            /@@@        (@@,       @@/      @@@      @@@       @@                                               
              @@&      *@@      @@@      @@@                                                           @@@        @@@       @@@      @@@      @@,      ,@@                                              
              @@       @@      (@@      @@@                                                   @@*        @@@       @@@       @@#      @@&     /@@       @@@                                             
             @@&      @@@      @@       @@                                                      @@@       *@@       &@@       @@       @@      @@@      .@@                                             
             @@       @@      &@@      @@&                                                        @@&       @@       @@%      @@@      @@@     *@@       @@/                                            
             @@       @@      @@       @@                                                          @@@      %@@       @@       @@      ,@@      @@       &@@                                            
            @@@      &@@      @@      %@@                                                           @@/      @@       @@@      @@%      @@      @@*      ,@@                                            
            @@@      @@@      @@      @@#                                                           %@@      @@@      @@@      @@@      @@      @@@       @@                                            
            @@@      @@@      @@      @@#                                                            @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                                            
            @@@      &@@      @@      @@@                                                                                                                                                               
            @@@       @@      @@      /@@                                                                                                                                                               
             @@       @@      @@%      @@                                                                                                                                                               
             @@(      @@@      @@      (@&                                   @@@@@@@@@@@@@@@@        @@@@@@@.               @@@@@@@#      @@@@@@@@@@@@@@@@@@       @@@@@@@@@@@@@@@@@@                   
             %@@       @@      @@@                                        @@@@@@@@@@@@@@@@@@@@@@     @@@@@@@@@             @@@@@@@@#      @@@@@@@@@@@@@@@@@@       @@@@@@@@@@@@@@@@@@@@@                
              @@%      @@@      @@,                                     @@@@@@@@@@@@@@@@@@@@@@@      @@@@@@@@@@%         @@@@@@@@@@#      @@@@@@@@@@@@@@@@@@       @@@@@@@@@@@@@@@@@@@@@@               
              (@@       @@&      @@                                   @@@@@@@@@,           @@        @@@@@@@@@@@@      .@@@@@@@@@@@#           @@@@@@@@            @@@@@@@        @@@@@@@@              
               @@@       @@*      @@                                 %@@@@@@@#                       @@@@@@@@@@@@@(   @@@@@@@@@@@@@#           @@@@@@@@            @@@@@@@        @@@@@@@@              
                @@@       @@/      @@(                               @@@@@@@@                        @@@@@@@,@@@@@@@&@@@@@@%&@@@@@@#           @@@@@@@@            @@@@@@@((((((@@@@@@@@@               
                 @@%       @@@      @@@                              @@@@@@@@                        @@@@@@@  @@@@@@@@@@@@  @@@@@@@#           @@@@@@@@            @@@@@@@@@@@@@@@@@@@@@                
                  @@&       @@@      (@@,                            @@@@@@@@(                       @@@@@@@    @@@@@@@@    @@@@@@@#           @@@@@@@@            @@@@@@@@@@@@@@@@@@(                  
                   @@@       &@@       @@@                            @@@@@@@@@             @        @@@@@@@     @@@@@@     @@@@@@@#           @@@@@@@@            @@@@@@@                              
                    @@@        @@@       @@@                           &@@@@@@@@@@@@,,,&@@@@@@.      @@@@@@@                @@@@@@@#           @@@@@@@@            @@@@@@@                              
                      @@%       ,@@/       @@@,                          @@@@@@@@@@@@@@@@@@@@@@@     @@@@@@@                @@@@@@@#      @@@@@@@@@@@@@@@@@@       @@@@@@@                              
                       @@@        #@@&       &@@(                           &@@@@@@@@@@@@@@@@&       @@@@@@@                @@@@@@@#      @@@@@@@@@@@@@@@@@@       @@@@@@@                              
                         @@@        @@@&                                                                                                                                                                
                           @@@        .@@@                                                                                                                                                              
                             @@@         @@@@                                                                                                                                                         '''






# Get the terminal width
size = os.get_terminal_size()
terminal_width = size.columns
terminal_height = size.lines

ascii = content.split("\n")
width = len(ascii[1])
by = 1

if terminal_width < width:
    by = math.ceil(width/terminal_width)

height = len(ascii)
hs = 2
if terminal_height/hs < height:
    height = math.ceil(terminal_height/hs)
if height < 18: 
    height = 18


print("\033[94m")

if terminal_width > 60:
    # Split the ASCII art lines and adjust them to fit the terminal width
    adjusted_ascii = "\n".join(line[::by] for line in ascii[-height:])

    # Display the adjusted ASCII art
    print(adjusted_ascii)
else: 
    print( '********************************************')
    print( 'CMIP - Coupled Model Intercomparison Project')
    print( '********************************************')
print("\033[0m")

# print(terminal_width,width,height)
# print('\nContact: cmip-ipo@esa.int')