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

Side by Side Diff: components/webui_generator/generator/util.py

Issue 1181703008: Removed webui_generator and new OOBE UI placeholder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed empty line. Created 5 years, 6 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
OLDNEW
(Empty)
1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import argparse
6 import os.path
7 import re
8
9 def CreateArgumentParser():
10 parser = argparse.ArgumentParser()
11 parser.add_argument('declaration', help='Path to declaration file.')
12 parser.add_argument('--root', default='.', help='Path to src/ dir.')
13 parser.add_argument('--destination',
14 help='Root directory for generated files.')
15 return parser
16
17 def ToUpperCamelCase(underscore_name):
18 return re.sub(r'(?:_|^)(.)', lambda m: m.group(1).upper(), underscore_name)
19
20 def ToLowerCamelCase(underscore_name):
21 return re.sub(r'_(.)', lambda m: m.group(1).upper(), underscore_name)
22
23 def PathToIncludeGuard(path):
24 return re.sub(r'[/.]', '_', path.upper()) + '_'
25
26 def CreateDirIfNotExists(path):
27 if not os.path.isdir(path):
28 if os.path.exists(path):
29 raise Exception('%s exists and is not a directory.' % path)
30 os.makedirs(path)
OLDNEW
« no previous file with comments | « components/webui_generator/generator/html_view.py ('k') | components/webui_generator/generator/view_model.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698