Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2011
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. # Simple script to pull out version information from openoffice/libreoffice.
  4. # soffice -help | ./detect_version.py
  5.  
  6. import sys
  7. import re
  8.  
  9. VERSION_STRING = re.compile(r'([0-9a-zA-Z\.]*)[ ]*([0-9\.]*)[ ]*([0-9a-zA-Z]*)\(Build:([0-9]*)\)')
  10.  
  11. data = sys.stdin.read()
  12. match = VERSION_STRING.search(data)
  13. if match:
  14.     print match.groups()
  15. else:
  16.     print 'No matches found.'
  17.  
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement