41 def launch(self, passphrase=None): |
41 def launch(self, passphrase=None): |
42 cmd=self.construct_cmdline() |
42 cmd=self.construct_cmdline() |
43 |
43 |
44 logger.info('Launching ' + str(cmd)) |
44 logger.info('Launching ' + str(cmd)) |
45 |
45 |
|
46 # Set passphrase if not, or set to empty if not known, so borg |
|
47 # won't hang waiting for it, which seems to happen even if we |
|
48 # close stdin. |
46 env=os.environ.copy() |
49 env=os.environ.copy() |
47 if passphrase: |
50 env['BORG_PASSPHRASE']=passphrase or '' |
48 env['BORG_PASSPHRASE']=passphrase |
|
49 |
51 |
50 # Workaround: if launched is a standalone app created with py2app, |
52 # Workaround: if launched is a standalone app created with py2app, |
51 # borg will fail unless Python environment is reset. |
53 # borg will fail unless Python environment is reset. |
52 # TODO: Of course, this will fail if the system needs the variables |
54 # TODO: Of course, this will fail if the system needs the variables |
53 # PYTHONPATH or PYTHONHOME set to certain values. |
55 # PYTHONPATH or PYTHONHOME set to certain values. |