Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2637)

Unified Diff: chrome/common/extensions/docs/server2/build_server.py

Issue 10500004: Die build.py, Die: Part 2 (LocalFetcher, Handlebar support, build script) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/server2/build_server.py
diff --git a/chrome/common/extensions/docs/server2/build_server.py b/chrome/common/extensions/docs/server2/build_server.py
new file mode 100755
index 0000000000000000000000000000000000000000..315975bdcd4069a7a7a5d644da79e96cb8a55852
--- /dev/null
+++ b/chrome/common/extensions/docs/server2/build_server.py
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import shutil
+import sys
+
+THIRD_PARTY_DIR = sys.path[0] + '/../../../../../third_party/'
Aaron Boodman 2012/06/02 07:50:22 Not sure if this will work on Windows. Use os.join
cduvall 2012/06/02 19:12:05 Done.
+LOCAL_THIRD_PARTY_DIR = sys.path[0] + '/third_party/'
Aaron Boodman 2012/06/02 07:50:22 For added safety, do a sanity check that third_par
cduvall 2012/06/02 19:12:05 sys.path[0] allows this to work when run from any
Aaron Boodman 2012/06/03 05:43:14 Ah, my mistake. I guess the check is not necessary
+
+def main():
+ shutil.rmtree(LOCAL_THIRD_PARTY_DIR, True)
+ shutil.copytree(THIRD_PARTY_DIR + 'handlebar',
+ LOCAL_THIRD_PARTY_DIR + 'handlebar')
+ with open(LOCAL_THIRD_PARTY_DIR + '__init__.py', 'w') as f:
+ f.write('\n')
Aaron Boodman 2012/06/02 07:50:22 You can just do os.utime(path).
cduvall 2012/06/02 19:12:05 Done.
+ shutil.copy(LOCAL_THIRD_PARTY_DIR + '__init__.py',
+ LOCAL_THIRD_PARTY_DIR + 'handlebar')
+ with open(LOCAL_THIRD_PARTY_DIR + 'handlebar/__init__.py', 'a') as f:
+ f.write('\nfrom handlebar import Handlebar\n')
Aaron Boodman 2012/06/02 07:50:22 I think it would be less surprising to just import
cduvall 2012/06/02 19:12:05 This import is needed to access the class (I think
+
+if __name__ == '__main__':
+ main()

Powered by Google App Engine
This is Rietveld 408576698