Skip to content

Commit 52e6da7

Browse files
Marie YaoMarie
authored andcommitted
Refs #338. Make --show-values awared of --retype.
git-svn-id: https://svn.nexusformat.org/code/trunk@1866 ff5d1e40-2be0-497f-93bd-dc18237bd3c7
1 parent 50c0100 commit 52e6da7

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

applications/nxdiff

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ class Diff:
5656
except KeyError:
5757
right = None
5858
try:
59-
rightpath = kwargs["rightpath"]
59+
self.rightpath = kwargs["rightpath"]
6060
except KeyError:
61-
rightpath = None
61+
self.rightpath = None
6262
try:
6363
epsilon = kwargs["epsilon"]
6464
except KeyError:
@@ -84,7 +84,7 @@ class Diff:
8484
if self.summary != Diff.UNKNOWN:
8585
return
8686

87-
self.__cmpData(left, right, rightpath, epsilon)
87+
self.__cmpData(left, right, self.rightpath, epsilon)
8888
if len(self.details) > 0:
8989
self.summary = Diff.DIFF
9090
else:
@@ -104,7 +104,7 @@ class Diff:
104104

105105
def __cmpData(self, left, right, rightpath, epsilon):
106106
left = left.getData(self.path)
107-
if rightpath != None:
107+
if rightpath is not None:
108108
right = right.getData(rightpath)
109109
else:
110110
right = right.getData(self.path)
@@ -478,7 +478,11 @@ def printDataDiff(left, right, diff, **kwargs):
478478

479479
# get the data
480480
left = left.getData(diff.path)
481-
right = right.getData(diff.path)
481+
# use diff.rightpath for --retype
482+
if diff.rightpath is not None:
483+
right = right.getData(diff.rightpath)
484+
else:
485+
right = right.getData(diff.path)
482486

483487
# the dimensions of the data
484488
leftLength = 1

0 commit comments

Comments
 (0)