OLD | NEW |
---|---|
(Empty) | |
1 #!/usr/bin/env python | |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
3 # Use of this source code is governed by a BSD-style license that can be | |
4 # found in the LICENSE file. | |
5 | |
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.
| |
6 import os | |
7 import shutil | |
8 import sys | |
9 | |
10 THIRD_PARTY_DIR = os.path.join(sys.path[0], os.pardir, os.pardir, os.pardir, | |
11 os.pardir, os.pardir, 'third_party') | |
12 LOCAL_THIRD_PARTY_DIR = os.path.join(sys.path[0], 'third_party') | |
13 | |
14 def main(): | |
15 if not os.path.isdir(THIRD_PARTY_DIR): | |
16 print 'third_party directory not found. You may be in the wrong directory.' | |
17 exit(-1) | |
18 | |
19 shutil.rmtree(LOCAL_THIRD_PARTY_DIR, True) | |
20 shutil.copytree(os.path.join(THIRD_PARTY_DIR, 'handlebar'), | |
21 os.path.join(LOCAL_THIRD_PARTY_DIR, 'handlebar')) | |
22 | |
23 with open(os.path.join(LOCAL_THIRD_PARTY_DIR, '__init__.py'), 'w') as f: | |
24 os.utime(os.path.join(LOCAL_THIRD_PARTY_DIR, '__init__.py'), None) | |
25 | |
26 shutil.copy(os.path.join(LOCAL_THIRD_PARTY_DIR, '__init__.py'), | |
27 os.path.join(LOCAL_THIRD_PARTY_DIR, 'handlebar')) | |
28 with open( | |
29 os.path.join(LOCAL_THIRD_PARTY_DIR, 'handlebar/__init__.py'), 'a') as f: | |
30 f.write('\nfrom handlebar import Handlebar\n') | |
31 | |
32 if __name__ == '__main__': | |
33 main() | |
OLD | NEW |