Skip to content

Commit

Permalink
create directories for models and R script in user folder
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Nov 7, 2012
1 parent 8d1ce03 commit 6a2fdf5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion python/plugins/sextante/modeler/ModelerUtils.py
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion python/plugins/sextante/r/RUtils.py
Expand Up @@ -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
Expand Down

6 comments on commit 6a2fdf5

@slarosa
Copy link
Member

@slarosa slarosa commented on 6a2fdf5 Nov 7, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

@volaya volaya commented on 6a2fdf5 Nov 7, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

@volaya volaya commented on 6a2fdf5 Nov 7, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@slarosa
Copy link
Member

@slarosa slarosa commented on 6a2fdf5 Nov 7, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

@pcav pcav commented on 6a2fdf5 Nov 8, 2012 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.