-
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.
Introduce nREPL control panel add on
- Loading branch information
Showing
6 changed files
with
117 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
from basilisp_blender import control_panel_create | ||
bl_info = { | ||
"name" : "Basilisp Blender Add On", | ||
"author" : "ikappaki", | ||
"version" : (0, 99, 99), | ||
"blender" : (3, 60, 0), | ||
"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") | ||
|
||
if __name__ == '__main__': | ||
# This script should be invoked from the project root directory. | ||
# | ||
# Copies the contents of this file up to, but not including, the | ||
# __main__ section to 'dist/nrepl_panel_addon_<version>.py'. | ||
# Replaces the bl_info.version above with the major.minor.patch | ||
# <version> numbers as reported by `poetry version`. | ||
re = __import__("re") | ||
subprocess = __import__("subprocess") | ||
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()) | ||
filename_dist = f'dist/nrepl_panel_addon_{version.strip().replace(".", "_")}.py' | ||
version_mark = "(0, 99, 99)" | ||
with open(__file__, 'r') as src: | ||
with open(filename_dist, 'w', newline="\n") as dst: | ||
dst.write(f"# Autogenerated from {__file__}\n") | ||
for line in src.readlines(): | ||
if line.strip().startswith("if __name__ == '__main__':"): | ||
break | ||
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 {filename_dist}") |
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