Skip to content

Commit a7dfcaa

Browse files
committedSep 14, 2013
[processing] added some in-code docs and comments
1 parent 2e3dfba commit a7dfcaa

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed
 

‎python/plugins/processing/algs/SaveSelectedFeatures.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ def processAlgorithm(self, progress):
8080
inputFilename = self.getParameterValue(self.INPUT_LAYER)
8181

8282
#The output. It will get the value of the destinatation file entered by the user.
83-
#If the user select "Save to temporary file", when we arrive here it will already have an asigned value, which will be
83+
#If the user select "Save to temporary file", when we arrive here it will already have an asigned value,
84+
#which will be a temporary file using the first supported file format of the corresponding algorithm provider
8485
output = self.getOutputFromName(self.OUTPUT_LAYER)
8586

8687
#input layers values are always a string with its location.
@@ -93,6 +94,9 @@ def processAlgorithm(self, progress):
9394
#First we create the output layer.
9495
#To do so, we call the getVectorWriter method in the Output object.
9596
#That will give us a VectorWriter, that we can later use to add features.
97+
#The destination file has its format selected based on the file extension.
98+
#If the selected format is not supported, the first available format from
99+
#the provider is used, and the corresponding file extension appended
96100
provider = vectorLayer.dataProvider()
97101
writer = output.getVectorWriter( provider.fields(),
98102
provider.geometryType(),

‎python/plugins/processing/gui/HistoryDialog.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def __init__(self):
5252
self.tree.currentItemChanged.connect(self.changeText)
5353
self.clearButton.clicked.connect(self.clearLog)
5454

55+
self.tree.setContextMenuPolicy(Qt.CustomContextMenu)
5556
self.tree.customContextMenuRequested.connect(self.showPopupMenu)
5657

5758
self.fillTree()

‎python/plugins/processing/tools/dataobjects.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
"""
44
***************************************************************************
5-
py
5+
dataobject.py
66
---------------------
77
Date : August 2012
88
Copyright : (C) 2012 by Victor Olaya
@@ -101,6 +101,7 @@ def loadList(layers):
101101
load(layer)
102102

103103
def load(fileName, name = None, crs = None, style = None):
104+
'''Loads a layer/table into the current project, given its file'''
104105
if fileName == None:
105106
return
106107
prjSetting = None
@@ -156,6 +157,10 @@ def getObject(uriorname):
156157
return ret
157158

158159
def getObjectFromUri(uri, forceLoad = True):
160+
'''returns an object (layer/table) given a file location.
161+
if forceLoad is true, it tries to load it if it is not currently open
162+
Otherwise, it will return the object only if it is loaded in QGIS'''
163+
159164
if uri is None:
160165
return None
161166
layers = getRasterLayers()

‎python/plugins/processing/tools/vector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ def getUniqueValues(layer, fieldIndex):
236236
def getUniqueValuesCount(layer, fieldIndex):
237237
return len(getUniqueValues(layer, fieldIndex))
238238

239-
# From two input field maps, create single field map
240239
def combineVectorFields(layerA, layerB):
240+
'''Create single field map from two input field maps'''
241241
fields = []
242242
fieldsA = layerA.dataProvider().fields()
243243
fields.extend(fieldsA)

0 commit comments

Comments
 (0)
Please sign in to comment.