Skip to content
Permalink
Browse files

[processing] more correct storing of DB data in log

  • Loading branch information
volaya committed Jun 22, 2015
1 parent 99150dd commit 06d250ef891b11b0c2b770a7b95a56779665ea8d
Showing with 14 additions and 6 deletions.
  1. +14 −6 python/plugins/processing/core/parameters.py
@@ -17,7 +17,7 @@
* *
***************************************************************************
"""
from processing.tools.vector import resolveFieldIndex, features


__author__ = 'Victor Olaya'
__date__ = 'August 2012'
@@ -29,7 +29,9 @@

import sys
import os
import re

from processing.tools.vector import resolveFieldIndex, features
from PyQt4.QtCore import QCoreApplication
from qgis.core import QgsRasterLayer, QgsVectorLayer
from processing.tools.system import isWindows
@@ -147,11 +149,16 @@ def getValueAsCommandLineParameter(self):
if self.value is None:
return unicode(None)
else:
if not isWindows():
return '"' + unicode(self.value) + '"'
else:
return '"' + unicode(self.value).replace('\\', '\\\\') + '"'
s = unicode(self.value)
if isWindows():
s = s.replace('\\', '\\\\')
s = s.replace('"', "'")
s = '"%s"' % s

s = re.sub("'user.*?'", "", s)
s = re.sub("'password.*?'", "", s)

return s

class ParameterExtent(Parameter):

@@ -548,7 +555,7 @@ def __init__(self, name='', description='', options=[], default=0, isSource = Fa
index = resolveFieldIndex(layer, options[1])
feats = features(layer)
for feature in feats:
self.options.append(unicode(feature.attributes()[index]))
self.options.append(unicode(feature.attributes()[index]))
except ValueError:
pass
elif isinstance(self.options, basestring):
@@ -744,6 +751,7 @@ def setValue(self, obj):
return True
return os.path.exists(self.value)


def getSafeExportedLayer(self):
"""Returns not the value entered by the user, but a string with
a filename which contains the data of this layer, but saved in

0 comments on commit 06d250e

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