cytoscape / RCy3

New version of RCy3, redesigned and collaboratively maintained by Cytoscape developer community
MIT License
50 stars 20 forks source link

Add overwrite_file= parameters to export functions #122

Closed bdemchak closed 3 years ago

bdemchak commented 3 years ago

To enable workflow writers to guarantee that Cytoscape won't pop a "Do you want to overwrite ..." message box, an overwrite_file= parameter was added to each export function. The default value of the parameter depends on the current default behavior of the particular export function. This is necessary to preserve whatever behavior the function currently has. The functions are:

These changes have been applied to py4cytoscape already ... note that the overwrite_file= parameter was added to the end of the parameter lists so as to not invalidate any existing code that passes positional parameters. The "*, overwrite_file=" syntax in Python indicates that the overwrite_file= parameter must be named and cannot be used positionally. This enables it to be used without invalidating any code that uses positional parameters.

AlexanderPico commented 3 years ago

@yihangx Go ahead and add this parameter and corresponding sandboxRemoveFile to these functions when you implement sandboxing in general.

See example of sandbox_remove_file in py4cy here: https://github.com/cytoscape/py4cytoscape/blob/master/py4cytoscape/networks.py#L356

AlexanderPico commented 3 years ago

@yihangx Please update (or close) this issue

yihangx commented 3 years ago

Added in RCy3.

AlexanderPico commented 3 years ago

Causes bug when running locally. RCy3 attempts to use file transfer when it should not.

yihangx commented 3 years ago

Fixed.

AlexanderPico commented 3 years ago

Fixed .sandboxOp and this will fix all cases where sandboxGetFileInfo, which includes all the export functions:

yihangx commented 3 years ago

Correct. Bug in the .sandboxOp function caused errors for all export related functions. It will fix all cases.