Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p8tool listrawlua fails with "no attribute 'get_raw_data_from_p8_file'" #102

Open
hsandt opened this issue Apr 20, 2022 · 0 comments
Open

Comments

@hsandt
Copy link

hsandt commented Apr 20, 2022

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
sys.exit(main())
File "
/.local/lib/python3.8/site-packages/pico8/tool.py", line 625, in main
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant