Conditions | 4 |
Total Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | from niprov.format import Format |
||
34 | def saveToDisk(self, for_): |
||
35 | imgId = for_.provenance['id'] |
||
36 | fpath = os.path.expanduser('~/.niprov-snapshots/{}.png'.format(imgId)) |
||
37 | if os.path.isfile(fpath): |
||
38 | return fpath |
||
39 | elif imgId in _CACHE: |
||
40 | with open(fpath, 'w') as picfile: |
||
41 | picfile.write(_CACHE[imgId]) |
||
42 | return fpath |
||
43 | else: |
||
44 | return None |
||
45 | |||
53 |