Skip to content

Commit

Permalink
[processing] more correct storing of DB data in log
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed Jun 23, 2015
1 parent 99150dd commit 06d250e
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions python/plugins/processing/core/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* *
***************************************************************************
"""
from processing.tools.vector import resolveFieldIndex, features


__author__ = 'Victor Olaya'
__date__ = 'August 2012'
Expand All @@ -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
Expand Down Expand Up @@ -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):

Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 06d250e

Please sign in to comment.