Module Expr Str Import alias ImportFrom alias Import alias ImportFrom alias ImportFrom alias Assign NameStore Str Assign NameStore Str Assign NameStore Str FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad Call AttributeLoad Call NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Str For NameStore NameLoad body AugAssignAdd NameStore Call AttributeLoad NameLoad attr Return BinOpAdd Call AttributeLoad Str attr NameLoad Str decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str TryExcept body Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr ListLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareNotEq AttributeLoad NameLoad attr Str body Raise Call NameLoad Str For NameStore Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad If AttributeLoad NameLoad attr body Raise Call NameLoad Call AttributeLoad Str attr AttributeLoad NameLoad attr Return AttributeLoad NameLoad attr handlers ExceptHandler type AttributeLoad NameLoad attr body Raise Call NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareNotEq NameLoad Str body Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod Str NameLoad Return Assign NameStore Call NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If UnaryOpNot AttributeLoad NameLoad attr body Return NameLoad TryExcept body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Return BinOpMod NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str If BoolOpAnd CompareEq Call NameLoad NameLoad Num UnaryOpNot Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Num body Return BinOpMod NameLoad AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Assign NameStore ListLoad BinOpMod Str AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr BinOpMod Str Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return BinOpMod Str Call AttributeLoad NameLoad attr Str Str decorator_list decorator_list
N/A N/A Directly processes text of dos.xml.

DosXmlParser is called with an XML string to produce a list of BlackListEntry
objects containing the data from the XML.

DosXmlParser: converts XML to list of BlackListEntrys.
BlacklistEntry: describes a blacklisted IP.
 N/A re xml.etree ElementTree N/A ipaddr google.appengine.tools xml_parser_utils google.appengine.tools.app_engine_config_exception AppEngineConfigException N/A MISSING_SUBNET <blacklist> node must have a subnet specified N/A BAD_IPV_SUBNET "%s" is not a valid IPv4 or IPv6 subnet N/A BAD_PREFIX_LENGTH Prefix length of subnet "%s" must be an integer (quad-dotted masks are not supported) GetDosYaml N/A N/A unused_application dos_xml_str N/A N/A N/A N/A _MakeDosListIntoYaml N/A N/A N/A DosXmlParser ProcessXml dos_xml_str N/A _MakeDosListIntoYaml N/A N/A dos_list N/A N/A N/A Converts yaml statement list of blacklisted IP's into a string. N/A statements N/A blacklist: N/A entry dos_list N/A N/A statements N/A N/A entry ToYaml N/A N/A N/A N/A join statements N/A DosXmlParser N/A object N/A N/A Provides logic for walking down XML tree and pulling data. ProcessXml N/A N/A self xml_str N/A N/A N/A Parses XML string and returns object representation of relevant info.

    Args:
      xml_str: The XML string.
    Returns:
      A list of BlacklistEntry objects containing information about blacklisted
      IP's specified in the XML.
    Raises:
      AppEngineConfigException: In case of malformed XML or illegal inputs.
     N/A N/A N/A N/A self blacklist_entries N/A N/A N/A self errors N/A N/A xml_root N/A N/A ElementTree fromstring xml_str N/A N/A N/A xml_root tag blacklistentries N/A N/A N/A AppEngineConfigException Root tag must be <blacklistentries> N/A child N/A N/A xml_root getchildren N/A N/A N/A N/A self ProcessBlacklistNode child N/A N/A self errors N/A N/A N/A AppEngineConfigException N/A N/A join N/A self errors N/A N/A self blacklist_entries N/A N/A N/A N/A ElementTree ParseError N/A N/A N/A AppEngineConfigException Bad input -- not valid XML N/A ProcessBlacklistNode N/A N/A self node N/A N/A N/A Processes XML <blacklist> nodes into BlacklistEntry objects.

    The following information is parsed out:
      subnet: The IP, in CIDR notation.
      description: (optional)
    If there are no errors, the data is loaded into a BlackListEntry object
    and added to a list. Upon error, a description of the error is added to
    a list and the method terminates.

    Args:
      node: <blacklist> XML node in dos.xml.
     N/A tag N/A N/A xml_parser_utils GetTag node N/A N/A tag blacklist N/A N/A N/A N/A N/A self errors append N/A Unrecognized node: <%s> tag N/A N/A entry N/A BlacklistEntry N/A N/A entry subnet N/A N/A xml_parser_utils GetChildNodeText node subnet N/A N/A entry description N/A N/A xml_parser_utils GetChildNodeText node description N/A validation N/A N/A self _ValidateEntry entry N/A validation N/A N/A N/A N/A N/A self errors append validation N/A N/A N/A N/A N/A self blacklist_entries append entry N/A _ValidateEntry N/A N/A self entry N/A N/A N/A N/A N/A entry subnet N/A N/A MISSING_SUBNET N/A N/A N/A N/A N/A ipaddr IPNetwork N/A entry subnet N/A N/A N/A ValueError N/A N/A N/A BAD_IPV_SUBNET N/A entry subnet N/A parts N/A N/A N/A entry subnet split / N/A N/A N/A N/A len parts 2 N/A N/A N/A re match ^[0-9]+$ N/A parts N/A 1 N/A N/A N/A BAD_PREFIX_LENGTH N/A entry subnet N/A N/A BlacklistEntry N/A object N/A N/A Instances contain information about individual blacklist entries. ToYaml N/A N/A self N/A N/A N/A statements N/A N/A - subnet: %s N/A self subnet N/A N/A self description N/A N/A N/A N/A statements append N/A   description: %s N/A N/A self _SanitizeForYaml N/A self description N/A statements N/A _SanitizeForYaml N/A N/A self dirty_str N/A N/A N/A N/A '%s' N/A N/A dirty_str replace N/A N/A