1
0
mirror of https://github.com/gryf/pygtktalog.git synced 2025-12-17 19:40:21 +01:00

* Rename appllication into pyGTKtalog.

* Added new files to the project.
This commit is contained in:
2006-11-25 08:23:25 +00:00
parent 69aa745d46
commit e980ebb97c
5 changed files with 393 additions and 0 deletions

28
deviceHelper.py Normal file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
device (cd, dvd) helper
"""
import string
import os
def volname(dev):
"""read volume name from cd/dvd"""
try:
a = open(dev,"rb")
a.seek(32808)
b = a.read(32).strip()
a.close()
except:
return None
return b
def volmount(dev):
"""mount device, return True/False"""
stout,stin,sterr = popen3("mount %s" % dev)
error = sterr.readline()
stout.close()
stin.close()
sterr.close()
return len(error) == 0