Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #3253 Cookbook generation failure missing file indicator #3255

Merged
merged 1 commit into from
Jun 13, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 9 additions & 4 deletions examples/meta/generator/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,15 @@ def translateExamples(inputDir, outputDir, targetsDir, ctagsFile,
# Ignore targets not in includedTargets
if includedTargets and not os.path.basename(target).split(".")[0] in includedTargets:
continue

with open(os.path.join(targetsDir, target)) as tFile:
targets.append(json.load(tFile))


translate_file = os.path.join(targetsDir, target)

with open(translate_file) as tFile:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this both Python 2 and 3 compatible?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karlnapf yes

try:
targets.append(json.load(tFile))
except Exception, err:
print("Error translating file: %s\n%s" % (translate_file, err))

# Translate each example
for dirRelative, filename in subfilesRelative(inputDir, filter_by=lambda x: x.lower().endswith('.sg')):
print("Translating {}".format(os.sep.join([dirRelative,filename])))
Expand Down