Author: dmeyer
Date: Fri Dec 15 22:24:28 2006
New Revision: 2249
Modified:
trunk/metadata/src/__init__.py
trunk/metadata/src/disc/cdrom.py
trunk/metadata/src/disc/core.py
Log:
change cdrom access code again
Modified: trunk/metadata/src/__init__.py
==============================================================================
--- trunk/metadata/src/__init__.py (original)
+++ trunk/metadata/src/__init__.py Fri Dec 15 22:24:28 2006
@@ -38,7 +38,8 @@
# import factory code for kaa.metadata access
from factory import *
-from disc.cdrom import get_id as get_discid
+import disc.cdrom as cdrom
+
from core import Media, MEDIA_AUDIO, MEDIA_VIDEO, MEDIA_IMAGE, \
MEDIA_AV, MEDIA_SUBTITLE, MEDIA_CONTAINER, MEDIA_DIRECTORY, MEDIA_DISC, \
MEDIA_GAME
Modified: trunk/metadata/src/disc/cdrom.py
==============================================================================
--- trunk/metadata/src/disc/cdrom.py (original)
+++ trunk/metadata/src/disc/cdrom.py Fri Dec 15 22:24:28 2006
@@ -39,6 +39,8 @@
import logging
from fcntl import ioctl
+CREATE_MD5_ID = 0
+
# cdrom module
try:
import _cdrom
@@ -94,7 +96,7 @@
return _cdrom.leadout(device)
-def status(device, handle_mix = 0):
+def _drive_status(device, handle_mix = 0):
"""
check the current disc in device
return: no disc (0), audio cd (1), data cd (2), blank cd (3)
@@ -197,7 +199,7 @@
_id_cache = {}
-def get_id(device, handle_mix=0):
+def status(device, handle_mix=0):
"""
return the disc id of the device or None if no disc is there
"""
@@ -212,7 +214,7 @@
except (KeyError, IndexError):
pass
- disc_type = status(device, handle_mix=handle_mix)
+ disc_type = _drive_status(device, handle_mix=handle_mix)
if disc_type == 0 or disc_type == 3:
return 0, None
Modified: trunk/metadata/src/disc/core.py
==============================================================================
--- trunk/metadata/src/disc/core.py (original)
+++ trunk/metadata/src/disc/core.py Fri Dec 15 22:24:28 2006
@@ -45,22 +45,20 @@
# get logging object
log = logging.getLogger('metadata')
-CREATE_MD5_ID = 0
-
class Disc(Collection):
_keys = Collection._keys + [ 'mixed', 'label' ]
media = MEDIA_DISC
def is_disc(self, device):
- (type, self.id) = cdrom.get_id(device, handle_mix=1)
+ (type, self.id) = cdrom.status(device, handle_mix=1)
if type != 2:
if type == 4:
self.mixed = 1
type = 1
return type
- if CREATE_MD5_ID:
+ if cdrom.CREATE_MD5_ID:
if len(self.id) == 32:
self.label = ''
else:
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog