'Translates <network> in appengine-web.xml to yaml.'

def TranslateNetwork(self):

    network = self.app_engine_web_xml.network
    if (not network):
        return []
    statements = ['network:']
    for attr in ('instance_tag', 'name'):
        value = getattr(network, attr, None)
        if (value is not None):
            statements.append(('        %s:    %s' % (attr, value)))
    forwarded_ports = getattr(network, 'forwarded_ports', None)
    if (forwarded_ports is not None):
        statements.append('        forwarded_ports:')
        for port in forwarded_ports:
            statements.append(('        -    ' + port))
    return statements
