home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / share / envy / instun / interfaceclasses.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2007-03-04  |  2.7 KB  |  92 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.4)
  3.  
  4. import sys
  5. import commands
  6. import string
  7. import os
  8. import popen2
  9. import fcntl
  10. import fcntl
  11. import select
  12. from os.path import isfile
  13. import shutil
  14. import objects
  15. import classes
  16. import main
  17. import idcardlist
  18.  
  19. class Interface:
  20.     
  21.     def page(self):
  22.         left_margin = 7
  23.         border = ' ' * 4
  24.         lines = []
  25.         lenlinetxt = []
  26.         for i in self.linetxt:
  27.             lenlinetxt.append(len(i))
  28.         
  29.         diffs = []
  30.         diffspc = []
  31.         it = 0
  32.         it <= len(self.linetxt)
  33.         for line in self.linetxt:
  34.             maxlen = max(lenlinetxt)
  35.             diffstmp = (maxlen - lenlinetxt[it]) / 2
  36.             diffs.append(diffstmp)
  37.             if it == 0 or it == len(self.linetxt) - 1:
  38.                 diffspctmp = '-' * diffs[it]
  39.                 rightmargin = '-' * (maxlen - lenlinetxt[it])
  40.             else:
  41.                 diffspctmp = ' ' * diffs[it]
  42.                 rightmargin = ' ' * (maxlen - lenlinetxt[it])
  43.             diffspc.append(diffspctmp)
  44.             genline = self.linetxt[it] + rightmargin
  45.             lines.append(genline)
  46.             it += 1
  47.         
  48.         maxintlen = len(border) * 2 + max(diffs) * 2
  49.         print '\n'
  50.         print ' ' * left_margin + '+' + '-' * len(border) + lines[0] + '-' * len(border) + '+'
  51.         for line in lines[1:-1]:
  52.             print ' ' * left_margin + '|' + border + line + border + '|'
  53.         
  54.         print ' ' * left_margin + '+' + '-' * len(border) + lines[len(self.linetxt) - 1] + '-' * len(border) + '+'
  55.         linetxt2 = []
  56.         for l in lines:
  57.             linetxt2.append(len(l))
  58.         
  59.  
  60.     
  61.     def process(self):
  62.         if self.operation == 'nvinstall':
  63.             objects.nvinstconfirm()
  64.         elif self.operation == 'nvuninstall':
  65.             objects.nvuninstconfirm()
  66.         elif self.operation == 'atiinstall':
  67.             objects.atiinstconfirm()
  68.         elif self.operation == 'atiuninstall':
  69.             objects.atiuninstconfirm()
  70.         elif self.operation == 'maninstall':
  71.             objects.maninstconfirm()
  72.         elif self.operation == 'nvidiaclean':
  73.             objects.nvcleanconfirm()
  74.         elif self.operation == 'xorgrestart':
  75.             main.xserverstart()
  76.         
  77.  
  78.     
  79.     def confirm(self):
  80.         while None:
  81.             choice = raw_input('Do you really want to ' + self.operation + ' the ' + self.brand + ' ? (Type either "yes" or "no")\n').strip()
  82.             if choice.lower() == 'yes':
  83.                 self.gotoop
  84.                 break
  85.                 continue
  86.             if choice.lower() == 'no':
  87.                 objects.mainmenu()
  88.                 break
  89.                 continue
  90.  
  91.  
  92.