Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T1.3 save python2 backup file on migration #6

Merged
merged 27 commits into from
Jul 6, 2020

Conversation

SHKnudsen
Copy link
Owner

Purpose

this PR add mechanism to save a Python2 backup of the graph.
The backup will only be saved whenever there isnt already a Python2 backup with the same name it the Dynamo backup folder.

T1 3-SavePython2Backup

@SHKnudsen SHKnudsen requested review from alvpickmans and radumg July 3, 2020 13:05

public PythonMigrationAssistantViewModel(PythonNode pythonNode)
public PythonMigrationAssistantViewModel(PythonNode pythonNode, DynamoViewModel dynamoViewModel)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we depend on something less hard to get than the DynamoViewModel ? Extension access to that is going away eventually.

I think there's a way to get the backup directory path without the full viewmode, there's some static settings providers or things like that from what i remember.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as far as i can see i can only get it from the PathManager which i can only get from the DynamoModel. I havent been able to find any other place to get it from, but can have another look.

Im also using the SaveAs on the DynamoModel which is the same as what Dynamo uses to save the regular backups.

@alvpickmans
Copy link

Should not the Python Engine change after migration is done? Currently on Gif still shows as IronPython2

@SHKnudsen
Copy link
Owner Author

Yea true @alvpickmans we did actually discuss that, i forgot to add that in. Will add that to the T1.1 branch.

@SHKnudsen SHKnudsen merged commit 831946e into T1.3-SavePython2BackupFile Jul 6, 2020
@SHKnudsen SHKnudsen deleted the T1.3_SavePython2BackupFile branch July 23, 2020 08:34
SHKnudsen added a commit that referenced this pull request Aug 5, 2020
* T1.1 Code Migration (#4)

* add ScriptMigrator

* Add visual difference viewer

* Update PythonMigrationViewExtension.cs

* Add tooltip description to migration assistant

* updates

* comment updates

* comment updates

* Update PythonMigrationViewExtension.csproj

* T1.2 accept/reject code changes (#5)

* add ScriptMigrator

* Add visual difference viewer

* Added methods for updating the ScriptEditors with the migrated code

* Update PythonMigrationViewExtension.cs

* Add tooltip description to migration assistant

* updates

* comment updates

* comment updates

* Update ScriptEditorWindow.xaml.cs

* Update PythonMigrationViewExtension.csproj

* Update PythonMigrationViewExtension.csproj

* comment updates

* Revert "comment updates"

This reverts commit 2d2332a.

* comment updates

* Update PythonMigrationAssistantViewModel.cs

* comment updates 2

* update engine version when migrating code

* extension and test updates

* T1.3 save python2 backup file on migration (#6)

* add ScriptMigrator

* Add visual difference viewer

* Added methods for updating the ScriptEditors with the migrated code

* Update PythonMigrationViewExtension.cs

* add mechanisme to save Python 2 backup

* Add tooltip description to migration assistant

* updates

* comment updates

* comment updates

* Update ScriptEditorWindow.xaml.cs

* Update PythonMigrationViewExtension.csproj

* Update PythonMigrationViewExtension.csproj

* comment updates

* Revert "comment updates"

This reverts commit 2d2332a.

* comment updates

* Update PythonMigrationAssistantViewModel.cs

* comment updates 2

* small clean ups

* Update PythonMigrationAssistantViewModel.cs

* add 2to3 icon

* comment updates

* GraphPythonDependencies changes

* make event internal

* fix build failure

* update license files, MigrationAssitantClicked event and PythonMigrationAssistantTests

* clean up

* clean up

* update licence files

* make MigrateCode internal

* comments update

* unsubscribe from ScriptEditorWindow closed

* Add 'Before' and 'After' properties (for some reason they where gone)

* refactor internal methods to bail early

* rename IronPython dependency method

* switch custom node python deps eval to short-circuit and add xml comment

* rename & move CPython deps method around

* prep support for handling dyn and dyf in migration backup

* handle dyf vs dyn difference in migration backup

events were not properly getting triggered when opening custom nodes either, fixed that too

* notify user that a backup file is created on Python migration

* fix tests

test project was unloaded

* move CustomNodeItem class as private to the warning dialog that needs it

* mark the PythonNode script setter for migration as Obsolet

this is so it raises warnings in the compiler and that anyone using this will know not to depend on a temporary feature

* change migration assistant viewmodel to depend on workspace and pathmanager not DynamoViewModel

* DYN-2990 address accessing null reference

fixes DYN-2990

* remove prism reference

* add note to obsolete MigrateCode method

* move migration assistant viewmodel to its namesake namespace

* make GraphPythonDependencies depend on interfaces instead of general ViewLoadedParams

* revert graph python dependency evaluation logic to not be short-circuited

this is because the dependency map dictionary is used in the UI warnings modal

* update comment

* fix botched namespace change

* move 'More info' button on script editor window

* comment updates + add automated test for backup functionality

* Update migrate_2to3.py

* Update PythonMigrationAssistantViewModel.cs

Co-authored-by: Radu Gidei <[email protected]>
SHKnudsen added a commit that referenced this pull request Aug 5, 2020
… scrollviewers (DynamoDS#10932)

* T1.1 Code Migration (#4)

* add ScriptMigrator

* Add visual difference viewer

* Update PythonMigrationViewExtension.cs

* Add tooltip description to migration assistant

* updates

* comment updates

* comment updates

* Update PythonMigrationViewExtension.csproj

* T1.2 accept/reject code changes (#5)

* add ScriptMigrator

* Add visual difference viewer

* Added methods for updating the ScriptEditors with the migrated code

* Update PythonMigrationViewExtension.cs

* Add tooltip description to migration assistant

* updates

* comment updates

* comment updates

* Update ScriptEditorWindow.xaml.cs

* Update PythonMigrationViewExtension.csproj

* Update PythonMigrationViewExtension.csproj

* comment updates

* Revert "comment updates"

This reverts commit 2d2332a.

* comment updates

* Update PythonMigrationAssistantViewModel.cs

* comment updates 2

* update engine version when migrating code

* extension and test updates

* T1.3 save python2 backup file on migration (#6)

* add ScriptMigrator

* Add visual difference viewer

* Added methods for updating the ScriptEditors with the migrated code

* Update PythonMigrationViewExtension.cs

* add mechanisme to save Python 2 backup

* Add tooltip description to migration assistant

* updates

* comment updates

* comment updates

* Update ScriptEditorWindow.xaml.cs

* Update PythonMigrationViewExtension.csproj

* Update PythonMigrationViewExtension.csproj

* comment updates

* Revert "comment updates"

This reverts commit 2d2332a.

* comment updates

* Update PythonMigrationAssistantViewModel.cs

* comment updates 2

* small clean ups

* Update PythonMigrationAssistantViewModel.cs

* add 2to3 icon

* comment updates

* GraphPythonDependencies changes

* make event internal

* fix build failure

* update license files, MigrationAssitantClicked event and PythonMigrationAssistantTests

* clean up

* clean up

* update licence files

* make MigrateCode internal

* comments update

* unsubscribe from ScriptEditorWindow closed

* Add 'Before' and 'After' properties (for some reason they where gone)

* Modify the VisualDifferenceViewer so text wraps instead of using scroll viewers

* remove diffplex.wpf reference

* refactor internal methods to bail early

* rename IronPython dependency method

* switch custom node python deps eval to short-circuit and add xml comment

* rename & move CPython deps method around

* prep support for handling dyn and dyf in migration backup

* handle dyf vs dyn difference in migration backup

events were not properly getting triggered when opening custom nodes either, fixed that too

* notify user that a backup file is created on Python migration

* fix tests

test project was unloaded

* move CustomNodeItem class as private to the warning dialog that needs it

* mark the PythonNode script setter for migration as Obsolet

this is so it raises warnings in the compiler and that anyone using this will know not to depend on a temporary feature

* change migration assistant viewmodel to depend on workspace and pathmanager not DynamoViewModel

* DYN-2990 address accessing null reference

fixes DYN-2990

* remove prism reference

* add note to obsolete MigrateCode method

* move migration assistant viewmodel to its namesake namespace

* make GraphPythonDependencies depend on interfaces instead of general ViewLoadedParams

* revert graph python dependency evaluation logic to not be short-circuited

this is because the dependency map dictionary is used in the UI warnings modal

* update comment

* fix botched namespace change

* parametrise the differ window initial width

* Modify the VisualDifferenceViewer so text wraps instead of using scroll viewers

* remove diffplex.wpf reference

* Python.NET binaries update (PR9) (DynamoDS#10945)

* Improve namespace listing using CPython3 engine (DynamoDS#10950)

Namespace listing using dir would only provide non meaningful results
using the CPython3 engine. This is now fixed by preloading names by
default globally.

* parametrise the differ window initial width

* resolve conflict between the 2 python migration viewmodels

* adjust initial window widths to keep text same wrapping

also allow for slightly larger vertical height for Before/After label as it was hard to spot

* update diff colours to Dynamo pallette

* update splitter colour in side diff layout to be black

* upgrade the inline display mode to also show fragments

* update sizing of diff viewer

* Update PythonMigrationViewExtensionTests.cs

Co-authored-by: Radu Gidei <[email protected]>
Co-authored-by: Martin Misol Monzo <[email protected]>
SHKnudsen added a commit that referenced this pull request Aug 10, 2020
* T1.1 Code Migration (#4)

* add ScriptMigrator

* Add visual difference viewer

* Update PythonMigrationViewExtension.cs

* Add tooltip description to migration assistant

* updates

* comment updates

* comment updates

* Update PythonMigrationViewExtension.csproj

* T1.2 accept/reject code changes (#5)

* add ScriptMigrator

* Add visual difference viewer

* Added methods for updating the ScriptEditors with the migrated code

* Update PythonMigrationViewExtension.cs

* Add tooltip description to migration assistant

* updates

* comment updates

* comment updates

* Update ScriptEditorWindow.xaml.cs

* Update PythonMigrationViewExtension.csproj

* Update PythonMigrationViewExtension.csproj

* comment updates

* Revert "comment updates"

This reverts commit 2d2332a.

* comment updates

* Update PythonMigrationAssistantViewModel.cs

* comment updates 2

* update engine version when migrating code

* extension and test updates

* T1.3 save python2 backup file on migration (#6)

* add ScriptMigrator

* Add visual difference viewer

* Added methods for updating the ScriptEditors with the migrated code

* Update PythonMigrationViewExtension.cs

* add mechanisme to save Python 2 backup

* Add tooltip description to migration assistant

* updates

* comment updates

* comment updates

* Update ScriptEditorWindow.xaml.cs

* Update PythonMigrationViewExtension.csproj

* Update PythonMigrationViewExtension.csproj

* comment updates

* Revert "comment updates"

This reverts commit 2d2332a.

* comment updates

* Update PythonMigrationAssistantViewModel.cs

* comment updates 2

* small clean ups

* Update PythonMigrationAssistantViewModel.cs

* add 2to3 icon

* comment updates

* GraphPythonDependencies changes

* make event internal

* fix build failure

* update license files, MigrationAssitantClicked event and PythonMigrationAssistantTests

* clean up

* clean up

* update licence files

* make MigrateCode internal

* comments update

* unsubscribe from ScriptEditorWindow closed

* Add 'Before' and 'After' properties (for some reason they where gone)

* Modify the VisualDifferenceViewer so text wraps instead of using scroll viewers

* remove diffplex.wpf reference

* Migration assistant warning dialog

* refactor internal methods to bail early

* rename IronPython dependency method

* switch custom node python deps eval to short-circuit and add xml comment

* rename & move CPython deps method around

* prep support for handling dyn and dyf in migration backup

* handle dyf vs dyn difference in migration backup

events were not properly getting triggered when opening custom nodes either, fixed that too

* notify user that a backup file is created on Python migration

* fix tests

test project was unloaded

* move CustomNodeItem class as private to the warning dialog that needs it

* mark the PythonNode script setter for migration as Obsolet

this is so it raises warnings in the compiler and that anyone using this will know not to depend on a temporary feature

* change migration assistant viewmodel to depend on workspace and pathmanager not DynamoViewModel

* DYN-2990 address accessing null reference

fixes DYN-2990

* remove prism reference

* add note to obsolete MigrateCode method

* move migration assistant viewmodel to its namesake namespace

* make GraphPythonDependencies depend on interfaces instead of general ViewLoadedParams

* revert graph python dependency evaluation logic to not be short-circuited

this is because the dependency map dictionary is used in the UI warnings modal

* update comment

* fix botched namespace change

* parametrise the differ window initial width

* Modify the VisualDifferenceViewer so text wraps instead of using scroll viewers

* remove diffplex.wpf reference

* Python.NET binaries update (PR9) (DynamoDS#10945)

* Improve namespace listing using CPython3 engine (DynamoDS#10950)

Namespace listing using dir would only provide non meaningful results
using the CPython3 engine. This is now fixed by preloading names by
default globally.

* parametrise the differ window initial width

* resolve conflict between the 2 python migration viewmodels

* adjust initial window widths to keep text same wrapping

also allow for slightly larger vertical height for Before/After label as it was hard to spot

* update diff colours to Dynamo pallette

* update splitter colour in side diff layout to be black

* upgrade the inline display mode to also show fragments

* update sizing of diff viewer

* update warning dialog

* migration assistant warning save setting

* Update PythonMigrationAssistantViewModel.cs

* add dynamo version to file path

* comment updates

* only create warning dismiss file if accepted

* comments updates 2

* Update PythonMigrationViewExtension.csproj

* Update PythonMigrationAssistantViewModel.cs

* add is test mode to legal message

* comment updates

* comment updates 2

* update migration assistant disclaimer window title

Co-authored-by: Radu Gidei <[email protected]>
Co-authored-by: Martin Misol Monzo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants