Logo Search packages:      
Sourcecode: eikazo version File versions  Download package

def Eikazo::Widgets::SaneDevice::adf_mode (   self  ) 

check, if an ADF is available and selected
    returns or True or False

Definition at line 601 of file Widgets.py.

00601                       :
        """ check, if an ADF is available and selected
            returns or True or False
        """
        # FIXME: is the list of possible strings which "indicate" an
        # ADF complete or not??
        # FIXME: If we have an ADF scanner without a "source" option,
        # or an inactive "source" option, False will be returned. 
        # That's not, what we want... I don't see another way to detect
        # an ADF, and if it is enabled, except from the 'source' option...
        # A candidate from this case is for example the fi-5110
        # PROBLEM: We can't read inactive options...
        
        # grepping the Sane backend sources, the following ways exist
        # to select and detect an ADF:
        #
        # option source has one of the values:
        #   'ADF'                       (avision, hp, microtek2, sp15c)
        #   'ADF Rear'                  (avision)
        #   'ADF Duplex'                (avision, fujitsu)
        #   'ADF Front'                 (fujitsu)
        #   'ADF Back'                  (fujitsu)
        #   'Automatic Document Feeder' (bh, epson, mustek, nec, pixma,
        #                                sharp, umax)
        #   'Document Feeder'           (snapscan)
        #   'Filmstrip'                 (microtek2)
        #     I'm not 100% sure about Filmstrip, but it could make sense
        #     to treat it similary to an ADF
        #
        # bool option 'adf': artec, ibm
        # bool option 'noadf': canon
        # string option 'feeder-mode', value 'All Pages': matsushita
        #
        # FIXME: The backends plustek, ma1509, matsushita seem to support
        # ADFs too, but I could not figure out, how these can be detected
        # The plustek backend perhaps uses the device type string
        # 'USB sheet-fed scanner', and the matsushita backend uses the
        # device type string 'sheetfed scanner'.
        # The ma1509 describes itself as a 'flatbed scanner', so there
        # seems to be no way to dicover, if an ADF is used or installed...
        
        
        optnames = self.getOptionNames()
        try:
            if 'source' in optnames:
                source = self._device.source
                for test in ('ADF', 'Document Feeder'):
                    if source.find(test) >= 0:
                        return True
        except AttributeError, errval:
            if str(errval) == 'Inactive option: source':
                return False
            raise
        
        if 'adf' in optnames:
            try:
                return self._device.adf
            except AttributeError, errval:
                if str(errval) == 'Inactive option: adf':
                    return False
                raise
        elif 'noadf' in optnames:
            try:
                return not self._device.noadf
            except AttributeError, errval:
                if str(errval) == 'Inactive option: noadf':
                    return False
                raise
        elif 'feeder_mode' in optnames:
            try:
                return self._device.feeder_mode == 'All Pages'
            except AttributeError, errval:
                if str(errval) == 'Inactive option: adf':
                    return False
                raise
        return False

    def duplex_mode(self):


Generated by  Doxygen 1.6.0   Back to index