p8tool listrawlua fails with "no attribute 'get_raw_data_from_p8_file'"
hsandt opened this issue · 0 comments
Error
After upgrading to latest picotool, in the hope that the new Unicode support allows me to work with glyphs, I tried to run p8tool listrawlua myfile.p8
but I got:
Traceback (most recent call last):
File "/.local/bin/p8tool", line 8, in/.local/lib/python3.8/site-packages/pico8/tool.py", line 625, in main
sys.exit(main())
File "
return args.func(args)
File "~/.local/lib/python3.8/site-packages/pico8/tool.py", line 188, in listrawlua
data = game.Game.get_raw_data_from_p8_file(fh, fname)
AttributeError: type object 'Game' has no attribute 'get_raw_data_from_p8_file'
Fix
A quick inspection of the code shows me that p8.py now defines a _get_raw_data_from_p8_file
(with underscore). So in tool.py, in listrawlua, I replaced game.Game.get_raw_data_from_p8_file
with _get_raw_data_from_p8_file
, and also imported it at the top with:
from pico8.game.formatter.p8 import _get_raw_data_from_p8_file
Doing this (and reinstalling the tool with pip install --user --force-reinstall .
) effectively fixes the Python error and make the command basically work.
Bonus issue
I noticed, however, that my glyph is not correctly transcribed.
🅾️
becomes ユか✽ゆヤま◆
during the listrawlua translation.
A simple p8tool listlua
, on the other side, will convert it to underscores: _______
which is the initial issue I had (even with listrawlua) with the previous version of picotool.