You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Option 2: There are way more properties than actually needed. Also settable has double properties such as global and local position.
Option 1: Implementation using difflib:
fromDAVEimport*s1=Scene(r'C:\data\DAVE\public\DAVE\tests\files\basic_nodes.dave')
s2=Scene(r'C:\data\DAVE\public\DAVE\tests\files\basic_nodes.dave')
s2['Point'].name='point2's1['Point'].position= (1,2,3)
code1=s1.give_python_code()
code2=s2.give_python_code()
defclean(lines):
r= []
forlineinlines:
ifline.startswith('#'):
continueif"solved("inline:
continueif'return number'inline:
continuer.append(line)
return'\n'.join(r)
code1=clean(code1.splitlines())
code2=clean(code2.splitlines())
# use difflib to compare the two code strings# and show the result in htmlfromdifflibimportHtmlDiffdiff=HtmlDiff().make_file(code1.splitlines(), code2.splitlines(), fromdesc='model1', todesc='model2')
diff=diff.replace('¶', '')
withopen('scratch_85.html', 'w') asf:
f.write(diff)
# open the html file in the browserimportwebbrowserwebbrowser.open('scratch_85.html')
Option 1 is a file-diff of two .dave files
Option 2 is a node-by-node property comparison
The text was updated successfully, but these errors were encountered: