Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kaste/kissreloader
Almost Hot Reloader
https://github.com/kaste/kissreloader
sublime-text
Last synced: 10 days ago
JSON representation
Almost Hot Reloader
- Host: GitHub
- URL: https://github.com/kaste/kissreloader
- Owner: kaste
- License: mit
- Created: 2024-03-08T10:14:10.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-03-12T11:20:06.000Z (11 months ago)
- Last Synced: 2024-11-18T13:35:08.320Z (2 months ago)
- Topics: sublime-text
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# KissReloader
The plugin packages a new simplified reloader, originally invented by [@deathaxe](https://github.com/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.:
```json5
{
"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 gets an update. Just add this to your plugin:```python
import sys# kiss-reloader:
prefix = __package__ + "." # 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.