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)
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)
#!/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)
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:
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: