(group=None)
Get a specific group of options which are allowed.
Get a specific group of options which are allowed.
Get a specific group of options which are allowed .
def _get_options_group(group=None):
    """Get a specific group of options which are allowed."""

    #: These expect a hexidecimal keyid as their argument, and can be parsed
    #: with :func:`_is_hex`.
    hex_options = frozenset(['--check-sigs',
                             '--default-key',
                             '--default-recipient',
                             '--delete-keys',
                             '--delete-secret-keys',
                             '--delete-secret-and-public-keys',
                             '--desig-revoke',
                             '--export',
                             '--export-secret-keys',
                             '--export-secret-subkeys',
                             '--fingerprint',
                             '--gen-revoke',
                             '--hidden-encrypt-to',
                             '--hidden-recipient',
                             '--list-key',
                             '--list-keys',
                             '--list-public-keys',
                             '--list-secret-keys',
                             '--list-sigs',
                             '--recipient',
                             '--recv-keys',
                             '--send-keys',
                             '--edit-key',
                             '--sign-key',
                             ])
    #: These options expect value which are left unchecked, though still run
    #: through :func:`_fix_unsafe`.
    unchecked_options = frozenset(['--list-options',
                                   '--passphrase-fd',
                                   '--status-fd',
                                   '--verify-options',
                                   '--command-fd',
                               ])
    #: These have their own parsers and don't really fit into a group
    other_options = frozenset(['--debug-level',
                               '--keyserver',

                           ])
    #: These should have a directory for an argument
    dir_options = frozenset(['--homedir',
                             ])
    #: These expect a keyring or keyfile as their argument
    keyring_options = frozenset(['--keyring',
                                 '--primary-keyring',
                                 '--secret-keyring',
                                 '--trustdb-name',
                                 ])
    #: These expect a filename (or the contents of a file as a string) or None
    #: (meaning that they read from stdin)
    file_or_none_options = frozenset(['--decrypt',
                                      '--decrypt-files',
                                      '--encrypt',
                                      '--encrypt-files',
                                      '--import',
                                      '--verify',
                                      '--verify-files',
                                      '--output',
                                      ])
    #: These options expect a string. see :func:`_check_preferences`.
    pref_options = frozenset(['--digest-algo',
                              '--cipher-algo',
                              '--compress-algo',
                              '--compression-algo',
                              '--cert-digest-algo',
                              '--personal-digest-prefs',
                              '--personal-digest-preferences',
                              '--personal-cipher-prefs',
                              '--personal-cipher-preferences',
                              '--personal-compress-prefs',
                              '--personal-compress-preferences',
                              '--pinentry-mode',
                              '--print-md',
                              '--trust-model',
                              ])
    #: These options expect no arguments
    none_options = frozenset(['--allow-loopback-pinentry',
                              '--always-trust',
                              '--armor',
                              '--armour',
                              '--batch',
                              '--check-sigs',
                              '--check-trustdb',
                              '--clearsign',
                              '--debug-all',
                              '--default-recipient-self',
                              '--detach-sign',
                              '--export',
                              '--export-ownertrust',
                              '--export-secret-keys',
                              '--export-secret-subkeys',
                              '--fingerprint',
                              '--fixed-list-mode',
                              '--gen-key',
                              '--import-ownertrust',
                              '--list-config',
                              '--list-key',
                              '--list-keys',
                              '--list-packets',
                              '--list-public-keys',
                              '--list-secret-keys',
                              '--list-sigs',
                              '--lock-multiple',
                              '--lock-never',
                              '--lock-once',
                              '--no-default-keyring',
                              '--no-default-recipient',
                              '--no-emit-version',
                              '--no-options',
                              '--no-tty',
                              '--no-use-agent',
                              '--no-verbose',
                              '--print-mds',
                              '--quiet',
                              '--sign',
                              '--symmetric',
                              '--throw-keyids',
                              '--use-agent',
                              '--verbose',
                              '--version',
                              '--with-colons',
                              '--yes',
                              ])
    #: These options expect either None or a hex string
    hex_or_none_options = hex_options.intersection(none_options)
    allowed = hex_options.union(unchecked_options, other_options, dir_options,
                                keyring_options, file_or_none_options,
                                pref_options, none_options)

    if group and group in locals().keys():
        return locals()[group]
