@@ -540,28 +540,28 @@ def apply(self, obj):
540
540
return obj
541
541
542
542
@property
543
- def oldpath (self ):
544
- oldptr = JsonPointer (self .operation ['from' ])
545
- return '/' .join (oldptr .parts [:- 1 ])
543
+ def from_path (self ):
544
+ from_ptr = JsonPointer (self .operation ['from' ])
545
+ return '/' .join (from_ptr .parts [:- 1 ])
546
546
547
547
@property
548
- def oldkey (self ):
549
- oldptr = JsonPointer (self .operation ['from' ])
548
+ def from_key (self ):
549
+ from_ptr = JsonPointer (self .operation ['from' ])
550
550
try :
551
- return int (oldptr .parts [- 1 ])
551
+ return int (from_ptr .parts [- 1 ])
552
552
except TypeError :
553
- return oldptr .parts [- 1 ]
553
+ return from_ptr .parts [- 1 ]
554
554
555
- @oldkey .setter
556
- def oldkey (self , value ):
557
- oldptr = JsonPointer (self .operation ['from' ])
558
- oldptr .parts [- 1 ] = str (value )
559
- self .operation ['from' ] = oldptr .path
555
+ @from_key .setter
556
+ def from_key (self , value ):
557
+ from_ptr = JsonPointer (self .operation ['from' ])
558
+ from_ptr .parts [- 1 ] = str (value )
559
+ self .operation ['from' ] = from_ptr .path
560
560
561
561
def _on_undo_remove (self , path , key ):
562
- if self .oldpath == path :
563
- if self .oldkey >= key :
564
- self .oldkey += 1
562
+ if self .from_path == path :
563
+ if self .from_key >= key :
564
+ self .from_key += 1
565
565
else :
566
566
key -= 1
567
567
if self .path == path :
@@ -572,9 +572,9 @@ def _on_undo_remove(self, path, key):
572
572
return key
573
573
574
574
def _on_undo_add (self , path , key ):
575
- if self .oldpath == path :
576
- if self .oldkey > key :
577
- self .oldkey -= 1
575
+ if self .from_path == path :
576
+ if self .from_key > key :
577
+ self .from_key -= 1
578
578
else :
579
579
key -= 1
580
580
if self .path == path :
0 commit comments