diff options
author | TinWoodman92 <chrhodgden@gmail.com> | 2023-07-05 21:27:06 -0500 |
---|---|---|
committer | TinWoodman92 <chrhodgden@gmail.com> | 2023-07-05 21:27:06 -0500 |
commit | 52a7507c21f803e3ebbe984439715d0619c6aa9f (patch) | |
tree | cab1ffebce94359c96e6ba8e71fd7840f030c9c4 /dialoguer | |
parent | 731177ac3b8b3ac78958ca5b90b41ccd652727c0 (diff) |
Updated dialoguer package to handle full paths on init.
Diffstat (limited to 'dialoguer')
-rw-r--r-- | dialoguer/__init__.py | 8 | ||||
-rw-r--r-- | dialoguer/binary_conversion.py | 2 | ||||
-rw-r--r-- | dialoguer/context_script.r | 1 |
3 files changed, 9 insertions, 2 deletions
diff --git a/dialoguer/__init__.py b/dialoguer/__init__.py index 5219dde..1b9cb8d 100644 --- a/dialoguer/__init__.py +++ b/dialoguer/__init__.py @@ -19,8 +19,11 @@ server.bind(ADDR) # then the dialogue class launches and connects and loops class Dialogue: def __init__(self, file_name, wait = True): - self.file_name = file_name - self.file_path = os.path.join(os.getcwd(), file_name) + self.file_name = os.path.basename(file_name) + if bool(os.path.dirname(file_name)): + self.file_path = file_name + else: + self.file_path = os.path.join(os.getcwd(), file_name) self.ext = file_name.split('.')[-1] self.uuid = str(uuid.uuid4()) self.conn = None @@ -78,6 +81,7 @@ class Dialogue: data_type_name = self.conn.recv(HEADER) data_type_name = bin_conv(data_type_name, str) data_type = data_type_dict[data_type_name] + self.send(True) else: data_type = set_data_type diff --git a/dialoguer/binary_conversion.py b/dialoguer/binary_conversion.py index 741a5d7..9fd250f 100644 --- a/dialoguer/binary_conversion.py +++ b/dialoguer/binary_conversion.py @@ -7,6 +7,8 @@ def bin_conv(data, data_type = None): conv_data = bytes(data, 'utf-8') elif type(data) == int and data_type == None: conv_data = data.to_bytes(32, 'little') + elif type(data) == bool and data_type == None: + conv_data = bytes(data) #convert from binary elif type(data) == bytes and data_type == str: diff --git a/dialoguer/context_script.r b/dialoguer/context_script.r index f2a795a..33aacaa 100644 --- a/dialoguer/context_script.r +++ b/dialoguer/context_script.r @@ -30,6 +30,7 @@ send <- function(conn, data, send_data_type = FALSE) { if (send_data_type) { data_type_name <- typeof(data) writeBin(data_type_name, conn) + recv_chk <- recv(conn, set_data_type = 'logical') } writeBin(data, conn) } |