I need help in identifying the feature attributes displaying a pdf file when click in that feature. I see many examples but I don't have success. I try this code:
command = "firefox";
imagerelpath = "images_test/test_image.jpg";
layer = qgis.utils.iface.activeLayer();
import os.path;
layerpath = layer.source() if layer.providerType() == 'ogr'
else (qgis.core.QgsDataSourceURI(layer.source()).database()
if layer.providerType() == 'spatialite' else None);
path = os.path.dirname(str(layerpath));
image = os.path.join(path,imagerelpath);
import subprocess;
subprocess.Popen( [command, image ] );
but it gives me always an error:
WindowsError: [Error 2] The system cannot find the file specified
Basically, I have a shapefile and I want to click in a feature and open a pdf file. I want to develop that in a python plugin.
subprocessmodule needs the complete path of Firefox. If not, it don't know what is the command – gene Jul 18 '14 at 16:07