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

Side by Side Diff: third_party/google_api_python_client/expandsymlinks.py

Issue 963953003: OAuth2 support in depot_tools (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: restore git_cl Created 5 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 #!/usr/bin/python2.4
2 # -*- coding: utf-8 -*-
3 #
4 # Copyright 2014 Google Inc. All Rights Reserved.
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 # http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17
18 """Copy files from source to dest expanding symlinks along the way.
19 """
20
21 from shutil import copytree
22
23 import argparse
24 import sys
25
26
27 # Ignore these files and directories when copying over files into the snapshot.
28 IGNORE = set(['.hg', 'httplib2', 'oauth2', 'simplejson', 'static'])
29
30 # In addition to the above files also ignore these files and directories when
31 # copying over samples into the snapshot.
32 IGNORE_IN_SAMPLES = set(['googleapiclient', 'oauth2client', 'uritemplate'])
33
34 parser = argparse.ArgumentParser(description=__doc__)
35
36 parser.add_argument('--source', default='.',
37 help='Directory name to copy from.')
38
39 parser.add_argument('--dest', default='snapshot',
40 help='Directory name to copy to.')
41
42
43 def _ignore(path, names):
44 retval = set()
45 if path != '.':
46 retval = retval.union(IGNORE_IN_SAMPLES.intersection(names))
47 retval = retval.union(IGNORE.intersection(names))
48 return retval
49
50
51 def main():
52 copytree(FLAGS.source, FLAGS.dest, symlinks=True,
53 ignore=_ignore)
54
55
56 if __name__ == '__main__':
57 FLAGS = parser.parse_args(sys.argv[1:])
58 main()
OLDNEW
« no previous file with comments | « third_party/google_api_python_client/describe.py ('k') | third_party/google_api_python_client/googleapiclient/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698