(
            self, device_params, current_device,
            codepage, text_mode, soft_linefeed
        )
Initialise disk devices.
Initialise disk devices.
Initialise disk devices .
def _init_disk_devices(
            self, device_params, current_device,
            codepage, text_mode, soft_linefeed
        ):
        """Initialise disk devices."""
        # if Z not specified, mount to cwd by default (override by specifying 'Z': None)
        if b'Z' not in device_params:
            device_params[b'Z'] = getcwdu()
        # disk devices
        for letter in iterchar(DRIVE_LETTERS):
            if letter in device_params:
                if not device_params[letter]:
                    continue
                # drive can be non-empty only on Windows, needs to be split out first as we use :
                drive, drivepath = os.path.splitdrive(device_params[letter])
                params = split_quoted(
                    drivepath, split_by=u':', quote=u'"', strip_quotes=True
                )
                path = drive + params[0]
                if len(params) > 1:
                    cwd = params[1]
                    # ignore any further specifiers
                else:
                    cwd = u''
            else:
                path, cwd = None, u''
            # treat device @: separately - internal disk must exist but may remain unmounted
            disk_class = disk.InternalDiskDevice if letter == b'@' else disk.DiskDevice
            self._devices[letter + b':'] = disk_class(
                letter, path, cwd, codepage, text_mode, soft_linefeed
            )
        # current_device value is normalised
        self._current_device = current_device
def _init_disk_devices ( self , device_params , current_device , codepage , text_mode , soft_linefeed ) : # if Z not specified, mount to cwd by default (override by specifying 'Z': None) if b'Z' not in device_params : device_params [ b'Z' ] = getcwdu ( ) # disk devices for letter in iterchar ( DRIVE_LETTERS ) : if letter in device_params : if not device_params [ letter ] : continue # drive can be non-empty only on Windows, needs to be split out first as we use : drive , drivepath = os . path . splitdrive ( device_params [ letter ] ) params = split_quoted ( drivepath , split_by = u':' , quote = u'"' , strip_quotes = True ) path = drive + params [ 0 ] if len ( params ) > 1 : cwd = params [ 1 ] # ignore any further specifiers else : cwd = u'' else : path , cwd = None , u'' # treat device @: separately - internal disk must exist but may remain unmounted disk_class = disk . InternalDiskDevice if letter == b'@' else disk . DiskDevice self . _devices [ letter + b':' ] = disk_class ( letter , path , cwd , codepage , text_mode , soft_linefeed ) # current_device value is normalised self . _current_device = current_device