QGIS - AttributeError: 'Nonetype' Objekt hat kein Attribut -Name 'Name'
Posted: 27 Feb 2025, 11:49
Hallo, ich habe ein Python -Problem, wenn ich versuche, ein Plugin auf QGIS zu starten.
'Nonetype' Objekt hat kein Attribut 'Name'
Kann mir jemand helfen?
Code: Select all
def get_data_source_file_path(layer):
# get source path
provider = layer.dataProvider().name()
source_parts = QgsProviderRegistry.instance().decodeUri(provider, layer.source() )
source_path = source_parts.get( 'path', '' )
if 'ogr' == provider.lower():
source_path = source_path.split('|')[0]
return path.normpath( source_path )
Kann mir jemand helfen?