peterbrittain / asciimatics

A cross platform package to do curses-like operations, plus higher level APIs and widgets to create text UIs and ASCII art animations
Apache License 2.0
3.64k stars 238 forks source link

Error while creating/reading created cache files (samples) #307

Closed tomlin7 closed 3 years ago

tomlin7 commented 3 years ago

Describe the bug Fails to create cache files inside a new mapscache directory.

Traceback (most recent call last):
  File "test.py", line 561, in <module>
    Screen.wrapper(demo, catch_interrupt=False, arguments=[last_scene])
  File "C:\path\to\python\test\lib\site-packages\asciimatics\screen.py", line 1393, in wrapper
    return func(screen, *arguments)
  File "test.py", line 554, in demo
    screen.play([Scene([Map(screen)], -1)], stop_on_resize=True, start_scene=scene)
  File "C:\path\to\python\test\lib\site-packages\asciimatics\screen.py", line 1566, in play
    self.draw_next_frame(repeat=repeat)
  File "C:\path\to\python\test\lib\site-packages\asciimatics\screen.py", line 1669, in draw_next_frame
    effect.update(self._frame)
  File "C:\path\to\python\test\lib\site-packages\asciimatics\effects.py", line 71, in update
    self._update(frame_no)
  File "test.py", line 452, in _update
    raise RuntimeError(self._oops)
RuntimeError: Traceback (most recent call last):
  File "test.py", line 241, in _get_tiles
    self._get_vector_tile(x_tile, y_tile, z_tile)
  File "test.py", line 189, in _get_vector_tile
    with open(cache_file, mode='w') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'mapscache/0.0.0.json'
 - tile loc: 0 0 0

To Reproduce

Expected behavior Script should fetch maps and display ASCII version of maps.

Screenshots image

System details:

peterbrittain commented 3 years ago

I'm guessing you're not running from the checked out code samples directory. This is meant to use the mapscache sub-directory in there.

peterbrittain commented 3 years ago

Now fixed.