mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-07-15 17:01:29 +00:00
25 lines
449 B
Python
Executable File
25 lines
449 B
Python
Executable File
#!/usr/bin/python
|
|
|
|
import sys
|
|
import subprocess
|
|
|
|
def extract(iso, path):
|
|
command = ['isoinfo', '-R', '-i', iso, '-x', path]
|
|
pipe = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
stdout, stderr = pipe.communicate()
|
|
|
|
if pipe.returncode != 0:
|
|
raise Exception, stderr
|
|
|
|
return stdout
|
|
|
|
def main():
|
|
iso = sys.argv[1]
|
|
|
|
version = extract(iso, '/.disk/info')
|
|
print version
|
|
|
|
if __name__ == '__main__':
|
|
main()
|
|
sys.exit(0)
|