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

Unified Diff: Source/build/scripts/make-file-arrays.py

Issue 361693004: Remove make-css-file-arrays.pl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: \s consistentcy Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/build/scripts/action_useragentstylesheets.py ('k') | Source/build/scripts/scripts.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/build/scripts/make-file-arrays.py
diff --git a/Source/build/scripts/make-file-arrays.py b/Source/build/scripts/make-file-arrays.py
index f496d01e6f66e6255de1f178129ff988f4fb433f..2210ff5f919f67276f5e13318552fe3c4473be6f 100755
--- a/Source/build/scripts/make-file-arrays.py
+++ b/Source/build/scripts/make-file-arrays.py
@@ -45,7 +45,10 @@ import rjsmin
def make_variable_name_and_read(file_name):
- result = re.match(r'([\w\d_]+)\.([\w\d_]+)', os.path.basename(file_name))
+ base_name = os.path.basename(file_name)
+ # view-source.css -> viewSource.css
+ base_name = re.sub(r'-[a-zA-Z]', lambda match: match.group(0)[1:].upper(), base_name)
+ result = re.match(r'([\w\d_]+)\.([\w\d_]+)', base_name)
if not result:
print 'Invalid input file name:', os.path.basename(file_name)
sys.exit(1)
@@ -62,10 +65,9 @@ def strip_whitespace_and_comments(file_name, content):
sys.exit(1)
extension = result.group(1).lower()
multi_line_comment = re.compile(r'/\*.*?\*/', re.MULTILINE | re.DOTALL)
- # Don't accidentally match URLs (http://...)
- repeating_space = re.compile(r'[ \t]+', re.MULTILINE)
- leading_space = re.compile(r'^[ \t]+', re.MULTILINE)
- trailing_space = re.compile(r'[ \t]+$', re.MULTILINE)
+ repeating_space = re.compile(r'\s+', re.MULTILINE)
+ leading_space = re.compile(r'^\s+', re.MULTILINE)
+ trailing_space = re.compile(r'\s+$', re.MULTILINE)
empty_line = re.compile(r'\n+')
if extension == 'js':
content = rjsmin.jsmin(content)
« no previous file with comments | « Source/build/scripts/action_useragentstylesheets.py ('k') | Source/build/scripts/scripts.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698