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
PR fixes #3545: Allow Leo to import any kind of file on the command line #3645
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
@tbpassin This PR passes various hand tests. From the
|
This comment was marked as outdated.
This comment was marked as outdated.
Yes, the old way always bothered me, especially since the Import Any File command already existed. |
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see anything to remark on. Of course it depends on what loadLocalFile()
does, which is apparently hardly changed for the PR, and I'm going to assume it will import non-Leo files according to their file type.
This comment was marked as outdated.
This comment was marked as outdated.
@tbpassin Thomas, please review the summary of API changes in the first comment of this PR. Does it look good to you? |
I didn't notice anything else. I can't speak to the completeness of the listed changes, of course. Thanks for addressing backwards compatibility! |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow ! what a cleanup! :) I'l make sure to bring all those changes to leojs after the alpha launch in one go with all the changes since 6.7.5.
@boltex Thanks for your review. The cleanup was long overdue. Glad you approve. |
See #3546. Allow Leo to import any number of external (neither
.leo
,.db,
nor.leojs
) files from the command line.This PR refactors and simplifies the code the reads files. This PR should help simplify leoJS.
All plugins and scripts (including Leo's core) should call
g.openWithFileName
instead of calling methods of theLoadManager
class.This refactoring may have slight impacts on existing scripts and plugins:
Changes to Leo's API
This PR deletes several publicly visible helpers of the
LoadManager
class.There is a slight possibility that existing scripts or plugins may be using those deleted helpers.
In all such cases, the fix is to use
g.openWithFileName
instead.Leo's core now uses
g.openWithFileName
to open files of any type.Changes to the
LoadManager
classlm.openFileByName
, an internal helper forlm.loadLocalFile
:lm.initWrapperLeoFile
withlm.openExternalFile
:fn
arg to the the signature oflm.openEmptyLeoFile
:Other changes
c.createNodeFromExternalFile
, another helper forlm.openFileByName
.k.givenArgs
ivar.leoVim.py
referencedk.givenArgs
, but only in disabled code.c.wrappedFileName
ivar.efc.openOutlineByName
method.Tasks
--load-type
command-line option, adding it to the list of obsolete options.load_sessions
.LM.initWrapperLeoFile
: setc.p
after creating an@file node
.LM.loadLocalFile
.open-outline
toopen-file
(in the menu), retraining the old name for compatibility.c.k.givenArgs
in theopen-file
logic.g.openWithFileName
the common helper for all open-related logic..leo
files tountitled
so the wrapper files are not written unless the user agrees.lm.openWithFileName
and its helpers.lm.finishOpen
in all helpers oflm.openWithFileName
.