mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
f061a40650
commit
45c6522ed8
@ -44,7 +44,12 @@ def debug(ioreg_to_tmp=False, buf=None):
|
|||||||
try:
|
try:
|
||||||
out = partial(prints, file=buf)
|
out = partial(prints, file=buf)
|
||||||
out('Version:', __version__)
|
out('Version:', __version__)
|
||||||
|
wmi = Wmi =None
|
||||||
|
if iswindows:
|
||||||
|
wmi = __import__('wmi', globals(), locals(), [], -1)
|
||||||
|
Wmi = wmi.WMI(find_classes=False)
|
||||||
s = DeviceScanner()
|
s = DeviceScanner()
|
||||||
|
s.wmi = Wmi
|
||||||
s.scan()
|
s.scan()
|
||||||
devices = (s.devices)
|
devices = (s.devices)
|
||||||
if not iswindows:
|
if not iswindows:
|
||||||
@ -54,10 +59,7 @@ def debug(ioreg_to_tmp=False, buf=None):
|
|||||||
d[i] = hex(d[i])
|
d[i] = hex(d[i])
|
||||||
out('USB devices on system:')
|
out('USB devices on system:')
|
||||||
out(pprint.pformat(devices))
|
out(pprint.pformat(devices))
|
||||||
wmi = Wmi =None
|
|
||||||
if iswindows:
|
if iswindows:
|
||||||
wmi = __import__('wmi', globals(), locals(), [], -1)
|
|
||||||
Wmi = wmi.WMI(find_classes=False)
|
|
||||||
drives = []
|
drives = []
|
||||||
out('Drives detected:')
|
out('Drives detected:')
|
||||||
out('\t', '(ID, Partitions, Drive letter)')
|
out('\t', '(ID, Partitions, Drive letter)')
|
||||||
@ -81,7 +83,6 @@ def debug(ioreg_to_tmp=False, buf=None):
|
|||||||
ioreg = Device.run_ioreg()
|
ioreg = Device.run_ioreg()
|
||||||
ioreg = 'Output from mount:\n\n'+mount+'\n\n'+ioreg
|
ioreg = 'Output from mount:\n\n'+mount+'\n\n'+ioreg
|
||||||
connected_devices = []
|
connected_devices = []
|
||||||
s.wmi = Wmi
|
|
||||||
for dev in device_plugins():
|
for dev in device_plugins():
|
||||||
owmi = getattr(dev, 'wmi', None)
|
owmi = getattr(dev, 'wmi', None)
|
||||||
dev.wmi = Wmi
|
dev.wmi = Wmi
|
||||||
|
@ -222,6 +222,8 @@ class Device(DeviceConfig, DevicePlugin):
|
|||||||
for pnp_id in pnp_id_iterator():
|
for pnp_id in pnp_id_iterator():
|
||||||
if self.windows_match_device(pnp_id, 'WINDOWS_MAIN_MEM'):
|
if self.windows_match_device(pnp_id, 'WINDOWS_MAIN_MEM'):
|
||||||
return True
|
return True
|
||||||
|
if debug:
|
||||||
|
print '\tNo match found in:', pnp_id
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def open_windows(self):
|
def open_windows(self):
|
||||||
|
@ -177,7 +177,7 @@ class DeviceManager(Thread):
|
|||||||
self.wmi = wmi.WMI(find_classes=False)
|
self.wmi = wmi.WMI(find_classes=False)
|
||||||
self.scanner.wmi = self.wmi
|
self.scanner.wmi = self.wmi
|
||||||
for x in self.devices:
|
for x in self.devices:
|
||||||
x[0].wmi = self.wmi
|
x.wmi = self.wmi
|
||||||
try:
|
try:
|
||||||
while self.keep_going:
|
while self.keep_going:
|
||||||
self.detect_device()
|
self.detect_device()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user