Skip to content

Commit

Permalink
Moving modules into addon directory. Fixes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaskelly committed Mar 16, 2019
1 parent 68e2fa1 commit 25ed76a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
5 changes: 4 additions & 1 deletion io_scene_bsp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
bl_info = {
'name': 'Quake engine BSP format',
'author': 'Joshua Skelton',
'version': (1, 0, 1),
'version': (1, 0, 2),
'blender': (2, 80, 0),
'location': 'File > Import-Export',
'description': 'Load a Quake engine BSP file.',
Expand All @@ -23,6 +23,9 @@


def register():
from .patch import ensure_modules_dir_on_path
ensure_modules_dir_on_path()

from .operators import register
register()

Expand Down
11 changes: 11 additions & 0 deletions io_scene_bsp/patch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import os
import sys

def ensure_modules_dir_on_path():
modules_dir = os.path.join(os.path.dirname(__file__), 'modules')
modules_dir = os.path.abspath(modules_dir)

if not modules_dir in sys.path:
sys.path.append(modules_dir)

print(sys.path)
2 changes: 1 addition & 1 deletion package.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def run():
pass

zip_entries = gather_files('io_scene_bsp')
zip_entries += gather_files(os.path.dirname(vgio.__file__), 'modules')
zip_entries += gather_files(os.path.dirname(vgio.__file__), 'io_scene_bsp\modules')

filename = f'io_scene_bsp-{io_scene_bsp.__version__}.zip'
filepath = os.path.abspath(os.path.join('dist', filename))
Expand Down

0 comments on commit 25ed76a

Please sign in to comment.