A GUI for wmllint

Discussion of all aspects of the game engine, including development of new and existing features.

Moderator: Forum Moderators

User avatar
vultraz
Developer
Posts: 960
Joined: February 7th, 2011, 12:51 pm
Location: Dodging Daleks

Re: A GUI for wmllint

Post by vultraz »

Bugs:
  • Windows 8.1 64 bit, the output box isn't scrollable via mouse scroll wheel
  • Program will freeze and have to force quitted if a wmltool throws an error - the GUI run process doesn't have a fallback to main in that case
Suggestions:
  • Make the output box flush with the options so there isn't the huge bit of empty space when maximized, as shown in the screenshot. EDIT: seems only to affect the wmlindent tab, so maybe ignore this, or extend the wmlindent options down instead?
  • Clear the output on each new run
  • Allow an option to Cancel if you try to run without a directory selected
  • By default, point the Browse dialog to the userdata directory
  • Allow selection of a file instead of just a directory for the tools target
Attachments
Screenshot 2014-06-11 21.59.33.png
Creator of Shadows of Deception (for 1.12) and co-creator of the Era of Chaos (for 1.12/1.13).
SurvivalXtreme rocks!!!
What happens when you get scared half to death...twice?
User avatar
Elvish_Hunter
Posts: 1575
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: A GUI for wmllint

Post by Elvish_Hunter »

First of all, I can't help but notice that you screenshot looks outdated, like the original Tkinter; what version of Python are you using?
I'm asking, because I just found an incredible bug, at least in Python 2.7.7 32-bit: here, ttk is missing the xpnative and the vistanative themes, that are the ones that give it the updated look! :augh: If you want to test by yourself, type this in IDLE for 2.7.7:

Code: Select all

>>> from ttk import *
>>> Style.theme_names()
It should output ('winnative', 'clam', 'alt', 'default', 'classic').
Instead, typing this in IDLE for 3.4.1:

Code: Select all

>>> from tkinter.ttk import *
>>> Style().theme_names()
returns this: ('winnative', 'clam', 'alt', 'default', 'classic', 'vista', 'xpnative').
Needless to say, everything worked fine in 2.7.5...Image
And now, your points:
vultraz wrote:Windows 8.1 64 bit, the output box isn't scrollable via mouse scroll wheel
I just tested on Windows 7, and the scroll wheel works, if you click on the text widget first. ;) Maybe I should force the focus on the text box after running the tools.
vultraz wrote:Program will freeze and have to force quitted if a wmltool throws an error - the GUI run process doesn't have a fallback to main in that case
It doesn't have to fallback. Using the threading module means that the GUI and the subprocess are handled in parallel. Besides, the subprocess must not touch the GUI at all, otherwise we're rewarded with some nice segfaults. That's why I'm also using a queue.
At least, this strategy worked on Python 2.7.5. On 2.7.7 (again... Image), it freezes for me as well. Once again, I fear that this is an upstream bug, and I advise you to fall back on 2.7.5.
But even 3.4.1 isn't immune from problems: while on 3.4.0 everything worked fine, on 3.4.1 I get a weird OSError: [WinError 87] Incorrect parameter errorImage.
vultraz wrote:Clear the output on each new run
That was intentional. I thought that, maybe, someone wants to run two or three tools in a row, and then generate a single output - I know that I do.
vultraz wrote:By default, point the Browse dialog to the userdata directory
It may be doable, but Windows XP one can choose to keep the userdata in the install location: that could be an issue.
vultraz wrote:Allow selection of a file instead of just a directory for the tools target
The problem here is that a file selection dialog and a directory selection dialog are two different commands. I'd probably have to add a radiobutton and some callback; but if I allow file selection, allowing multiple file selection may become an even bigger problem, given that the askopenfilenames() function may return a tuple, but sometimes returns a string.
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
User avatar
vultraz
Developer
Posts: 960
Joined: February 7th, 2011, 12:51 pm
Location: Dodging Daleks

Re: A GUI for wmllint

Post by vultraz »

I have both Python 2.7.7 and 3.4.0 installed, and it was running off the former when I took the screenshot. Running it on 3.x looks much better. Perhaps we should work on updating wmltools for Python 3, and drop support for 2? I tried running the 2to3 script, and it fixes some print() calls, but they still throw syntax errors when run.
Creator of Shadows of Deception (for 1.12) and co-creator of the Era of Chaos (for 1.12/1.13).
SurvivalXtreme rocks!!!
What happens when you get scared half to death...twice?
User avatar
Elvish_Hunter
Posts: 1575
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: A GUI for wmllint

Post by Elvish_Hunter »