def _get_options_group ( group = None ) : #: These expect a hexidecimal keyid as their argument, and can be parsed #: with :func:`_is_hex`. hex_options = frozenset ( [ '--check-sigs' , '--default-key' , '--default-recipient' , '--delete-keys' , '--delete-secret-keys' , '--delete-secret-and-public-keys' , '--desig-revoke' , '--export' , '--export-secret-keys' , '--export-secret-subkeys' , '--fingerprint' , '--gen-revoke' , '--hidden-encrypt-to' , '--hidden-recipient' , '--list-key' , '--list-keys' , '--list-public-keys' , '--list-secret-keys' , '--list-sigs' , '--recipient' , '--recv-keys' , '--send-keys' , '--edit-key' , '--sign-key' , ] ) #: These options expect value which are left unchecked, though still run #: through :func:`_fix_unsafe`. unchecked_options = frozenset ( [ '--list-options' , '--passphrase-fd' , '--status-fd' , '--verify-options' , '--command-fd' , ] ) #: These have their own parsers and don't really fit into a group other_options = frozenset ( [ '--debug-level' , '--keyserver' , ] ) #: These should have a directory for an argument dir_options = frozenset ( [ '--homedir' , ] ) #: These expect a keyring or keyfile as their argument keyring_options = frozenset ( [ '--keyring' , '--primary-keyring' , '--secret-keyring' , '--trustdb-name' , ] ) #: These expect a filename (or the contents of a file as a string) or None #: (meaning that they read from stdin) file_or_none_options = frozenset ( [ '--decrypt' , '--decrypt-files' , '--encrypt' , '--encrypt-files' , '--import' , '--verify' , '--verify-files' , '--output' , ] ) #: These options expect a string. see :func:`_check_preferences`. pref_options = frozenset ( [ '--digest-algo' , '--cipher-algo' , '--compress-algo' , '--compression-algo' , '--cert-digest-algo' , '--personal-digest-prefs' , '--personal-digest-preferences' , '--personal-cipher-prefs' , '--personal-cipher-preferences' , '--personal-compress-prefs' , '--personal-compress-preferences' , '--pinentry-mode' , '--print-md' , '--trust-model' , ] ) #: These options expect no arguments none_options = frozenset ( [ '--allow-loopback-pinentry' , '--always-trust' , '--armor' , '--armour' , '--batch' , '--check-sigs' , '--check-trustdb' , '--clearsign' , '--debug-all' , '--default-recipient-self' , '--detach-sign' , '--export' , '--export-ownertrust' , '--export-secret-keys' , '--export-secret-subkeys' , '--fingerprint' , '--fixed-list-mode' , '--gen-key' , '--import-ownertrust' , '--list-config' , '--list-key' , '--list-keys' , '--list-packets' , '--list-public-keys' , '--list-secret-keys' , '--list-sigs' , '--lock-multiple' , '--lock-never' , '--lock-once' , '--no-default-keyring' , '--no-default-recipient' , '--no-emit-version' , '--no-options' , '--no-tty' , '--no-use-agent' , '--no-verbose' , '--print-mds' , '--quiet' , '--sign' , '--symmetric' , '--throw-keyids' , '--use-agent' , '--verbose' , '--version' , '--with-colons' , '--yes' , ] ) #: These options expect either None or a hex string hex_or_none_options = hex_options . intersection ( none_options ) allowed = hex_options . union ( unchecked_options , other_options , dir_options , keyring_options , file_or_none_options , pref_options , none_options ) if group and group in locals ( ) . keys ( ) : return locals ( ) [ group ]