Running wmlindent 1.17.16

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
white_haired_uncle
Posts: 1109
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

Running wmlindent 1.17.16

Post by white_haired_uncle »

I guess this is more or less the right place to point this out?

Built 1.17.16 on U22.04. The wmlindent in /usr/local/bin fails, while the one in /usr/local/share works. They sure look like the same thing. I assume it has something to do with a path for python to find the right modules(?), and it's looking relative to the executable?

I tried to track it down, but I don't know python and was only able to get as far as a different error before I was ready to just alias wmlindent to the working one, or maybe change my PATH. But, I think this really should work out of the box for any user.

Code: Select all

spartan$ /usr/local/share/wesnoth/data/tools/wmlindent utils/chapter9_utils.cfg
wmlindent: utils/chapter9_utils.cfg changed

spartan$ /usr/local/bin/wmlindent utils/chapter9_utils.cfg                     
Traceback (most recent call last):
  File "/usr/local/bin/wmlindent", line 65, in <module>
    from wesnoth import wmltools3 as wmltools
ModuleNotFoundError: No module named 'wesnoth'

spartan$ cksum /usr/local/share/wesnoth/data/tools/wmlindent /usr/local/bin/wmlindent
3341482996 16594 /usr/local/share/wesnoth/data/tools/wmlindent
3341482996 16594 /usr/local/bin/wmlindent
P.S. During the process, I found this GUI.pyw which is pretty cool, but seems to depend on pyhton3-tk. Seems to me like if it needs this, an error should be raised at install time. Like I say, I don't know python, maybe it's a thing, but IMO if something is going to fail, it's better to catch it at install time when the user is thinking about the changes they are making than to have them have to come back and troubleshoot at a potentially much later runtime.
User avatar
Pentarctagon
Project Manager
Posts: 5527
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Running wmlindent 1.17.16

Post by Pentarctagon »

How did you build and install it?
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Ravana
Forum Moderator
Posts: 2949
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Running wmlindent 1.17.16

Post by Ravana »

Yes, dont copy to /usr/local/bin/wmlindent, make it link instead.
white_haired_uncle
Posts: 1109
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

Re: Running wmlindent 1.17.16

Post by white_haired_uncle »

scons wesnoth
sudo scons install
sudo scons install-pytools
sudo apt install python3-tk

spartan$ ls -li /usr/local/share/wesnoth/data/tools/wmlindent /usr/local/bin/wmlindent
1328699 -rwxrwxr-x 1 root root 16594 Apr 22 23:34 /usr/local/bin/wmlindent
1348946 -rwxrwxr-x 1 root root 16594 Apr 22 23:34 /usr/local/share/wesnoth/data/tools/wmlindent

Basically, I followed https://github.com/wesnoth/wesnoth/blob ... INSTALL.md but then when I couldn't find wmlindent I looked into the scons options and ran install-pytools, and then installed python3-tk to get the gui to work. I was kind of making things up there at the end, be nice if something could be added to the build page.

Thanks
Last edited by white_haired_uncle on June 7th, 2023, 2:44 am, edited 1 time in total.
Soliton
Site Administrator
Posts: 1680
Joined: April 5th, 2005, 3:25 pm
Location: #wesnoth-mp

Re: Running wmlindent 1.17.16

Post by Soliton »

Sounds like install-pytools does not work correctly. I'm guessing that is never tested. You could open a bug report about it.
"If gameplay requires it, they can be made to live on Venus." -- scott
Post Reply