Commit graph

2320 commits

Author SHA1 Message Date
Groggy Dice
6adc90bcf3 wmltools: fix wmlscope crash in collection of unresolved macro calls
While testing wmlscope without including data/core, which guarantees lots
of "unresolved" references, I got a crash pointing to this line with the
traceback: "NameError: global name 'args' is not defined".

At first, I thought the crash might have been caused by my splitting out
parse_macroref into its own function, several months ago. However, the
line is at the wrong indentation level for those "args" to be the variable
referenced here. So what "args" might have been intended?

After tracking down the commit that added "args=args" to this line, I've
concluded that this was simply a mistake. ESR isn't around to ask anymore,
but if a macro was never defined, or is not called correctly, what "args"
could be relevant?
2014-08-01 06:14:18 -04:00
Groggy Dice
2d864b5eff wmltools: cite define locations when "more than one definition" is visible
When "more than one resource" is visible, wmlscope tells you where they
are.  Now it will do the same for macro definitions.
2014-08-01 06:14:09 -04:00
Groggy Dice
3d11b84611 wmlscope: import glob for Windows shell
The Windows cmd shell will not expand a globbed argument by default, in
fact it will make the argument invalid. Importing and utilizing the glob
module is needed for x-platform.

Globbing is especially important for breaking up the subtree, so wmlscope
doesn't give off "more than one resource/definition is visible here"
errors.
2014-08-01 06:14:00 -04:00
Groggy Dice
f55ab17ea7 wmllint: split introduction into labeled sections for clarity
Also, the top paragraphs, aimed at the core developers, have been moved to
the bottom, to get to the information key to general users.
2014-08-01 06:13:41 -04:00
Groggy Dice
6a1b039b3c wmllint: remove -p --progress option
This option is pretty similar in effect to -v -v. Particularly now that
some new switches have been added recently, the clutter makes it no
longer worth keeping around.

A comment notes the option's disappearance, in case anyone wonders what
happened to it or how to get the same functionality.
2014-07-29 05:53:31 -04:00
Groggy Dice
edf9d2768d wmllint: remove -f --future option
Going back through wmllint's history, it turns out that there apparently
haven't been any "experimental conversions" since 1.4. Especially since
some new switches have been added recently, the clutter makes it no longer
worth keeping around.

A comment notes the option's disappearance, in case anyone is interested
in recreating experimental conversions again.
2014-07-29 05:51:40 -04:00
Ignacio R. Morelle
991b68a128 wam/html: Add add-on type labels for campaign_sp_mp and mod_mp 2014-06-26 19:17:54 -04:00
Elvish_Hunter
9fd8ba5ef9 wmllint GUI: now the focus follows the mouse pointer, allowing use of the mouse wheel on the disabled Text widget 2014-06-25 14:54:56 +02:00
Elvish_Hunter
0ac30c7d0e Replaced the old description for wmllint_gui with the new one for GUI.pyw 2014-06-25 14:54:56 +02:00
Elvish_Hunter
ebb4a80f46 wmllint GUI: fixed a bug on Python 2.7.7 that froze the application on Windows 2014-06-25 14:54:56 +02:00
Alexander van Gessel
07a6ba695e Merge pull request #199 from aquileia/ignore
Restructure and merge .gitignore files
2014-06-13 16:27:01 +02:00
Ignacio R. Morelle
d0d95f2f9f wam: Use a tuple for the --change-passphrase argument's metavar
Fixes its help entry looking like this:

>  --change-passphrase ADD-ON OLD NEW ADD-ON OLD NEW ADD-ON OLD NEW
>                        Change the passphrase for ADD-ON from OLD to NEW

When it really should look like this:

>  --change-passphrase ADD-ON OLD NEW
>                        Change the passphrase for ADD-ON from OLD to NEW
2014-06-12 00:27:20 -04:00
Groggy Dice
61c8c93698 wmllint: reorganize help into mode options and other options
The organization of Elvish Hunter's wmllint GUI tab suggested this change.
2014-06-10 06:10:16 -04:00
Groggy Dice
5b06aa9205 wmllint: fix substitution that was missing a slash 2014-06-10 06:10:11 -04:00
Groggy Dice
8e7581f593 wmlscope: fix mistakes in help and options pointed out by Elvish Hunter
See EH's forum post:

