| 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:]
|
|
|