Chromium Code Reviews| 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..293a7b4735a5d1637892f944bd79c315b469995e |
| --- /dev/null |
| +++ b/chrome/common/extensions/docs/server2/build_server.py |
| @@ -0,0 +1,33 @@ |
| +#!/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. |
| + |
|
not at google - send to devlin
2012/06/04 04:37:08
I was totally confused here. Please add a comment
Aaron Boodman
2012/06/04 06:29:09
The two scripts do different things:
- build_serv
cduvall
2012/06/04 21:53:25
I added a comment for clarity.
|
| +import os |
| +import shutil |
| +import sys |
| + |
| +THIRD_PARTY_DIR = os.path.join(sys.path[0], os.pardir, os.pardir, os.pardir, |
| + os.pardir, os.pardir, 'third_party') |
| +LOCAL_THIRD_PARTY_DIR = os.path.join(sys.path[0], 'third_party') |
| + |
| +def main(): |
| + if not os.path.isdir(THIRD_PARTY_DIR): |
| + print 'third_party directory not found. You may be in the wrong directory.' |
| + exit(-1) |
| + |
| + shutil.rmtree(LOCAL_THIRD_PARTY_DIR, True) |
| + shutil.copytree(os.path.join(THIRD_PARTY_DIR, 'handlebar'), |
| + os.path.join(LOCAL_THIRD_PARTY_DIR, 'handlebar')) |
| + |
| + with open(os.path.join(LOCAL_THIRD_PARTY_DIR, '__init__.py'), 'w') as f: |
| + os.utime(os.path.join(LOCAL_THIRD_PARTY_DIR, '__init__.py'), None) |
| + |
| + shutil.copy(os.path.join(LOCAL_THIRD_PARTY_DIR, '__init__.py'), |
| + os.path.join(LOCAL_THIRD_PARTY_DIR, 'handlebar')) |
| + with open( |
| + os.path.join(LOCAL_THIRD_PARTY_DIR, 'handlebar/__init__.py'), 'a') as f: |
| + f.write('\nfrom handlebar import Handlebar\n') |
| + |
| +if __name__ == '__main__': |
| + main() |