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

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

a trivial wrapper for Sane.SaneDev.get_options.
Returns a list of tuples describing all the available options.

A tuple consists of:
  - [0] the option number 	(integer)
  - [1] name			(string)
  - [2] title			(string)
  - [3] description		(string)
  - [4] type 			integer, with the following meaning:
        0	SANE_TYPE_BOOL
        1	SANE_TYPE_INT
        2	SANE_TYPE_FIXED
        3	SANE_TYPE_STRING
        4	SANE_TYPE_BUTTON
        5	SANE_TYPE_GROUP
        (see Sane API doc, section 4.2.9.4)
  - [5] unit	integer, with the following meaning:
    0	SANE_UNIT_NONE
    1	SANE_UNIT_PIXEL
    2	SANE_UNIT_BIT
    3	SANE_UNIT_MM
    4	SANE_UNIT_DPI
    5	SANE_UNIT_PERCENT
    6	SANE_UNIT_MICROSECOND
    (see Sane API doc, section 4.2.9.5)
  - [6] size	integer, with the following meaning:
    for SANE_TYPE_STRING options: 
      max length of the string
    for SANE_TYPE_INT, SANE_TYPE_FIXED:
      "vector length": number of option values, mulptplied by
      sizeof(SANE_Word) this should be "scaled down"
      to the "real" vector length
    for SANE_TYPE_BOOL options:
      must be sizeof(SANE_Word)
    for SANE_TYPE_BUTTON, SANE_TYPE_GROUP:
      not used
  - [7] cap		integer
    bitset:
    1	SANE_CAP_SOFT_SELECT, The option value can be set by 
        a call to sane_control_option()
    2	SANE_CAP_HARD_SELECT.  	 The option value can be set 
        by user-intervention (e.g., by flipping a switch). The 
        user-interface should prompt the user to execute the 
        appropriate action to set such an option. This 
        capability is mutually exclusive with 
        SANE_CAP_SOFT_SELECT (either one of them can be set, 
        but not both simultaneously).
    4	SANE_CAP_SOFT_DETECT The option value can be detected 
        by software. If SANE_CAP_SOFT_SELECT is set, this 
        capability must  be set. If SANE_CAP_HARD_SELECT is set, 
        this capability may or may not be set. If this capability 
        is set but neither SANE_CAP_SOFT_SELECT nor 
        SANE_CAP_HARD_SELECT  are, then there is no way to 
        control the option. That is, the option provides read-out
        of the current value only. 
    8	SANE_CAP_EMULATED. If set, this capability indicates that
        an option is not directly supported by the device and is 
        instead emulated in the backend. A sophisticated frontend
        may elect to use its own (presumably better) emulation in
        lieu of an emulated option.
    16	SANE_CAP_AUTOMATIC.  If set, this capability indicates 
        that the backend (or the device) is capable to picking a 
        reasonable option value automatically. For such options, 
        it is possible to select automatic operation by calling 
        sane_control_option()  with an action value of 
        SANE_ACTION_SET_AUTO.
    32	SANE_CAP_INACTIVE. If set, this capability indicates that
        the option is not currently active (e.g., because it's 
        meaningful only if another option is set to some other 
        value).
    64	SANE_CAP_ADVANCED. If set, this capability indicates that
        the option should be considered an ``advanced user 
        option.'' A frontend typically displays such options in 
        a less conspicuous way than regular options (e.g., a 
        command line interface may list such options last or a 
        graphical interface may make them available in a seperate
        ``advanced settings'' dialog).
  - [8] constraint
    None, if the option has no constraint
    tuple of length 3 for SANE_CONSTRAINT_RANGE: min, max, quant
      int values for SANE_TYPE_INT options
      float values for SANE_TYPE_FIXED options 
    list of numeric or string values.
      numeric values are ints for SANE_TYPE_INT options and 
      floats for SANE_TYPE_FIXED options
  - [9] python name The is the same as name, except that '-' characters
    are replaced by '_'

Definition at line 274 of file Widgets.py.

