'Perform any device specific initialization. Called after the device is
detected but before any other functions that communicate with the device.
For example: For devices that present themselves as USB Mass storage
devices, this method would be responsible for mounting the device or
if the device has been automounted, for finding out where it has been
mounted. The base class within USBMS device.py has a implementation of
this function that should serve as a good example for USB Mass storage
devices.
Note that most of the initialization is necessarily performed in can_handle(), as
we need to talk to iTunes to discover if there\'s a connected iPod'

def open(self, connected_device, library_uuid):

    from calibre.utils.zipfile import ZipFile
    if (self.iTunes is None):
        raise OpenFeedback(self.ITUNES_SANDBOX_LOCKOUT_MESSAGE)
    if self.verbose:
        vendor_id = ('0x%x' % connected_device[0])
        product_id = ('0x%x' % connected_device[1])
        bcd = ('0x%x' % connected_device[2])
        mfg = connected_device[3]
        model = connected_device[4]
        logger().info(('%s.open(MFG:    %s,    VENDOR_ID:    %s,    MODEL:    %s,    BCD:    %s,    PRODUCT_ID:    %s)' % (self.__class__.__name__, mfg, vendor_id, model, bcd, product_id)))
    if False:
        from calibre.utils.config import dynamic
        if dynamic.get(confirm_config_name(self.DISPLAY_DISABLE_DIALOG), True):
            raise AppleOpenFeedback(self)
        elif self.verbose:
            logger().info(('    %s' % self.UNSUPPORTED_DIRECT_CONNECT_MODE_MESSAGE))
    if self.verbose:
        logger().info(('    BCD:    %s' % [('0x%x' % x) for x in sorted(self.BCD)]))
        logger().info(('    PRODUCT_ID:    %s' % [('0x%x' % x) for x in sorted(self.PRODUCT_ID)]))
    if (not os.path.exists(self.cache_dir)):
        if self.verbose:
            logger().info(("    creating    thumb    cache    at    '%s'" % self.cache_dir))
        os.makedirs(self.cache_dir)
    if (not os.path.exists(self.archive_path)):
        logger().info('    creating    zip    archive')
        zfw = ZipFile(self.archive_path, mode='w')
        zfw.writestr('iTunes    Thumbs    Archive', '')
        zfw.close()
    elif self.verbose:
        logger().info(("    existing    thumb    cache    at    '%s'" % self.archive_path))
    if (not self.settings().extra_customization[self.USE_ITUNES_STORAGE]):
        self.iTunes_local_storage = os.path.join(config_dir, 'iTunes    storage')
        if (not os.path.exists(self.iTunes_local_storage)):
            if self.verbose:
                logger()(("    creating    iTunes_local_storage    at    '%s'" % self.iTunes_local_storage))
            os.mkdir(self.iTunes_local_storage)
        elif self.verbose:
            logger()(("    existing    iTunes_local_storage    at    '%s'" % self.iTunes_local_storage))
