mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-11 09:13:57 -04:00
cleanups
This commit is contained in:
parent
45d57f4ee5
commit
d7b1624ec6
@ -160,7 +160,6 @@ class FreeBSDScanner(object):
|
|||||||
def __call__(self):
|
def __call__(self):
|
||||||
ans = set([])
|
ans = set([])
|
||||||
import dbus
|
import dbus
|
||||||
devs = []
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
bus = dbus.SystemBus()
|
bus = dbus.SystemBus()
|
||||||
@ -170,7 +169,6 @@ class FreeBSDScanner(object):
|
|||||||
for path in paths:
|
for path in paths:
|
||||||
obj = bus.get_object('org.freedesktop.Hal', path)
|
obj = bus.get_object('org.freedesktop.Hal', path)
|
||||||
objif = dbus.Interface(obj, 'org.freedesktop.Hal.Device')
|
objif = dbus.Interface(obj, 'org.freedesktop.Hal.Device')
|
||||||
devif = objif
|
|
||||||
parentdriver = None
|
parentdriver = None
|
||||||
while parentdriver != 'umass':
|
while parentdriver != 'umass':
|
||||||
try:
|
try:
|
||||||
|
@ -700,9 +700,9 @@ class Device(DeviceConfig, DevicePlugin):
|
|||||||
if not d.serial:
|
if not d.serial:
|
||||||
raise DeviceError("Device has no S/N. Can't continue")
|
raise DeviceError("Device has no S/N. Can't continue")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
vols=[]
|
vols=[]
|
||||||
|
|
||||||
bus = dbus.SystemBus()
|
bus = dbus.SystemBus()
|
||||||
manager = dbus.Interface(bus.get_object('org.freedesktop.Hal',
|
manager = dbus.Interface(bus.get_object('org.freedesktop.Hal',
|
||||||
'/org/freedesktop/Hal/Manager'), 'org.freedesktop.Hal.Manager')
|
'/org/freedesktop/Hal/Manager'), 'org.freedesktop.Hal.Manager')
|
||||||
@ -718,7 +718,7 @@ class Device(DeviceConfig, DevicePlugin):
|
|||||||
d.serial == objif.GetProperty('usb.serial'):
|
d.serial == objif.GetProperty('usb.serial'):
|
||||||
dpaths = manager.FindDeviceStringMatch('storage.originating_device', path)
|
dpaths = manager.FindDeviceStringMatch('storage.originating_device', path)
|
||||||
for dpath in dpaths:
|
for dpath in dpaths:
|
||||||
devif = dbus.Interface(bus.get_object('org.freedesktop.Hal', dpath), 'org.freedesktop.Hal.Device')
|
#devif = dbus.Interface(bus.get_object('org.freedesktop.Hal', dpath), 'org.freedesktop.Hal.Device')
|
||||||
try:
|
try:
|
||||||
vpaths = manager.FindDeviceStringMatch('block.storage_device', dpath)
|
vpaths = manager.FindDeviceStringMatch('block.storage_device', dpath)
|
||||||
for vpath in vpaths:
|
for vpath in vpaths:
|
||||||
@ -755,7 +755,7 @@ class Device(DeviceConfig, DevicePlugin):
|
|||||||
|
|
||||||
if verbose:
|
if verbose:
|
||||||
print "FBSD: ", vols
|
print "FBSD: ", vols
|
||||||
|
|
||||||
mtd=0
|
mtd=0
|
||||||
|
|
||||||
for vol in vols:
|
for vol in vols:
|
||||||
@ -763,8 +763,6 @@ class Device(DeviceConfig, DevicePlugin):
|
|||||||
if vol['dev'].GetProperty('volume.is_mounted'):
|
if vol['dev'].GetProperty('volume.is_mounted'):
|
||||||
mp = vol['dev'].GetProperty('volume.mount_point')
|
mp = vol['dev'].GetProperty('volume.mount_point')
|
||||||
else:
|
else:
|
||||||
if verbose:
|
|
||||||
print "FBSD: trying ", vol['label'], "on", 'Calibre-'+labels[i]
|
|
||||||
try:
|
try:
|
||||||
vol['vol'].Mount('Calibre-'+vol['label'],
|
vol['vol'].Mount('Calibre-'+vol['label'],
|
||||||
vol['dev'].GetProperty('volume.fstype'), [])
|
vol['dev'].GetProperty('volume.fstype'), [])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user