SHARE
TWEET

Untitled

a guest Aug 6th, 2012 36 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top