vultraz wrote:Running it on 3.x looks much better. Perhaps we should work on updating wmltools for Python 3, and drop support for 2?
That's not the problem. This is a bug, caused by some compilation issues, that hit the 2.7.7 version: http://bugs.python.org/issue21665.
vultraz wrote:I tried running the 2to3 script, and it fixes some print() calls, but they still throw syntax errors when run.
Oh, I tried it as well. But there aren't only wmllint, wmlscope and wmlindent around: there are a lot more scripts written in Python, like trackplacer (that maybe should ditch PyGTK and switch to Tkinter as well, using pillow to handle JPEG images), or the whole wmltools directory. In short, this isn't a work that me or you can handle alone: to move all our scripts to Python3, we'll need every mainline Python developer available, to split the job in manageable parts.
About the scroll wheel issue: I set the script so that the focus always follow the mouse pointer. This way, you just need to hover on the text box to use the wheel (see here).
About the freezing issue: I found where the problem was, and accidentally I gave myself the solution:
Elvish_Hunter wrote:Besides, the subprocess must not touch the GUI at all, otherwise we're rewarded with some nice segfaults.
I didn't realize that even showerror() counts as touching the GUI, and since the last changes in Python have made Tkinter a bit more sensible, I had to post a tuple in the queue. Then, the main thread checks the data type, and when it is a tuple the error message box appears (see here).
I haven't yet found a solution for the WinError 87 on Python 3.4.1: apparently, this error code could mean anything... :augh:
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
User avatar
Elvish_Hunter
Posts: 1575
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: A GUI for wmllint

Post by Elvish_Hunter »

Elvish_Hunter wrote:I haven't yet found a solution for the WinError 87 on Python 3.4.1: apparently, this error code could mean anything...
...but now I found it.
In the latest commits in master, I found and fixed the problem. It was caused by the fact that on Python 3, both the map() and filter() functions return an iterator, while on Python 2 they return a list. To fix the issue, I simply needed to cast the iterator by using the list() function. :twisted:
Elvish_Hunter wrote:This is a bug, caused by some compilation issues, that hit the 2.7.7 version: http://bugs.python.org/issue21665.
That problem is now fixed in Python 2.7.8. :D
By the way, the IntVar() instances associated with Checkbuttons are now replaced with BooleanVar() instances. Nothing changes for the user, but that was the correct thing to do from the very start - it's a pity that a lot of documentation overlooks BooleanVar(), causing mistakes like this one.
If no issue is found, I'll backport these changes to the stable series (the feature freeze doesn't apply to the maintenance tools).
Finally, I also updated the description in the wiki, mentioning the required installation of the python-tk package.
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
User avatar
vultraz
Developer
Posts: 960
Joined: February 7th, 2011, 12:51 pm
Location: Dodging Daleks

Re: A GUI for wmllint

Post by vultraz »

I've added an option to skip core while running wmllint in 53c2ef9cb72378f2f53e59ea082b946537b4d536. Only funny behavior is if you have this toggled on w/o a dir set so it basically does nothing, but I don't think a special case is needed for that, since the user should realize what's going on. :P
Creator of Shadows of Deception (for 1.12) and co-creator of the Era of Chaos (for 1.12/1.13).
SurvivalXtreme rocks!!!
What happens when you get scared half to death...twice?
User avatar
Elvish_Hunter
Posts: 1575
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: A GUI for wmllint

Post by Elvish_Hunter »

vultraz wrote:I've added an option to skip core while running wmllint
Uh... I don't think that it's a good idea :( . I attempted to run wmllint on what possibly is our cleanest mainline campaign (Dead Water) and excluding the core directory. This is the result:

Code: Select all

/usr/bin/python2 /home/linux/wesnoth-git-dev/code/data/tools/wmllint --dryrun --nospellcheck /home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 115: Walking Corpse is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 115: Soulless is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 115: Vampire Bat is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 115: Blood Bat is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 115: Skeleton Archer is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 115: Skeleton is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 117: no fighter units recruitable at difficulty NIGHTMARE.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 117: no fighter units recruitable at difficulty NIGHTMARE.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 117: no archer units recruitable at difficulty NIGHTMARE.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 117: no scout units recruitable at difficulty NIGHTMARE.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 117: no scout units recruitable at difficulty NIGHTMARE.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 117: no scout units recruitable at difficulty NIGHTMARE.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 108: Walking Corpse is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 108: Soulless is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 108: Vampire Bat is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 108: Blood Bat is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 108: Skeleton Archer is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 108: Skeleton is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 110: no fighter units recruitable at difficulty HARD.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 110: no fighter units recruitable at difficulty HARD.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 110: no archer units recruitable at difficulty HARD.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 110: no scout units recruitable at difficulty HARD.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 110: no scout units recruitable at difficulty HARD.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 94: Walking Corpse is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 94: Vampire Bat is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 94: Skeleton Archer is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 94: Skeleton is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 96: no fighter units recruitable at difficulty EASY.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 96: no fighter units recruitable at difficulty EASY.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 96: no archer units recruitable at difficulty EASY.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 96: no scout units recruitable at difficulty EASY.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 101: Walking Corpse is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 101: Soulless is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 101: Vampire Bat is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 101: Skeleton Archer is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 101: Skeleton is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 103: no fighter units recruitable at difficulty NORMAL.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 103: no fighter units recruitable at difficulty NORMAL.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 103: no archer units recruitable at difficulty NORMAL.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg", line 103: no scout units recruitable at difficulty NORMAL.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/03_Wolf_Coast.cfg", line 105: Wolf Rider is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/03_Wolf_Coast.cfg", line 105: Goblin Knight is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/03_Wolf_Coast.cfg", line 105: Goblin Pillager is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/03_Wolf_Coast.cfg", line 123: no scout units recruitable at difficulty NIGHTMARE.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/03_Wolf_Coast.cfg", line 123: no scout units recruitable at difficulty NIGHTMARE.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/03_Wolf_Coast.cfg", line 100: Wolf Rider is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/03_Wolf_Coast.cfg", line 100: Goblin Knight is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/03_Wolf_Coast.cfg", line 100: Goblin Pillager is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/03_Wolf_Coast.cfg", line 123: no scout units recruitable at difficulty HARD.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/03_Wolf_Coast.cfg", line 123: no scout units recruitable at difficulty HARD.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/03_Wolf_Coast.cfg", line 90: Wolf Rider is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/03_Wolf_Coast.cfg", line 90: Goblin Knight is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/03_Wolf_Coast.cfg", line 123: no scout units recruitable at difficulty EASY.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/03_Wolf_Coast.cfg", line 123: no scout units recruitable at difficulty EASY.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/03_Wolf_Coast.cfg", line 95: Wolf Rider is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/03_Wolf_Coast.cfg", line 95: Goblin Knight is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/03_Wolf_Coast.cfg", line 95: Goblin Pillager is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/03_Wolf_Coast.cfg", line 123: no scout units recruitable at difficulty NORMAL.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/03_Wolf_Coast.cfg", line 123: no scout units recruitable at difficulty NORMAL.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 134: Saurian Skirmisher is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 134: Saurian Augur is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 134: Saurian Ambusher is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 134: Saurian Oracle is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 129: Saurian Skirmisher is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 129: Saurian Augur is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 129: Saurian Ambusher is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 129: Saurian Oracle is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 119: Saurian Skirmisher is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 119: Saurian Augur is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 124: Saurian Skirmisher is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 124: Saurian Augur is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 124: Saurian Ambusher is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 124: Saurian Oracle is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 190: Saurian Skirmisher is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 190: Saurian Augur is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 190: Saurian Ambusher is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 190: Saurian Oracle is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 185: Saurian Skirmisher is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 185: Saurian Augur is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 185: Saurian Ambusher is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 185: Saurian Oracle is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 175: Saurian Skirmisher is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 175: Saurian Augur is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 180: Saurian Skirmisher is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 180: Saurian Augur is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 180: Saurian Ambusher is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 180: Saurian Oracle is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 239: Saurian Skirmisher is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 239: Saurian Augur is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 239: Saurian Ambusher is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 239: Saurian Oracle is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 234: Saurian Skirmisher is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 234: Saurian Augur is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 234: Saurian Ambusher is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 234: Saurian Oracle is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 224: Saurian Skirmisher is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 224: Saurian Augur is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 229: Saurian Skirmisher is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 229: Saurian Augur is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 229: Saurian Ambusher is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/04_Slavers.cfg", line 229: Saurian Oracle is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/05_Tirigaz.cfg", line 113: Wolf Rider is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/05_Tirigaz.cfg", line 113: Goblin Knight is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/05_Tirigaz.cfg", line 113: Goblin Pillager is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/05_Tirigaz.cfg", line 113: Orcish Archer is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/05_Tirigaz.cfg", line 113: Orcish Grunt is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/05_Tirigaz.cfg", line 113: Orcish Crossbowman is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/05_Tirigaz.cfg", line 113: Orcish Assassin is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/05_Tirigaz.cfg", line 113: Orcish Warrior is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/05_Tirigaz.cfg", line 113: Orcish Slurbow is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/05_Tirigaz.cfg", line 113: Orcish Warlord is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/05_Tirigaz.cfg", line 113: Orcish Slayer is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/06_Uncharted_Islands.cfg", line 61: Vampire Bat is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/06_Uncharted_Islands.cfg", line 61: Blood Bat is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/06_Uncharted_Islands.cfg", line 61: Cuttle Fish is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/06_Uncharted_Islands.cfg", line 61: Water Serpent is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/06_Uncharted_Islands.cfg", line 61: Tentacle of the Deep is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/07_Bilheld.cfg", line 62: Drake Burner is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/07_Bilheld.cfg", line 62: Drake Clasher is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/07_Bilheld.cfg", line 62: Drake Fighter is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/07_Bilheld.cfg", line 62: Drake Glider is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/07_Bilheld.cfg", line 62: Drake Flare is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/07_Bilheld.cfg", line 62: Drake Thrasher is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/07_Bilheld.cfg", line 62: Drake Warrior is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/07_Bilheld.cfg", line 62: Drake Arbiter is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/07_Bilheld.cfg", line 62: Fire Drake is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/07_Bilheld.cfg", line 62: Sky Drake is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/07_Bilheld.cfg", line 62: Drake Enforcer is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/07_Bilheld.cfg", line 62: Inferno Drake is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/07_Bilheld.cfg", line 59: Drake Burner is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/07_Bilheld.cfg", line 59: Drake Clasher is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/07_Bilheld.cfg", line 59: Drake Fighter is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/07_Bilheld.cfg", line 59: Drake Glider is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/07_Bilheld.cfg", line 59: Drake Flare is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/07_Bilheld.cfg", line 59: Drake Thrasher is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/07_Bilheld.cfg", line 59: Drake Warrior is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/07_Bilheld.cfg", line 59: Drake Arbiter is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/07_Bilheld.cfg", line 59: Fire Drake is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/07_Bilheld.cfg", line 59: Sky Drake is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/10_The_Flaming_Sword.cfg", line 61: Blood Bat is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/10_The_Flaming_Sword.cfg", line 61: Ghost is not a known unit type
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/scenarios/10_The_Flaming_Sword.cfg", line 64: no scout units recruitable.
"/home/linux/wesnoth-git-dev/code/data/campaigns/Dead_Water/units/Citizen.cfg", line 15: Merman Citizen has unknown advancements ['Merman Fighter', 'Merman Hunter']
As you can see, excluding the core directory completely screws how wmllint works, so if someone really wants to run it without the core directory, then he'd better prepare to be drowned in error messages. :augh:
vultraz wrote:Only funny behavior is if you have this toggled on w/o a dir set so it basically does nothing, but I don't think a special case is needed for that, since the user should realize what's going on.
As two of the many Murphy's Laws state:
It is impossible to make anything foolproof because fools are so ingenious.
Nothing is foolproof to a sufficiently capable fool.
In this case, however, we have something that isn't even foolproof: the funny behaviour consist in the GUI tossing out a misleading warning message and then wmllint exiting immediatly because it doesn't have anything to run on Image. A better behaviour will be showing an error message stating something like that: "wmllint cannot run because no directory is selected. Please disable the "Skip core directory" option or choose a directory", and then not running wmllint at all.
As it is currently, it seems to me like this modification will do more harm than good, so unless there is a good reason to keep it, it should be reverted.
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
User avatar
vultraz
Developer
Posts: 960
Joined: February 7th, 2011, 12:51 pm
Location: Dodging Daleks

Re: A GUI for wmllint

Post by vultraz »

The reason I added it was primarily for UMC users who want to run it without waiting for the 10 - 15 second delay it takes for it to parse core. Plus, core is NOT wmllint clean, resulting in annoying changes every time you run it. >_> I know, it should be, but there are some things that have to be updated in the script itself as well. IMO, the errors are worth it, especially for UMC authors who want to check for actual errors in their addons and understand those are irrelevant.

In hindsight changing the warning message is probably a good idea.
Creator of Shadows of Deception (for 1.12) and co-creator of the Era of Chaos (for 1.12/1.13).
SurvivalXtreme rocks!!!
What happens when you get scared half to death...twice?
User avatar
Elvish_Hunter
Posts: 1575
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: A GUI for wmllint

Post by Elvish_Hunter »

vultraz wrote:The reason I added it was primarily for UMC users who want to run it without waiting for the 10 - 15 second delay it takes for it to parse core. Plus, core is NOT wmllint clean, resulting in annoying changes every time you run it.
IDEA! :D We can attach a callback function to the Skip core directory checkbutton, so when someone wants to use it, the Disable checks for unknown units checkbutton will be automatically checked and disabled (greyed out); on unchecking Skip core directory, the Disable checks for unknown units will be unchecked and will become active again. So, we'll keep the option AND avoid the nasty error messages. What do you think of it?
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
User avatar
vultraz
Developer
Posts: 960
Joined: February 7th, 2011, 12:51 pm
Location: Dodging Daleks

Re: A GUI for wmllint

Post by vultraz »

Ah, brilliant! :D That way we'll have the best of both worlds. You'll have to implement it, though, since I have no idea how. I just added the Skip option by copying code you had already written :P
Creator of Shadows of Deception (for 1.12) and co-creator of the Era of Chaos (for 1.12/1.13).
SurvivalXtreme rocks!!!
What happens when you get scared half to death...twice?
User avatar
Elvish_Hunter
Posts: 1575
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: A GUI for wmllint

Post by Elvish_Hunter »

vultraz wrote:You'll have to implement it, though, since I have no idea how.
Done! I pushed to master three modifications:
  • When Skip core directory is enabled, Disable checks for unknown units is automatically checked on and disabled, so it cannot be deactivated (04f267e36b31)
  • Added a better error message when Skip core directory is selected and no add-on is selected (2625c02f4d65)
  • Added a Clear button, so if someone wants to run a tool only on core, it won't be mandatory to restart the GUI (b39efb97f9b5, then c65c9759d66a)
Here there is a screenshot showing all these changes at one:
Changes.png
If we don't have anything else planned, all these changes can be backported to the 1.12 branch, so they'll be available for the 1.12.2 release.
Last edited by Elvish_Hunter on January 20th, 2015, 10:53 am, edited 2 times in total.
Reason: Added a screenshot
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
User avatar
vultraz
Developer
Posts: 960
Joined: February 7th, 2011, 12:51 pm
Location: Dodging Daleks

Re: A GUI for wmllint

Post by vultraz »

Unfortunately I seem to have found another issue :/

When running wmlindent with 'Also report unchanged files' (I fixed the wording of that option in 340e02ed9b2a), I get an exit with error code 1 popup, and this in the output:

Code: Select all

Traceback (most recent call last):

  File "C:\Users\Charles\Documents\wesnoth-git\data\tools\wmlindent", line 287, in <module>

    ['help', 'dryrun', 'exclude=', 'quiet', 'verbose'])

  File "C:\Python27\lib\getopt.py", line 90, in getopt

    opts, args = do_shorts(opts, args[0][1:], shortopts, args[1:])

  File "C:\Python27\lib\getopt.py", line 190, in do_shorts

    if short_has_arg(opt, shortopts):

  File "C:\Python27\lib\getopt.py", line 206, in short_has_arg

    raise GetoptError('option -%s not recognized' % opt, opt)

