Revision 847 org.gvsig.scripting/trunk/org.gvsig.scripting/org.gvsig.scripting.app/org.gvsig.scripting.app.mainplugin/src/main/resources-plugin/scripting/lib/gvsig/libs/gvpy.py

View differences:

gvpy.py
1 1

  
2 2
# File: gvpy.py
3
# Version: v0.6
4
# 2016/10/24
3
# Version: v0.5
4
# 2016/02/10
5 5

  
6
__author__ = """Oscar Martinez Olmos <masquesig@gmail.com>"""
6 7

  
7 8
import gvsig
8 9
from gvsig import geom
......
17 18
import java.awt.geom
18 19
from java.io import File
19 20
from java.util import ArrayList
20
import collections
21 21

  
22 22
from gvsig import uselib
23 23
uselib.use_plugin("org.gvsig.geoprocess.app.mainplugin")
......
147 147
    def __defineParameters_multi2sextante(self, param, paramValue):
148 148
                if DEV_INFO: print "PARAM VALUE PRE", paramValue
149 149
                paramValue2 = []
150
                # Just one layer as parameter, to make it iterable
151
                if not isinstance(paramValue, collections.Iterable):
152
                    paramValue = [paramValue]
153
                    
154 150
                for i in paramValue:
155 151
                    if isinstance(i, str):
156 152
                        layer = gvsig.currentView().getLayer(i)
153
                        if DEV_INFO: print "--------------- lidar: ", layer
157 154
                        i = self.__createSextanteLayer(layer)
158 155
                        ii = self.__createSextanteLayer(layer)
159 156

  
......
523 520
        if "OUTPUT_VIEW" in kwparams:
524 521
            outputview = (kwparams["OUTPUT_VIEW"]).decode("UTF-8")
525 522
            if isinstance(outputview, str):
526
                view = gvsig.currentProject().getView(outputview)
523
                view = currentProject().getView(outputview)
527 524
            else:
528 525
                view = outputview
529 526
        else:
......
563 560
        if "OUTPUT_VIEW" in kwparams:
564 561
            outputview = (kwparams["OUTPUT_VIEW"]).decode("UTF-8")
565 562
            if isinstance(outputview, str):
566
                view = gvsig.currentProject().getView(outputview)
563
                view = currentProject().getView(outputview)
567 564
            else:
568 565
                view = outputview
569 566
        else:
......
635 632
                    outList.append(value)
636 633
            else:
637 634
                print "|\t Non-type \tValue: ", value
635
                outList.append(value)
638 636
                continue
639 637

  
640 638
        #Return object or list

Also available in: Unified diff