http://forums.wesnoth.org/viewtopic.php?f=10&t=40397#p570438
2014-06-10 06:09:58 -04:00
aquileia
c19e729c6b gitignore: Merge rules from doc/ and data/tools 2014-06-09 01:00:50 +02:00
Elvish_Hunter
e3fc8f13b8 wmllint gui: made some options in the wmlscope tab evenly spaced 2014-05-29 14:57:10 +02:00
Elvish_Hunter
5480cca466 wmllint gui: fixed a bug in regexp handling 2014-05-29 14:57:09 +02:00
Alexander van Gessel
a4e30b6275 Fix a wmllint crash 2014-05-28 17:54:49 +02:00
Chris Beck
12fad6efbc fixup wmllint to include 1.11.15 changes 2014-05-24 19:11:48 -04:00
Elvish_Hunter
2dbca0c3f1 wmllint GUI: avoid showing a blank Tk window if the program is run outside of a Wesnoth directory 2014-05-21 10:43:54 +02:00
Elvish_Hunter
385384de86 wmllint GUI: verbosity level radiobutton, Normal -> Terse 2014-05-21 10:43:54 +02:00
Elvish_Hunter
ef81cbad61 wmllint GUI: moved the exit button to the right side of the window 2014-05-21 10:43:54 +02:00
Elvish_Hunter
82e1126094 wmllint GUI: removed verbs from option labelframe labels 2014-05-21 10:43:53 +02:00
Elvish_Hunter
241015fa05 wmllint GUI: made two labelframe labels shorter 2014-05-21 10:43:53 +02:00
Elvish_Hunter
f3012b50db wmllint GUI: used a smaller icon for the Browse button, and made the entry fill the whole frame 2014-05-21 10:43:52 +02:00
Groggy Dice
93353ee0a6 wmllint: add option to turn off missing side= key warning 2014-05-16 01:40:28 -04:00
Groggy Dice
d866189a0e wmllint: warn about no side key in [*_shroud],[gold],[modify_side/ai]
Those who are updating from old UMC may otherwise be caught unawares by the
change from defaulting to side 1 when the side key is missing, to all
sides. Later we will have an option to turn off this warning.

Since the insertion of an attribute line is now commented out, it may be
questioned whether this still belongs in hack_syntax. However, at some
point the plan is to give users an option to insert the side= key.
2014-05-16 01:40:25 -04:00
Groggy Dice
1a794a2d1e wmllint: warn about no side key in [set/(dis)allow_recruit],[store_gold]
Those who are updating from old UMC may otherwise be caught unawares by the
change from defaulting to side 1 when the side key is missing, to all
sides. Later we will have an option to turn off this warning.
2014-05-16 01:40:23 -04:00
Groggy Dice
e3adf001a8 html.py: hone regexes for URL linking
First, a couple of extraneous quotes were left in the second regex around
"</a>".

Second, it is possible that a period or question mark could be used to end
a sentence, rather than be part of the URL. So check that these characters
are followed by an alphanumeric character to make them part of the URL.
2014-05-16 01:40:20 -04:00
Groggy Dice
ec3c65d4c1 wmllint: put off dryrun's verbosity check until after options are processed
Per discussion with Elvish Hunter on the forum. Having dryrun check for a
minimum verbosity level during the options for loop meant that -vd would
set the verbosity level to 1, while -dv would set it to 2.
2014-05-15 03:53:07 -04:00
Groggy Dice
cc059b64f6 style.css: no margin-bottom for <pre> 2014-05-15 03:53:04 -04:00
Groggy Dice
7fb303c57d html.py,style.css: use <pre> with no top-margin on all descriptions
After my last change dealing with this issue, I noticed that descriptions
with <pre> had an extra blank line at the top. Adding top-margin to the
CSS file made this go away, but it also made the <br/> superfluous. Thus,
it is simpler just to have every description use <pre> instead of <br/>.

This should finally resolve everything having to do with the add-on
descriptions.

