I am trying to use GRASS algorithms in a plugin of mine, in order to improve the quality of a shapefile containing lines that will be used as a graph later. The first algorithm I want to use is the one that breaks the lines at their intersections : v.clean.break.
path_to_broken_lines = processing.runalg( "grass:v.clean", #Algorithm name input, #Path to the layer to break 0, #Tool (0<=>break) 0, #Threshold (not needed for this algorithm) "%f , %f, %f, %f "% (xmin , xmax , ymin , ymax), #GRASS_REGION_PARAMETER <ParameterExtent> -1, #GRASS_SNAP_TOLERANCE_PARAMETER <ParameterNumber> 0, #GRASS_MIN_AREA_PARAMETER <ParameterNumber> None, #Errors file (None <=> temporary file) None) #Output file path (None <=> temporary file)
Now, despite being the admin of my computer, I get an error saying that my company's policy is blocking the execution of the algorithm. Still, I can execute them manually by running the GRASS plugin, importing my file into grass (v.in.ogr) and using the algorithm afterwards, but it seems like I can't automate it.
My question is the following : is there a way to use "processing.runalg()" as admin ? I have found ways to execute shell scripts as an admin but it is not really the same problem, is it. The plugin would work if I launched QGIS as an administrator, but I do not really want to force the end users to launch QGIS as an admin just to be able to run a plugin they won't use daily.