Package duplicity :: Module GnuPGInterface :: Class Options
[hide private]
[frames] | no frames]

Class Options

source code

Objects of this class encompass options passed to GnuPG.
This class is responsible for determining command-line arguments
which are based on options.  It can be said that a GnuPG
object has-a Options object in its options attribute.

Attributes which correlate directly to GnuPG options:

Each option here defaults to false or None, and is described in
GnuPG documentation.

Booleans (set these attributes to booleans)

  * armor
  * no_greeting
  * no_verbose
  * quiet
  * batch
  * always_trust
  * rfc1991
  * openpgp
  * force_v3_sigs
  * no_options
  * textmode

Strings (set these attributes to strings)

  * homedir
  * default_key
  * comment
  * compress_algo
  * options

Lists (set these attributes to lists)

  * recipients  (***NOTE*** plural of 'recipient')
  * encrypt_to

Meta options

Meta options are options provided by this module that do
not correlate directly to any GnuPG option by name,
but are rather bundle of options used to accomplish
a specific goal, such as obtaining compatibility with PGP 5.
The actual arguments each of these reflects may change with time.  Each
defaults to false unless otherwise specified.

meta_pgp_5_compatible -- If true, arguments are generated to try
to be compatible with PGP 5.x.

meta_pgp_2_compatible -- If true, arguments are generated to try
to be compatible with PGP 2.x.

meta_interactive -- If false, arguments are generated to try to
help the using program use GnuPG in a non-interactive
environment, such as CGI scripts.  Default is true.

extra_args -- Extra option arguments may be passed in
via the attribute extra_args, a list.

>>> import GnuPGInterface
>>>
>>> gnupg = GnuPGInterface.GnuPG()
>>> gnupg.options.armor = 1
>>> gnupg.options.recipients = ['Alice', 'Bob']
>>> gnupg.options.extra_args = ['--no-secmem-warning']
>>>
>>> # no need for users to call this normally; just for show here
>>> gnupg.options.get_args()
['--armor', '--recipient', 'Alice', '--recipient', 'Bob', '--no-secmem-warning']



Instance Methods [hide private]
 
__init__(self) source code
 
get_args(self)
Generate a list of GnuPG arguments based upon attributes.
source code
 
get_standard_args(self)
Generate a list of standard, non-meta or extra arguments
source code
 
get_meta_args(self)
Get a list of generated meta-arguments
source code