#!/usr/bin/env python1# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2# Copyright (C) 2009-2025 German Aerospace Center (DLR) and others.3# This program and the accompanying materials are made available under the4# terms of the Eclipse Public License 2.0 which is available at5# https://www.eclipse.org/legal/epl-2.0/6# This Source Code may also be made available under the following Secondary7# Licenses when the conditions for such availability set forth in the Eclipse8# Public License 2.0 are satisfied: GNU General Public License, version 29# or later which is available at10# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later1213# @file batch0103to0110.py14# @author Daniel Krajzewicz15# @author Michael Behrisch16# @date 20071718"""19Applies the transformation on all nets in the given folder or20- if no folder is given - in the base folder (../..).21"""22from __future__ import absolute_import23from __future__ import print_function2425import os26import os.path27import sys2829r = "../../"30if len(sys.argv) > 1:31r = sys.argv[1]32srcRoot = os.path.join(os.path.dirname(sys.argv[0]), r)33for root, dirs, files in os.walk(srcRoot):34for name in files:35if name.endswith(".net.xml") or name == "net.netconvert" or name == "net.netgen":36p = os.path.join(root, name)37print("Patching " + p + "...")38os.system("0103to0110.py " + p)39os.remove(p)40os.rename(p + ".chg", p)41for ignoreDir in ['.svn', 'foreign']:42if ignoreDir in dirs:43dirs.remove(ignoreDir)444546