If I'd noticed that the re module hadn't been imported, I probably wouldn't
have considered URL linking to be important enough to do so. Since I've
already written the code, however, I'll keep it.
2014-05-07 06:09:57 -04:00
Elvish_Hunter
82e5cc8d39 Committed the new Tk-based GUI for wmllint/scope/indent 2014-05-05 17:52:45 +02:00
Elvish_Hunter
7eac0da7f8 Removed the old Wx-based wmllint GUI 2014-05-05 17:51:45 +02:00
Groggy Dice
7ba550a63e html.py: replace Windows backslashes in icon paths
This is one source of missing-image results.

There remain other reasons for missing icons. The script doesn't find images
in add-ons. And when resources are moved or renamed, they are no longer found
by the script, even if they had been found before.

Also, capitalize a sentence.
2014-05-05 04:21:40 -04:00
Groggy Dice
faf82bed92 style.css,html.py: use <pre> instead of <br/>; re.sub instead of re.finditer
After looking into it some more, I think I've figured out how to handle <pre>
in the CSS. So, use that, when description has more than one line.

Also, go to re.sub for turning URLs into links. The version of Python I was
testing my code on wasn't properly handling backreferences in the replacement
string when in the form "\#", causing me to use finditer instead of sub. But
I've discovered that it does handle backreferences in the form "\g<#>". So
switch to much simpler re.sub code.
2014-05-05 04:20:51 -04:00
Groggy Dice
2a8d4e2d28 html.py: import re module
Bugfix for last commit.
2014-04-25 02:45:26 -04:00
Groggy Dice
c85af755ac html.py: format add-on description for HTML
The description text does not get rendered very well on a webpage. One
solution might be to use pre-wrap/word-wrap in the CSS, but due to
differences between browsers, that's a can of worms (at least for me, I'm
not a web pro).

So, the not-so-elegant solution is to add <br/> to every line.

URLs are also not linked in the plain text. Although in modern browsers
you can select the text and right-click, it's still convenient to turn
them into actual links.
2014-04-25 01:26:11 -04:00
Groggy Dice
b058f29d1e wmllint: change "usage of" magic comment to re.search
There seems no particular reason to require that this magic comment be at
the very beginning of the line, so why not switch from re.match to
re.search.

Also, update comments to reflect the fact that UtBS no longer uses this
magic comment.

A suggestion has been made to get rid of this magic comment now that UtBS
is no longer using it, but it may still be in use in some UMC somewhere.
2014-04-25 00:56:25 -04:00
Elvish_Hunter
9e140c183c added wmllint rule for FLAG_VARIANT6 2014-04-19 10:57:47 +02:00
aquileia
f3bfa19b4a add GUI tag list for Vim syntax highlighting 2014-03-14 23:19:35 +01:00
Ignacio R. Morelle
780cced9c2 terrain2wiki: wesnoth-old.git -> wesnoth.git 2014-03-02 19:17:30 -03:00
Alexander van Gessel
a6630a3a08 Revert "[wmlunits] Disable crashing chunk_start stuff someone added."
This reverts commit 8aa0febfde.
As spaces in filenames are now illegal, this is no longer a problem.
2014-02-24 02:45:42 +01:00
Ignacio R. Morelle
5e7b4ece1d campaignd: Serve 1.12 clients on port 15007 2014-02-21 21:59:14 -03:00
Ignacio R. Morelle
80172ee58f wam: Make our _info.cfg's look identical to the C++ client's
To achieve this, add the same leading comment section ("do no edit this
file", etc.) and use the same indentation format as the C++ engine, and
don't use quotes around the uploads attribute value (it's an integer).
2014-02-20 23:44:33 -03:00
Ignacio R. Morelle
baa566161b wam: Write title and type fields to _info.cfg like the C++ client does 2014-02-20 23:40:54 -03:00
Ignacio R. Morelle
dc15ae8d31 wesnoth_addon_manager: Add missing trailing newline to _info.cfg 2014-02-20 23:25:58 -03:00
Ignacio R. Morelle
46b278579b wesnoth_addon_manager: Make the portmap tuple more easily diffable 2014-02-20 22:36:50 -03:00
Ignacio R. Morelle
181c64d70d wmllint: Extend [terrain_type] aliasof conversion to def_alias 2014-02-20 04:46:33 -03:00