Closes the cd drive door.
(self, drive='')
| 78 | win32file.CloseHandle(hdevice) |
| 79 | |
| 80 | def close(self, drive=''): |
| 81 | '''Closes the cd drive door.''' |
| 82 | drive = drive or self.drive |
| 83 | device = self.__getDeviceHandle(drive) |
| 84 | hdevice = win32file.CreateFile(device, GENERIC_READ, |
| 85 | FILE_SHARE_READ, None, OPEN_EXISTING, 0, 0) |
| 86 | win32file.DeviceIoControl(hdevice,2967564,"", 0, None) |
| 87 | win32file.CloseHandle(hdevice) |
| 88 | |
| 89 | if __name__ == '__main__': |
| 90 | cd = Cdrom(timeout=5) |
no test coverage detected