Advertisement
Guest User

Untitled

a guest
Aug 6th, 2012
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. from gi.repository import Notify
  2. from subprocess import check_output, check_call, call
  3. from time import sleep
  4.  
  5. call(["sudo","pacman","-Syy"])
  6. a = check_call(["sudo","pacman","-Qu"])
  7. if a == 0:
  8.     salida = check_output(["sudo","pacman","-Qu"])
  9.     lista = salida.split("\n")
  10.     lista.pop()
  11.     largo = len(lista)
  12.     Notify.init('pacnotify')
  13.     if largo == 1:
  14.         mensaje = "Usted tiene 1 actualizacion en Pacman"
  15.     else:
  16.         mensaje = "Usted tiene %d actualizaciones en Pacman" % largo
  17.     n = Notify.Notification.new(mensaje,salida,'dialog-information')
  18.     n.show()
  19.     sleep(15)
  20.     n.close()
  21.     Notify.uninit()
  22. else:
  23.     pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement