Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: packagerChrome.py

Issue 29399582: Issue 5078 - Allow convert_js to work on already processed files (Closed)
Patch Set: Created March 31, 2017, 6:37 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packagerChrome.py
diff --git a/packagerChrome.py b/packagerChrome.py
index bd103da5125b00d76bc740447fcfa8ca84d674f3..983f6115c49bc0047d3107f2f2ade59583c90f76 100644
--- a/packagerChrome.py
+++ b/packagerChrome.py
@@ -183,9 +183,11 @@ def convertJS(params, files):
prefix = os.path.basename(os.path.dirname(input_filename))
if prefix != 'lib':
module_name = '{}_{}'.format(prefix, module_name)
- with open(os.path.join(base_dir, input_filename), 'r') as file:
- modules.append((module_name, file.read().decode('utf-8')))
- files.pop(input_filename, None)
+ if input_filename in files:
+ modules.append((module_name, files.pop(input_filename)))
+ else:
+ with open(os.path.join(base_dir, input_filename), 'r') as file:
+ modules.append((module_name, file.read().decode('utf-8')))
files[filename] = template.render(
args=current_args,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld