From 4e24bff045ca1c1c198662e6d1ce7ba9065e856a Mon Sep 17 00:00:00 2001 From: Max Goodman Date: Mon, 29 Oct 2012 19:20:54 -0700 Subject: [PATCH] Add js.py/strings.py as deps to JS modules. If either python file changes, we may need to change the compiled JS files. We'll take the conservative approach and always rebuild. --- r2/Makefile | 2 +- r2/r2/lib/js.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/r2/Makefile b/r2/Makefile index 0c8b1be07..cf58c14c9 100644 --- a/r2/Makefile +++ b/r2/Makefile @@ -189,7 +189,7 @@ clean_css: js: $(STATIC_BUILDSTAMP) $(JS_OUTPUTS) define JS_MODULE_TEMPLATE -$(JS_MODULE_OUTPUTS_$(1)): $(JS_MODULE_DEPS_$(1)) +$(JS_MODULE_OUTPUTS_$(1)): $(JS_MODULE_DEPS_$(1)) r2/lib/js.py # remove mangled output symlinks, similar to above. rm -f $(JS_MODULE_OUTPUTS_$(1)) paster run standalone r2/lib/js.py -c "build_module('$(1)')" diff --git a/r2/r2/lib/js.py b/r2/r2/lib/js.py index 24f328cd6..2f5653109 100755 --- a/r2/r2/lib/js.py +++ b/r2/r2/lib/js.py @@ -36,6 +36,7 @@ try: except ImportError: STATIC_ROOT = None else: + REDDIT_ROOT = config["pylons.paths"]["root"] STATIC_ROOT = config["pylons.paths"]["static_files"] # STATIC_ROOT will be None if pylons is uninitialized @@ -285,6 +286,11 @@ class LocalizedModule(Module): url = LocalizedModule.languagize_path(self.name, langs[0]) return script_tag.format(src=static(url)) + @property + def dependencies(self): + return (super(LocalizedModule, self).dependencies + + [os.path.join(REDDIT_ROOT, "lib/strings.py")]) + @property def outputs(self): for lang, unused in iter_langs():