From 7f56eeaf5828f77aafd4c51763c3be5a9426a013 Mon Sep 17 00:00:00 2001 From: Andrew Seier Date: Mon, 27 Oct 2014 11:59:29 -0700 Subject: [PATCH 1/2] Allow 'url' key in general, but delete it for reprocessed scripts. --- run.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/run.py b/run.py index 95ba861746dc..bb464da89281 100644 --- a/run.py +++ b/run.py @@ -44,6 +44,7 @@ "image", # todo, remove this "exception", "private", + "url", "prepend", # todo, remove "append" # todo, remove ], @@ -732,6 +733,10 @@ def process_script_leaf(leaf, options, id_dict): code_path = save_code(code_string, leaf, language, 'documentation') leaf[language] = code_path save_code(exec_string, leaf, language, 'execution') + + # if this is being re-processed we need to make sure the url is cleared. + leaf.pop('url', None) + id_dict['complete'].add(leaf['id']) From cbf42dac233911a1882613f09097cef44e615d42 Mon Sep 17 00:00:00 2001 From: Andrew Seier Date: Mon, 27 Oct 2014 12:15:56 -0700 Subject: [PATCH 2/2] Because of nested merge, removing 'url' must be done last. --- run.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/run.py b/run.py index bb464da89281..23bc7f5e0c8a 100644 --- a/run.py +++ b/run.py @@ -733,10 +733,6 @@ def process_script_leaf(leaf, options, id_dict): code_path = save_code(code_string, leaf, language, 'documentation') leaf[language] = code_path save_code(exec_string, leaf, language, 'execution') - - # if this is being re-processed we need to make sure the url is cleared. - leaf.pop('url', None) - id_dict['complete'].add(leaf['id']) @@ -961,6 +957,8 @@ def reset_reprocessed_leaves(section, processed_ids): if section: if section['is_leaf']: if section['id'] in processed_ids: + if section['type'] == 'script': + section.pop('url', None) keys = section.keys() for key in keys: if key not in tree_keys['leaf'] and key not in languages: