home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / bin / gdebi < prev    next >
Encoding:
Text File  |  2006-08-04  |  1.1 KB  |  38 lines

  1. #!/usr/bin/python
  2.  
  3. import sys
  4. import apt
  5. import os.path
  6. import gettext
  7. from gettext import gettext as _
  8.  
  9.  
  10. from GDebi.GDebiCli import GDebiCli
  11.  
  12.  
  13. if __name__ == "__main__":
  14.     localesApp="gdebi"
  15.     localesDir="/usr/share/locale"
  16.     gettext.bindtextdomain(localesApp, localesDir)
  17.     gettext.textdomain(localesApp)
  18.  
  19.     if not sys.argv[1:] or sys.argv[1] == "-h" or sys.argv[1] == "--help":
  20.         print _("Usage: %s [package.deb]" % sys.argv[0])
  21.         print
  22.         print _("To use the graphical user interface, right-click\n" \
  23.                 "on a '.deb' software package in the file browser\n" \
  24.                 "and select: Open with 'GDebi Package Installer'.")
  25.         sys.exit(1)
  26.     if not os.path.exists(sys.argv[1]):
  27.         print _("gdebi error, file not found: %s" % sys.argv[1])
  28.         sys.exit(1)
  29.  
  30.     debi = GDebiCli() 
  31.     if not debi.open(sys.argv[1]):
  32.         sys.exit(1)
  33.     print _("Do you want to install the software package? [y/N]:"),
  34.     sys.stdout.flush()
  35.     res = sys.stdin.readline()
  36.     if res.startswith("y") or res.startswith("Y"):
  37.         debi.install()
  38.