1
diff -Nur -x '*.orig' -x '*~' quodlibet-1.0.ds1/devices/_base.py quodlibet-1.0.ds1.new/devices/_base.py
2
--- quodlibet-1.0.ds1/devices/_base.py 2008-06-03 20:53:42.000000000 +0200
3
+++ quodlibet-1.0.ds1.new/devices/_base.py 2008-11-03 20:42:50.000000000 +0100
5
# The default icon for this device.
6
icon = 'device-generic'
8
- # The value of the HAL-property 'portable_audio_player.type' for
11
+ # The used HAL access method protocol for this device, as defined in
12
+ # 'portable_audio_player.access_method.protocols'
15
# The UDI of this device
17
diff -Nur -x '*.orig' -x '*~' quodlibet-1.0.ds1/devices/__init__.py quodlibet-1.0.ds1.new/devices/__init__.py
18
--- quodlibet-1.0.ds1/devices/__init__.py 2008-06-03 20:53:42.000000000 +0200
19
+++ quodlibet-1.0.ds1.new/devices/__init__.py 2008-11-03 20:42:50.000000000 +0100
24
-# Return a constructor for a device given by a HAL type
25
-def get_by_type(type):
26
- try: return devices[[d.type for d in devices].index(type)]
29
+# Return a constructor for a device given by the supported
30
+# access method protocols
31
+def get_by_protocols(protocols):
32
+ # Try the storage protocol last
33
+ if 'storage' in protocols:
34
+ protocols.remove('storage')
35
+ protocols.append('storage')
37
+ for protocol in protocols:
38
+ try: return devices[[d.protocol for d in devices].index(protocol)]
44
# Return a new device instance for the given UDI
46
interface = get_interface(udi)
47
- try: capabilities = interface.GetProperty('info.capabilities')
48
- except dbus.DBusException: return None
50
+ capabilities = interface.GetProperty('info.capabilities')
51
+ except dbus.DBusException:
54
if 'portable_audio_player' in capabilities:
55
- klass = get_by_type(interface.GetProperty('portable_audio_player.type'))
57
+ protocols = interface.GetProperty(
58
+ 'portable_audio_player.access_method.protocols')
59
+ except dbus.DBusException:
61
+ # Support older HAL versions which don't use the 'protocols' property
62
+ # and only store one access method as a string
63
+ protocols = [interface.GetProperty(
64
+ 'portable_audio_player.access_method')]
65
+ except dbus.DBusException:
68
+ klass = get_by_protocols(protocols)
72
diff -Nur -x '*.orig' -x '*~' quodlibet-1.0.ds1/devices/ipod.py quodlibet-1.0.ds1.new/devices/ipod.py
73
--- quodlibet-1.0.ds1/devices/ipod.py 2008-06-03 20:53:42.000000000 +0200
74
+++ quodlibet-1.0.ds1.new/devices/ipod.py 2008-11-03 20:42:50.000000000 +0100
77
class IPodDevice(Device):
84
diff -Nur -x '*.orig' -x '*~' quodlibet-1.0.ds1/devices/storage.py quodlibet-1.0.ds1.new/devices/storage.py
85
--- quodlibet-1.0.ds1/devices/storage.py 2008-06-03 20:53:42.000000000 +0200
86
+++ quodlibet-1.0.ds1.new/devices/storage.py 2008-11-03 20:42:50.000000000 +0100
88
CACHE = os.path.join(const.USERDIR, 'cache')
90
class StorageDevice(Device):
92
+ protocol = 'storage'
95
'pattern': '<artist>/<album>/<title>',