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