@@ -264,17 +264,20 @@ def paste_from_clipboard(self):
264264 clipboard = QGuiApplication .clipboard ()
265265 clipboard_text = clipboard .text ()
266266 if clipboard_text .endswith ('}' ):
267- origin_list = re .search (r'origin = "(.*?)"' , clipboard_text ).group (1 )
268- origin_list = origin_list .split ()
269- for index in range (len (self .float_widget_instances )):
270- widget_instance : FloatWidget = self .float_widget_instances [index ]
271- __single_axis = float (origin_list [index ])
272- widget_instance .set_value (__single_axis )
267+ origin_match = re .search (r'origin = "(.*?)"' , clipboard_text )
268+ if origin_match :
269+ origin_list = origin_match .group (1 ).split ()
270+ for index in range (len (self .float_widget_instances )):
271+ if index < len (origin_list ):
272+ widget_instance : FloatWidget = self .float_widget_instances [index ]
273+ __single_axis = float (origin_list [index ].replace (',' , '.' ))
274+ widget_instance .set_value (__single_axis )
273275 if "setpos" in clipboard_text :
274- setpos_match = re .search (r'setpos\s+([\d\.\-]+)\s+([\d\.\-]+)\s+([\d\.\-]+)' , clipboard_text )
276+ setpos_match = re .search (r'setpos\s+([\d\.\,\ -]+)\s+([\d\.\,\ -]+)\s+([\d\.\, \-]+)' , clipboard_text )
275277 if setpos_match :
276- setpos_values = [float (setpos_match .group (1 )), float (setpos_match .group (2 )),
277- float (setpos_match .group (3 ))]
278+ setpos_values = [float (setpos_match .group (1 ).replace (',' , '.' )),
279+ float (setpos_match .group (2 ).replace (',' , '.' )),
280+ float (setpos_match .group (3 ).replace (',' , '.' ))]
278281 for index , value in enumerate (setpos_values ):
279282 if index < len (self .float_widget_instances ):
280283 widget_instance : FloatWidget = self .float_widget_instances [index ]
0 commit comments