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.62k stars 237 forks source link

Effect class is imported wrong, Fails to create cache files inside a new directory. #308

Closed tomlin7 closed 3 years ago

tomlin7 commented 3 years ago

What issues does this fix?

What does this implement/fix?

coveralls commented 3 years ago

Coverage Status

Coverage remained the same at 97.162% when pulling 0541a6aedd9efb25e03539d8c28901f8d3416124 on billyeatcookies:patch-1 into 770a097cb532cc1fdbcf5f7889bfcdeeddd92b3c on peterbrittain:master.

peterbrittain commented 3 years ago

Import change is good. Not so keen onnthe cache change... It's meant to use a separate directory. A better fix would be to make it ensure that directory exists on start up. Are you happy to make that change?

tomlin7 commented 3 years ago

python fails to create a file inside another folder, that was the main problem I was facing.

image

tomlin7 commented 3 years ago

first creating a directory, and then saving the files worked! i shall implement it. image

peterbrittain commented 3 years ago

Excellent! That is exactly the sort of fix that I was talking about.

peterbrittain commented 3 years ago

Looking better. A slightly simpler solution would be just to call mkdir in Map.__init__. This will always run before any of those commands and so ensure that the directory exists. If a user actually deletes the directory while running, you'll hit an exception and that would be justified IMHO.