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?
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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).