Skip to content

Commit

Permalink
Effect class is imported wrong, Fails to create cache files inside a …
Browse files Browse the repository at this point in the history
…new directory. (#308)

Fixed bad import and case where cache directory doesn't exist in maps sample
  • Loading branch information
tomlin7 committed Apr 28, 2021
1 parent 770a097 commit 6b879cb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion samples/maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
from collections import OrderedDict
from asciimatics.event import KeyboardEvent
from asciimatics.renderers import ColourImageFile
from asciimatics.widgets import Effect, Button, Text, Layout, Frame, Divider, PopUpDialog
from asciimatics.effects import Effect
from asciimatics.widgets import Button, Text, Layout, Frame, Divider, PopUpDialog
from asciimatics.scene import Scene
from asciimatics.screen import Screen
from asciimatics.exceptions import ResizeScreenError, StopApplication, InvalidFields
Expand Down Expand Up @@ -136,6 +137,10 @@ def __init__(self, screen):
self._thread = threading.Thread(target=self._get_tiles)
self._thread.daemon = True
self._thread.start()

# a separate directory to store cached files.
if not os.path.isdir('mapscache'):
os.mkdir('mapscache')

def _scale_coords(self, x, y, extent, xo, yo):
"""Convert from tile coordinates to "pixels" - i.e. text characters."""
Expand Down

0 comments on commit 6b879cb

Please sign in to comment.