Skip to content

Commit

Permalink
fix: Get OS dependent temp dir and ensure js files are installed (#9)
Browse files Browse the repository at this point in the history
Signed-off-by: Tony Paulussen <[email protected]>
Co-authored-by: Christian Henkel <[email protected]>
  • Loading branch information
tony-p and ct2034 authored Dec 5, 2023
1 parent c1b4489 commit 16f0acd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions bt_live/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
name=package_name,
version='1.0.0',
packages=[package_name, package_name_django],
package_data={'': ['*.js']},
include_package_data=True,
package_dir={
package_name:
os.path.join(
Expand Down
3 changes: 2 additions & 1 deletion bt_live/src/bt_live/ros_node.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import tempfile

from bt_view.bt_view import COLORS_PER_RETURN_STATE, draw_pygraphviz

Expand Down Expand Up @@ -66,7 +67,7 @@ def __init__(self, args=None):
if not os.path.exists(self.fbl_file):
raise FileNotFoundError(
f'File under path fbl_file={self.fbl_file} does not exist.')
self.img_path = os.path.join('/tmp', 'bt_trace')
self.img_path = os.path.join(tempfile.gettempdir(), 'bt_trace')
self.get_logger().info(f'{self.img_path=}')

self.g = fbl_to_networkx(self.fbl_file)
Expand Down
3 changes: 2 additions & 1 deletion bt_view/src/bt_view/bt_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from hashlib import sha256
from math import log
import os
import tempfile
from typing import Dict, List, Optional, Union

from btlib import VALUE_MAP
Expand All @@ -33,7 +34,7 @@
HEIGHT = 1080

BG_IMG_FOLDER = os.path.join(
'/tmp',
tempfile.gettempdir(),
'bt_imgs')
NODE_WIDTH_IN = 2.5
NODE_HEIGHT_IN = 0.8
Expand Down

0 comments on commit 16f0acd

Please sign in to comment.