getopt.GetoptError: option -  not recognized
I checked, and the option is indeed passed as '-v -v', so I don't know what's wrong. Perhaps it's a wmlindent problem?
Creator of Shadows of Deception (for 1.12) and co-creator of the Era of Chaos (for 1.12/1.13).
SurvivalXtreme rocks!!!
What happens when you get scared half to death...twice?
User avatar
Elvish_Hunter
Posts: 1575
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: A GUI for wmllint

Post by Elvish_Hunter »

vultraz wrote:I checked, and the option is indeed passed as '-v -v', so I don't know what's wrong. Perhaps it's a wmlindent problem?
Good catch! :doh: The point is that "-v -v" is passed as a string, while on Linux it must be passed as two elements of a list.
I don't have time to push the fix right now (it needs a bit more testing), but I'll do it as soon as possible. :)
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
User avatar
vultraz
Developer
Posts: 960
Joined: February 7th, 2011, 12:51 pm
Location: Dodging Daleks

Re: A GUI for wmllint

Post by vultraz »

Except I'm on Windows 8.1, and not Linux. I dunno if that changes anything, since it seems you got more out of my comment than I knew I put into it :P But at least we know generally what the problem is.
Creator of Shadows of Deception (for 1.12) and co-creator of the Era of Chaos (for 1.12/1.13).
SurvivalXtreme rocks!!!
What happens when you get scared half to death...twice?
User avatar
vultraz
Developer
Posts: 960
Joined: February 7th, 2011, 12:51 pm
Location: Dodging Daleks

Re: A GUI for wmllint

Post by vultraz »

Also, I just backported all our recent changes related to Skip Core to 1.12, so they'll ship out with 1.12.1.
Creator of Shadows of Deception (for 1.12) and co-creator of the Era of Chaos (for 1.12/1.13).
SurvivalXtreme rocks!!!
What happens when you get scared half to death...twice?
Post Reply