tools/android/modularization/convenience/build_gn_editor.py
def parse_from(self, content: str) -> bool:
    """Parses list elements from content and returns True on success.

    The expected list format must be a valid gn list. i.e.
    1. []
    2. [ "foo" ]
    3. [
         "foo",
         "bar",
         ...
       ]
    """
    start = content.find('[')
    if start < 0:
      return False

    end = start + content[start:].find(']')
    if end <= start:
      return False

    bracketless_content = content[start + 1:end].strip()
    if not bracketless_content:
      return True

    whitespace = re.compile(r'^\s+', re.MULTILINE)
    comma = re.compile(r',$', re.MULTILINE)
    self._elements = list(
        dict.fromkeys(
            re.sub(comma, '', re.sub(whitespace, '',
                                     bracketless_content)).split('\n')))
    return True
Parses list elements from content and returns True on success.

    The expected list format must be a valid gn list. i.e.
    1. []
    2. [ "foo" ]
    3. [
         "foo",
         "bar",
         ...
       ]
    
Parses list elements from content and returns True on success.
The expected list format must be a valid gn list.
Parses list elements from content and returns True on success . The expected list format must be a valid gn list .
def parse_from(self, content: str) -> bool:
    start = content.find('[')
    if start < 0:
      return False
    end = start + content[start:].find(']')
    if end <= start:
      return False
    bracketless_content = content[start + 1:end].strip()
    if not bracketless_content:
      return True
    whitespace = re.compile(r'^\s+', re.MULTILINE)
    comma = re.compile(r',$', re.MULTILINE)
    self._elements = list(
        dict.fromkeys(
            re.sub(comma, '', re.sub(whitespace, '',
                                     bracketless_content)).split('\n')))
    return True
def parse_from ( self , content : str ) -> bool : start = content . find ( '[' ) if start < 0 : return False end = start + content [ start : ] . find ( ']' ) if end <= start : return False bracketless_content = content [ start + 1 : end ] . strip ( ) if not bracketless_content : return True whitespace = re . compile ( r'^\s+' , re . MULTILINE ) comma = re . compile ( r',$' , re . MULTILINE ) self . _elements = list ( dict . fromkeys ( re . sub ( comma , '' , re . sub ( whitespace , '' , bracketless_content ) ) . split ( '\n' ) ) ) return True
Parses list elements from content and returns True on success.
Parses list elements from content and returns True on success .
"""Parses list elements from content and returns True on success.

    The expected list format must be a valid gn list. i.e.
    1. []
    2. [ "foo" ]
    3. [
         "foo",
         "bar",
         ...
       ]
    """
self
content
str