Skip to content

Commit

Permalink
wmlscope: import glob for Windows shell
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
groggyd88 committed Aug 1, 2014
1 parent 1ebadbf commit ea380c2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions data/tools/wmlscope
Expand Up @@ -92,7 +92,7 @@
#
# sets the warning level.

import sys, os, time, re, getopt, hashlib
import sys, os, time, re, getopt, hashlib, glob
from wesnoth.wmltools import *

def interpret(lines, css):
Expand Down Expand Up @@ -433,7 +433,11 @@ Usage: wmlscope [options] dirpath

forceused = "|".join(forceused)
if len(arguments):
dirpath = arguments
dirpath = []
for arg in arguments:
globarg = glob.glob(arg)
for globbed in globarg:
dirpath.append(globbed)
else:
dirpath = ['.']
if not extracthelp:
Expand Down

0 comments on commit ea380c2

Please sign in to comment.