File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -140,21 +140,28 @@ def guess_continuous(property):
140
140
141
141
def _paste_data (self , store ):
142
142
"""Paste only currently unannotated data."""
143
- features = self ._clipboard .pop ("features" )
143
+ features = self ._clipboard .pop ("features" , None )
144
144
if features is None :
145
145
return
146
+
146
147
unannotated = [
147
148
keypoints .Keypoint (label , id_ ) not in store .annotated_keypoints
148
149
for label , id_ in zip (features ["label" ], features ["id" ])
149
150
]
151
+ if not any (unannotated ):
152
+ return
153
+
150
154
new_features = features .iloc [unannotated ]
151
155
indices_ = self ._clipboard .pop ("indices" )
152
156
text_ = self ._clipboard .pop ("text" )
153
157
self ._clipboard = {k : v [unannotated ] for k , v in self ._clipboard .items ()}
154
158
self ._clipboard ["features" ] = new_features
155
159
self ._clipboard ["indices" ] = indices_
156
160
if text_ is not None :
157
- new_text = {k : v [unannotated ] for k , v in text_ .items ()}
161
+ new_text = {
162
+ "string" : text_ ["string" ][unannotated ],
163
+ "color" : text_ ["color" ],
164
+ }
158
165
self ._clipboard ["text" ] = new_text
159
166
160
167
npoints = len (self ._view_data )
You can’t perform that action at this time.
0 commit comments