#!/usr/bin/env python1# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2# Copyright (C) 2010-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 debug2sel.py14# @author Jakob Erdmann15# @date 2021-03-11161718"""build (edge) selection file from cmdline id list of edges or lanes19"""20from __future__ import print_function21import sys2223outfile = sys.argv[1]24ids = sys.argv[2].split()25objectType = sys.argv[3] if len(sys.argv) > 3 else "edge"2627if objectType == "lane2edge":28objectType = "edge"29ids = ['_'.join(id.split('_')[:-1]) for id in ids]3031with open(outfile, 'w') as outf:32for id in ids:33outf.write("%s:%s\n" % (objectType, id))34print("wrote %s %s to '%s'" % (len(ids), objectType, outfile))353637