Exemplo n.º 1
0
  def start(self):

    try:
      
      choice = ''
      
      while not choice in ['y','n']:

        if choice: print ' Error: Input not valid.'; time.sleep(2);
        
        #Clean screen
        ColorConsole.cleanScreen()
        
        print '\nBinCopier \n================================='
        print '\nSource: ',
        ColorConsole.printC(self.dirSource,'red')
        print '\nTarget: ',
        ColorConsole.printC(self.dirTarget,'red')
    
        choice = raw_input('\n\nAre you sure? (y/n) ')
  
  #Redefine and the relative messages to print on screen
        if choice == 'n':
          Util.setNewValue(self,'Source: ',self.dirSource,'dirSource')
          Util.setNewValue(self,'Target: ',self.dirTarget,'dirTarget')

          choice = ''

  #Print the list of the most recent
      PrintUtil.printListCompare2(self.dirSource,self.dirTarget)

      choice=''
      
      while not choice in ['1','2']:
        
        if choice: print 'Choice not valid!'; time.sleep(2)
     
        choice = raw_input('\n\n(1) Update the folder \n(2) Replace all the files\n Select [1,2]: ')
  
  #Init the LOG
      self.logInit()
        
      if choice=='1': self.copyFun(self.dirSource,self.dirTarget,'','update')
      if choice=='2': self.copyFun(self.dirSource,self.dirTarget,'','replace')
      
      if not self.n_err and self.n_file: 
        if Copier.x64: self.updateDLLs('register_4.0_x64.bat')
        else: self.updateDLLs()

      self.logClose()

    except SystemExit: pass
    except: print sys.exc_info()[1],'The program has quit'
Exemplo n.º 2
0
  def menu(self):
    try:
      choice = ''
      
      while not choice in ['1', '2', '3', '4','q']:
        
        if choice: print 'Choice not valid!'; time.sleep(2)
            
        ColorConsole.cleanScreen()
              
        print '\nWelcome to ',
        ColorConsole.printC('BinManager','red')
        print VERSION

        print '------------------------------\n'
        print '1) Install the last bin'
        print '2) Zip the last bin'
        print '3) Start Bin Alerter'
        print '4) Prepare the Translation'
        print 'q) Quit\n'

    
        choice = raw_input('Select: ')
        
        
      if choice == '1': Copier(self.dirSource,self.dirTarget).start()
      
      if choice == '2': Zipper(self.dirSource,self.zipTarget).start()
      
      if choice == '3': Alerter(self.dirAlert).run()

      if choice == '4': ToTranslate(self.dirSource,self.dirTarget, self.transDir).start()

      if choice == 'q': sys.exit(0)
  
    except SystemExit: print 'The program has quit';
    except: print sys.exc_info()[1]