Skip to content

rtc.confのバックスラッシュの後にスペースがある場合、urlparam2mapで空白のパラメータがある場合に設定を無視する #271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions OpenRTM_aist/Properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ def getRoot(self):
# @endif

def getProperty(self, key, default=None):
if not key.strip():
return self.empty
if default is None:
keys = []
#keys = str.split(key, ".")
Expand Down Expand Up @@ -419,6 +421,8 @@ def getProperty(self, key, default=None):
# @endif

def getDefault(self, key):
if not key.strip():
return self.empty
keys = []
#keys = str.split(key, ".")
self.split(key, ".", keys)
Expand Down Expand Up @@ -459,6 +463,8 @@ def getDefault(self, key):
# @endif

def setProperty(self, key, value=None):
if not key.strip():
return value
if value is not None:
keys = []
#keys = str.split(key, ".")
Expand Down Expand Up @@ -761,6 +767,7 @@ def load(self, inStream):

_str = _str.rstrip('\r\n')
_str = _str.rstrip('\n')
_str = _str.strip()

if not _str:
continue
Expand Down Expand Up @@ -964,7 +971,7 @@ def size(self):
# Properties* const Properties::findNode(const std::string& key) const

def findNode(self, key):
if not key:
if not key.strip():
return None

keys = []
Expand All @@ -987,7 +994,7 @@ def findNode(self, key):
# @endif

def getNode(self, key):
if not key:
if not key.strip():
return self

leaf = self.findNode(key)
Expand Down Expand Up @@ -1015,7 +1022,7 @@ def getNode(self, key):
# @endif

def createNode(self, key):
if not key:
if not key.strip():
return False

if self.findNode(key):
Expand Down Expand Up @@ -1182,7 +1189,7 @@ def splitKeyValue(self, _str, key, value):
# @endif

def split(self, _str, delim, value):
if _str == "":
if not _str.strip():
return False

begin_it = end_it = 0
Expand Down
6 changes: 5 additions & 1 deletion OpenRTM_aist/StringUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,9 +695,13 @@ def urlparam2map(_str):
tmp = _str[qpos:].split("&")
retmap = {}
for v in tmp:
if not v.strip():
continue
pos = v.find("=")
if pos != -1:
retmap[v[0:pos]] = v[pos + 1:]
key = v[0:pos]
if key.strip():
retmap[key] = v[pos + 1:]
else:
retmap[v] = ""
return retmap
Expand Down