1 |
On 09 Nov 2015 16:05, Mike Frysinger wrote: |
2 |
> + with tempfile.NamedTemporaryFile(prefix='catalyst.conf.') as conf: |
3 |
> + # Set up a config file with paths to the local tree. |
4 |
> + conf.write( |
5 |
> + ('sharedir=%(source_root)s\n' |
6 |
> + 'shdir=%(source_root)s/targets\n' |
7 |
> + 'envscript=%(source_root)s/etc/catalystrc\n' |
8 |
> + % {'source_root': source_root}).encode('utf8') |
9 |
> + ) |
10 |
> + conf.flush() |
11 |
|
12 |
before anyone suggests using the buffering option when creating |
13 |
tempfile.NamedTemporaryFile, you should be aware that the arg |
14 |
name & meaning changed between py2 & py3. it's simpler to flush. |
15 |
-mike |