示例#1
0
def main():
    """Perform the cleaning work."""
    if len(sys.argv) > 1:
        build_dir = sys.argv[1]
    else:
        build_dir = os.getcwd()

    os.chdir(build_dir)

    for f in glob.glob('*.JSON-tmLanguage'):
        xml = grammar.xml_filename(f)
        if os.path.exists(xml):
            print('Deleting ' + xml)
            os.remove(xml)
示例#2
0
def main():
    """Perform the build, if necessary."""
    if len(sys.argv) > 1:
        build_dir = sys.argv[1]
    else:
        build_dir = os.getcwd()

    os.chdir(build_dir)

    for source in glob.glob("*.JSON-tmLanguage"):
        target = grammar.xml_filename(source)
        if must_build(source, target):
            print("Building %s" % target)
            grammar.build(source)
        else:
            print("%s is up to date." % target)
示例#3
0
#!/usr/bin/env python

import grammar, os, os.path, glob, sys

if len(sys.argv) > 1:
    dir = sys.argv[1]
else:
    dir = os.getcwd()

os.chdir(dir)

for f in glob.glob('*.JSON-tmLanguage'):
    xml = grammar.xml_filename(f)
    if os.path.exists(xml):
        print 'Deleting ' + xml
        os.remove(xml)
示例#4
0
import grammar, os, os.path, glob, sys

def must_build(source, target):
	return (not os.path.exists(target)) \
		or (os.path.getmtime(source) >= os.path.getmtime(target))

if len(sys.argv) > 1:
    dir = sys.argv[1]
else:
    dir = os.getcwd()

os.chdir(dir)

for source in glob.glob('*.JSON-tmLanguage'):
	target = grammar.xml_filename(source)
	if must_build(source, target):
		print 'Building %s' % target
		grammar.build(source)
	else:
		print '%s is up to date.' % target

########NEW FILE########
__FILENAME__ = clean
#!/usr/bin/env python

import grammar, os, os.path, glob, sys

if len(sys.argv) > 1:
    dir = sys.argv[1]
else:
示例#5
0

def must_build(source, target):
    return (not os.path.exists(target)) \
     or (os.path.getmtime(source) >= os.path.getmtime(target))


if len(sys.argv) > 1:
    dir = sys.argv[1]
else:
    dir = os.getcwd()

os.chdir(dir)

for source in glob.glob('*.JSON-tmLanguage'):
    target = grammar.xml_filename(source)
    if must_build(source, target):
        print 'Building %s' % target
        grammar.build(source)
    else:
        print '%s is up to date.' % target

########NEW FILE########
__FILENAME__ = clean
#!/usr/bin/env python

import grammar, os, os.path, glob, sys

if len(sys.argv) > 1:
    dir = sys.argv[1]
else: