-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from ikappaki/feature/addon
Introduce nREPL control panel add on
- Loading branch information
Showing
10 changed files
with
135 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# This script should be invoked from the project root directory. | ||
# | ||
# Copies the nrepl_panel_addon.py file to dist adding the version | ||
# number as retrieved from `poetry version`. | ||
import re | ||
import subprocess | ||
|
||
src_path = "src/dev/nrepl_panel_addon.py" | ||
version_mark = "(0, 99, 99)" | ||
|
||
result = subprocess.run(["poetry", "version"], capture_output=True, text=True) | ||
_, version = result.stdout.split(" ") | ||
major, minor, patch = version.split(".") | ||
patch_int = int(re.match(r'^\d+', patch).group()) | ||
|
||
dist_path = f'dist/nrepl_panel_addon_{version.strip().replace(".", "_")}.py' | ||
|
||
with open(src_path, 'r') as src: | ||
with open(dist_path, 'w', newline="\n") as dst: | ||
dst.write(f"# Autogenerated from {src_path}\n") | ||
for line in src.readlines(): | ||
if version_mark in line: | ||
line = line.replace(version_mark, f"({major}, {minor}, {patch_int})") | ||
dst.write(line) | ||
print(f":bb_addon_create.py :created {dist_path}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from basilisp_blender import control_panel_create | ||
bl_info = { | ||
"name" : "Basilisp nREPL Server Control Panel", | ||
"description" : "Control the nREPL server from the Properties Editor>Output panel", | ||
"author" : "ikappaki", | ||
"version" : (0, 99, 99), | ||
"blender" : (3, 60, 0), | ||
"location": "Properties Editor>Output", | ||
"doc_url" : "https://github.com/ikappaki/basilisp-blender", | ||
"category": "Development", | ||
} | ||
_DESTROY_FN = None | ||
def register(): | ||
global _DESTROY_FN | ||
print(f"nREPL Control Panel creating...") | ||
_DESTROY_FN = control_panel_create() | ||
print(f"nREPL Control Panel creating... done") | ||
|
||
def unregister(): | ||
global _DESTROY_FN | ||
print("nREPL Control Panel destroying...") | ||
_DESTROY_FN() | ||
_DESTROY_FN = None | ||
print("nREPL Control Panel destroying... done") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters