Skip to content
Permalink
Browse files

create directories for models and R script in user folder

  • Loading branch information
alexbruy committed Nov 7, 2012
1 parent 8d1ce03 commit 6a2fdf5fea40790a0f5c16076df67a7e38e2bdb7
Showing with 4 additions and 2 deletions.
  1. +2 −1 python/plugins/sextante/modeler/ModelerUtils.py
  2. +2 −1 python/plugins/sextante/r/RUtils.py
@@ -36,7 +36,8 @@ class ModelerUtils:
def modelsFolder():
folder = SextanteConfig.getSetting(ModelerUtils.MODELS_FOLDER)
if folder == None:
folder = os.path.join(os.path.dirname(__file__), "models")
#folder = os.path.join(os.path.dirname(__file__), "models")
folder = SextanteUtils.userFolder() + os.sep + "models"
mkdir(folder)

return folder
@@ -48,7 +48,8 @@ def RFolder():
def RScriptsFolder():
folder = SextanteConfig.getSetting(RUtils.RSCRIPTS_FOLDER)
if folder == None:
folder = os.path.join(os.path.dirname(__file__), "scripts")
#folder = os.path.join(os.path.dirname(__file__), "scripts")
folder = SextanteUtils.userFolder() + os.sep + "rscripts"
mkdir(folder)

return folder

6 comments on commit 6a2fdf5

@slarosa

This comment has been minimized.

Copy link
Member

@slarosa slarosa replied Nov 7, 2012

Hi Alexander,
the SextanteUtils class is not found in ModelerUtils.py and it throws NameError: global name 'SextanteUtils' is not defined.

from sextante.core.SextanteUtils import SextanteUtils

Thanks!

@volaya

This comment has been minimized.

Copy link
Contributor

@volaya volaya replied Nov 7, 2012

Hey! It seems that we are changing this back and forth :-) I like to have it model in the user folder by default....but if we do that, the example model cannot be shipped with qgis and appear the first time qgis + sextante is opened. The same happens with R scripts and normal scripts....

Any idea how to do it? If we cannot do it, I will hardcode a folder of example models and scripts, and they will always be loaded, no matter were the model folder is located

@volaya

This comment has been minimized.

Copy link
Contributor

@volaya volaya replied Nov 7, 2012

Done. Now sample models and scripts are always loaded from their own folder

@slarosa

This comment has been minimized.

Copy link
Member

@slarosa slarosa replied Nov 7, 2012

Hi Victor,
I am not a cmake expert but I guess it can be done by copying the example model in user dir models (~/sextante/models)
Maybe Alexander could do it ?

I think hardcode folder also might be a solution !

@alexbruy

This comment has been minimized.

Copy link
Contributor Author

@alexbruy alexbruy replied Nov 8, 2012

I just thinking about moving sextante folder under ~/.qgis so all QGIS-related things will be in user directory. This solve issues with access rights and make backup much simpler.

@pcav

This comment has been minimized.

Copy link
Member

@pcav pcav replied Nov 8, 2012

Please sign in to comment.
You can’t perform that action at this time.