Skip to content

kaste/KissReloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KissReloader

The plugin packages a new simplified reloader, originally invented by @deathaxe.

Choose kiss-reload: Reload Current Package from the Command Palette to reload the plugin you're currently looking at.

There is also an ApplicationCommand to reload a specific package at will, e.g.:

    {
        "command": "kiss_reloader_reload",
        "args": {"package_name": "GitSavvy"}
    },

Add the reloader to your package

You may want to add reloader code to your main/root plugin so it actually reloads automatically if Package Control pushes an update. Just add this to your plugin:

import sys

# kiss-reloader:
prefix = __spec__.parent + "."  # don't clear the base package
for module_name in [
    module_name
    for module_name in sys.modules
    if module_name.startswith(prefix) and module_name != __name__
]:
    del sys.modules[module_name]

KissReloader will watch out for the conventional "# kiss-reloader:" comment and prevent a double reload.

Note: __spec__.parent is formerly known as __package__

About

Almost Hot Reloader

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages