Skip to content

Feature Request: pyscript.reload to support new files. #106

Closed
@dlashua

Description

@dlashua

Currently, calling pyscript.reload with a global_ctx= set to a newly created file results in an error indicating the global context cannot be found, which makes sense because a full reload hasn't happened yet so that global context has never been loaded, and, therefore, can't be reloaded.

For deleted files, pyscript.reload works just fine. The global_ctx is unloaded and, since the file no longer exists, is not reloaded.

It would be great if reload could look for the new file and cause it to load. Optionally, pyscript.load could be used instead to establish a difference between a new file and a reload. Though, if this happens, I suggest that reload does not work on deleted files and a pyscript.unload gets added.

This is a nice stepping stone to having full autoREload support in pyscript since this functionality will be needed for that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions