Skip to content

Conversation

@midichef
Copy link
Contributor

@midichef midichef commented Jul 2, 2025

I'm trying to allow sysedit-cell (^O) to edit cells as binary, if they contain unprintable values.

It'd be useful to allow me to save binary content, such as PNG files that are cells in SQLite database sheet, by opening the cell in an editor for saving.

But I'm not sure about how to properly get the data in a way that handles all the possible kinds of cells. Right now this draft PR uses str(sheet.cursorValue). What's the proper way to do it?

cv = str(sheet.cursorValue)
edit = vd.launchExternalEditor(bytes(cv, encoding=sheet.options.encoding), binary=True)

@midichef
Copy link
Contributor Author

midichef commented Dec 9, 2025

@saulpw I'm pinging you to make my question easier to notice: How should I process a cell to extract its contents as an unformatted Python value, then convert it to a string for external processing outside Python?

@saulpw
Copy link
Owner

saulpw commented Dec 10, 2025

Thanks for the ping, sorry I missed this (I skipped "Drafts" in this recent set of reviews).

This is tricky to do in the general case. Maybe use cursorTypedValue and then change launchExternalEditor to do something different in the bytes case, and let it stringify everything else?

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.

2 participants