#!/usr/bin/env python1# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2# Copyright (C) 2009-2026 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 texttestDiff.py14# @author Jakob Erdmann15# @date 2015-11-031617"""18This is meant to be used as a diff tool for the sumo public and internal tests by adding the line19----------------------------20diff_program:texttestDiff.py21----------------------------22in ~/.texttest/config2324It runs the textual diff tool (vim by default) and, if the differing files are25sumo networks, opens both of them with sumo-gui.26"""27import os28import sys29import subprocess3031if len(sys.argv) == 4:32basedir, new = sys.argv[2:]33orig = os.path.join(basedir, new)34os.environ["GUISIM_BINARY"] = "sumo-gui"35else:36orig, new = sys.argv[1:]373839subprocess.Popen(["tkdiff", orig, new])4041if ("net.netgen" in orig or42"net.netconvert" in orig or43"net.scenario" in orig or44"net2.scenario" in orig or45"net.complex" in orig or46"net.tools" in orig or47"osmimport.tools" in orig or48".net.xml" in orig):49sumo = os.environ["GUISIM_BINARY"]50extraArgs = []51# extraArgs += ["--gui-settings-file", "/scr2/debug/000_view_settings/internal_junctions.xml"]52# extraArgs += ["--gui-settings-file", "/scr2/debug/000_view_settings/junctions.xml"]53# extraArgs += ["--gui-settings-file", "/scr2/debug/000_view_settings/junctionType.xml"]54subprocess.Popen([sumo, "-n", orig, "-e", "3600"] + extraArgs)55subprocess.Popen([sumo, "-n", new, "-e", "3600"] + extraArgs)565758