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

Unified Diff: core/scripts/name_utilities.py

Issue 37053003: Roll IDL to multivm@1467 (Closed) Base URL: https://dart.googlecode.com/svn/third_party/WebCore
Patch Set: Created 7 years, 2 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 | « core/scripts/make_runtime_features.py ('k') | core/scripts/template_expander.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/scripts/name_utilities.py
diff --git a/core/scripts/list_idl_files_with_partial_interface.py b/core/scripts/name_utilities.py
similarity index 76%
copy from core/scripts/list_idl_files_with_partial_interface.py
copy to core/scripts/name_utilities.py
index edebc517d0865c49d3060fc03041d1838c8ac9de..c4993b0c552bf9b6cd3fc59ebe530325667615bc 100644
--- a/core/scripts/list_idl_files_with_partial_interface.py
+++ b/core/scripts/name_utilities.py
@@ -26,19 +26,15 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-"""This file returns a list of all the IDL files that contain a partial interface."""
+ACRONYMS = ['CSS', 'HTML', 'IME', 'JS', 'SVG', 'URL', 'WOFF', 'XML', 'XSLT']
-import re
-import sys
-partial_interface_regex = re.compile(r'partial\s+interface\s+(\w+).+\]', re.M | re.S)
+def lower_first(name):
+ """Return name with first letter or initial acronym lowercased.
-
-def DoMain(filenames):
- partial_files = set()
- for filename in filenames:
- with open(filename) as f:
- match = re.search(partial_interface_regex, f.read())
- if match:
- partial_files.add(filename)
- return '\n'.join(partial_files)
+ E.g., 'SetURL' becomes 'setURL', but 'URLFoo' becomes 'urlFoo'.
+ """
+ for acronym in ACRONYMS:
+ if name.startswith(acronym):
+ return name.replace(acronym, acronym.lower())
+ return name[0].lower() + name[1:]
« no previous file with comments | « core/scripts/make_runtime_features.py ('k') | core/scripts/template_expander.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698