00274                         :
        """ a trivial wrapper for Sane.SaneDev.get_options.
        Returns a list of tuples describing all the available options.
        
        A tuple consists of:
          - [0] the option number   (integer)
          - [1] name                (string)
          - [2] title               (string)
          - [3] description         (string)
          - [4] type                integer, with the following meaning:
                        0     SANE_TYPE_BOOL
                        1     SANE_TYPE_INT
                        2     SANE_TYPE_FIXED
                        3     SANE_TYPE_STRING
                        4     SANE_TYPE_BUTTON
                        5     SANE_TYPE_GROUP
                        (see Sane API doc, section 4.2.9.4)
          - [5] unit    integer, with the following meaning:
                    0   SANE_UNIT_NONE
                    1   SANE_UNIT_PIXEL
                    2   SANE_UNIT_BIT
                    3   SANE_UNIT_MM
                    4   SANE_UNIT_DPI
                    5   SANE_UNIT_PERCENT
                    6   SANE_UNIT_MICROSECOND
                    (see Sane API doc, section 4.2.9.5)
          - [6] size    integer, with the following meaning:
                    for SANE_TYPE_STRING options: 
                      max length of the string
                    for SANE_TYPE_INT, SANE_TYPE_FIXED:
                      "vector length": number of option values, mulptplied by
                      sizeof(SANE_Word) this should be "scaled down"
                      to the "real" vector length
                    for SANE_TYPE_BOOL options:
                      must be sizeof(SANE_Word)
                    for SANE_TYPE_BUTTON, SANE_TYPE_GROUP:
                      not used
          - [7] cap           integer
                    bitset:
                    1   SANE_CAP_SOFT_SELECT, The option value can be set by 
                        a call to sane_control_option()
                    2   SANE_CAP_HARD_SELECT.    The option value can be set 
                        by user-intervention (e.g., by flipping a switch). The 
                        user-interface should prompt the user to execute the 
                        appropriate action to set such an option. This 
                        capability is mutually exclusive with 
                        SANE_CAP_SOFT_SELECT (either one of them can be set, 
                        but not both simultaneously).
                    4   SANE_CAP_SOFT_DETECT The option value can be detected 
                        by software. If SANE_CAP_SOFT_SELECT is set, this 
                        capability must  be set. If SANE_CAP_HARD_SELECT is set, 
                        this capability may or may not be set. If this capability 
                        is set but neither SANE_CAP_SOFT_SELECT nor 
                        SANE_CAP_HARD_SELECT  are, then there is no way to 
                        control the option. That is, the option provides read-out
                        of the current value only. 
                    8   SANE_CAP_EMULATED. If set, this capability indicates that
                        an option is not directly supported by the device and is 
                        instead emulated in the backend. A sophisticated frontend
                        may elect to use its own (presumably better) emulation in
                        lieu of an emulated option.
                    16  SANE_CAP_AUTOMATIC.  If set, this capability indicates 
                        that the backend (or the device) is capable to picking a 
                        reasonable option value automatically. For such options, 
                        it is possible to select automatic operation by calling 
                        sane_control_option()  with an action value of 
                        SANE_ACTION_SET_AUTO.
                    32  SANE_CAP_INACTIVE. If set, this capability indicates that
                        the option is not currently active (e.g., because it's 
                        meaningful only if another option is set to some other 
                        value).
                    64  SANE_CAP_ADVANCED. If set, this capability indicates that
                        the option should be considered an ``advanced user 
                        option.'' A frontend typically displays such options in 
                        a less conspicuous way than regular options (e.g., a 
                        command line interface may list such options last or a 
                        graphical interface may make them available in a seperate
                        ``advanced settings'' dialog).
          - [8] constraint
                    None, if the option has no constraint
                    tuple of length 3 for SANE_CONSTRAINT_RANGE: min, max, quant
                      int values for SANE_TYPE_INT options
                      float values for SANE_TYPE_FIXED options 
                    list of numeric or string values.
                      numeric values are ints for SANE_TYPE_INT options and 
                      floats for SANE_TYPE_FIXED options
          - [9] python name The is the same as name, except that '-' characters
                    are replaced by '_'
        """
        res = self._device.get_options()
        res = [list(x) for x in res]
        # The Sharp backend for example does not provide option names
        # for group options, only titles.
        [x.append(x[1] and x[1].replace('-', '_') or x[1]) for x in res]
        return [tuple(x) for x in res]
          
    def getGroupedOptionNames(self):


Generated by  Doxygen 1.6.0   Back to index