Path: blob/main/tools/neteditTestFunctions/frames/edit/basicAttribute.py
169686 views
# -*- coding: utf-8 -*-1# 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 basicAttribute.py14# @author Pablo Alvarez Lopez15# @date 28-05-251617# imports18from ...enums.attributesEnum import attrs19from ...general.functions import focusOnFrame20from ...input.keyboard import typeKey, updateText212223def modifyAttribute(attributeIndex, value):24"""25@brief modify attribute of type int/float/string26"""27# focus current frame28focusOnFrame()29# jump to attribute30for _ in range(attributeIndex):31typeKey('tab')32# paste the new value33updateText(value)34# type Enter to commit change35typeKey('enter')363738def modifyAttributeOverlapped(attributeIndex, value):39"""40@brief modify attribute of type int/float/string41"""42# focus current frame43focusOnFrame()44# jump to attribute45for _ in range(attributeIndex + attrs.editElements.overlapped):46typeKey('tab')47# paste the new value48updateText(value)49# type Enter to commit change50typeKey('enter')515253