duplicity-talk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Duplicity-talk] Setting the PASSPHRASE inside the duplicity program


From: Steven Willoughby
Subject: Re: [Duplicity-talk] Setting the PASSPHRASE inside the duplicity program itself
Date: Mon, 26 Mar 2007 14:20:09 -0600
User-agent: Thunderbird 1.5.0.10 (X11/20070307)

Charles Knowlton wrote:
How would I set the PASSPHRASE inside the duplicity program itself?

I'm not sure why you would want to do this instead of using the
environment variable.

I am looking at this section of code:

def get_passphrase():
"""Get passphrase from environment or, failing that, from user"""
try: return os.environ['PASSPHRASE']

All you need to do is:

def get_passphrase():
        """Get passphrase from environment or, failing that, from user"""
        try: return os.environ['PASSPHRASE']
        except KeyError: pass
        if not globals.encryption: return "" # assume we don't need passphrase

        return "blarg"

The rest of the function would then no longer be necessary.

I had tried setting the variable pass1 = 'test'
but that didn't work. I got this error message:
File "/usr/bin/duplicity2", line 38
self_pass1 = "crap"
^
IndentationError: expected an indented block

I don't have a clue as to what it means and I don't know anything about Python.

Python is whitespace dependent. It cares about the number of spaces or
tabs at the beginning of each line as that is how it determines when a
function definition ends. The line that you changed should begin with
two tab characters.

Steven




reply via email to

[Prev in Thread] Current Thread [Next in Thread]