Merge pull request #696 from marpaia/fix-695

ignore ds_store on table generation
This commit is contained in:
Mike Arpaia 2015-02-02 14:43:42 -08:00
commit 0cc4e0a287

View File

@ -4,7 +4,7 @@
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from __future__ import absolute_import
@ -269,18 +269,19 @@ def main(argc, argv):
filename = argv[1]
output = argv[2]
# Adding a 3rd parameter will enable the blacklist
disable_blacklist = argc > 3
if filename.endswith(".table"):
# Adding a 3rd parameter will enable the blacklist
disable_blacklist = argc > 3
setup_templates(filename)
with open(filename, "rU") as file_handle:
tree = ast.parse(file_handle.read())
exec(compile(tree, "<string>", "exec"))
blacklisted = is_blacklisted(table.table_name, path=filename)
if not disable_blacklist and blacklisted:
table.blacklist(output)
else:
table.generate(output)
setup_templates(filename)
with open(filename, "rU") as file_handle:
tree = ast.parse(file_handle.read())
exec(compile(tree, "<string>", "exec"))
blacklisted = is_blacklisted(table.table_name, path=filename)
if not disable_blacklist and blacklisted:
table.blacklist(output)
else:
table.generate(output)
if __name__ == "__main__":
main(len(sys.argv), sys.argv)