On Thu, Aug 14, 2014 at 8:58 AM, <svn_grass@osgeo.org> wrote:
+sys.path.insert(1, os.path.join(os.path.dirname(sys.path[0]), 'etc',
'wx.metadata'))
Do you this this is robust enough?
There is a function to do something like this. Does this one suite you?
I still think that the current solution is not good. We probably should
have the directory with packages on path and then import like this:
from wxmetadata.editor import MdMainEditor
when using the package by module, rather then current:
from editor import MdMainEditor
But I think this requires some changes in makefiles, directory layout and
naming convections and there is actually a ticket with similar topic.
http://trac.osgeo.org/grass/browser/grass-addons/grass7/raster/r.modis/r.modis.download/r.modis.download.py#L84
http://trac.osgeo.org/grass/changeset/58208
http://trac.osgeo.org/grass/browser/grass/trunk/lib/python/pygrass/functions.py#L270
http://trac.osgeo.org/grass/ticket/2132
Hi,
2014-08-14 16:23 GMT+02:00 Vaclav Petras <wenzeslaus@gmail.com>:
+sys.path.insert(1, os.path.join(os.path.dirname(sys.path[0]), 'etc',
'wx.metadata'))
Do you this this is robust enough?
There is a function to do something like this. Does this one suite you?
I still think that the current solution is not good. We probably should have
the directory with packages on path and then import like this:
from wxmetadata.editor import MdMainEditor
when using the package by module, rather then current:
from editor import MdMainEditor
But I think this requires some changes in makefiles, directory layout and
naming convections and there is actually a ticket with similar topic.
http://trac.osgeo.org/grass/browser/grass-addons/grass7/raster/r.modis/r.modis.download/r.modis.download.py#L84
http://trac.osgeo.org/grass/changeset/58208
http://trac.osgeo.org/grass/browser/grass/trunk/lib/python/pygrass/functions.py#L270
http://trac.osgeo.org/grass/ticket/2132
the current wx.metadata's Makefiles are very far away from an ideal
solution. Feel free to improve them... Martin
--
Martin Landa * http://geo.fsv.cvut.cz/gwiki/Landa
On Thu, Aug 14, 2014 at 11:10 AM, Martin Landa <landa.martin@gmail.com>
wrote:
the current wx.metadata's Makefiles are very far away from an ideal
solution. Feel free to improve them... Martin
This is what I meant by #2132, I don't have any idea what to do with
Makefiles nor if the current handling of addons directories is final, good,
or just something which is supposed to work only for simple cases. Sorry, I
cannot help here much now since I know neither the way nor the goal.
Hi,
2014-08-14 20:10 GMT+02:00 Vaclav Petras <wenzeslaus@gmail.com>:
This is what I meant by #2132, I don't have any idea what to do with
Makefiles nor if the current handling of addons directories is final, good,
or just something which is supposed to work only for simple cases. Sorry, I
cannot help here much now since I know neither the way nor the goal.
OK, anyway thaks for tip. I overlooked get_lib_path(). Martin
--
Martin Landa * http://geo.fsv.cvut.cz/gwiki/Landa