Guest User

Untitled

a guest
Jul 16th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. def upgrade_summary(data = None):
  2. """Returns a summary of a possible upgrade"""
  3.  
  4. print "Generating summary"
  5. lp_Out = subprocess.PIPE
  6. slapt_call = subprocess.Popen('/usr/sbin/slapt-get --upgrade -s',
  7. bufsize=0, executable=None, stdin=None, \
  8. stdout=lp_Out, stderr=None, preexec_fn=None, \
  9. close_fds=False, shell=True, cwd=None, \
  10. env=None, universal_newlines=False, \
  11. startupinfo=None, creationflags=0)
  12.  
  13. print "Waiting for slapt-get --upgrade -s"
  14. while slapt_call.poll() == None:
  15. if data:
  16. do_pulse_bar(data)
  17. yield True
  18. print "Done\nReading output"
  19. for package in slapt_call.stdout.readlines():
  20. if data:
  21. do_pulse_bar(data)
  22. #here you should process i and yield exactly what you
  23. #need. I will yield every line complete
  24. yield package
  25. print "Done"
Add Comment
Please, Sign In to add comment