jotpluggler: fix layout folder path loading and total segment (#36151)

* forgot to commit this earlier with total segments

* look in correct directory
pull/36152/head
Jimmy 4 days ago committed by GitHub
parent c812c3192d
commit f18828228a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      tools/jotpluggler/data.py
  2. 9
      tools/jotpluggler/pluggle.py

@ -314,6 +314,12 @@ class DataManager:
cloudlog.warning(f"Warning: No log segments found for route: {route}")
return
total_segments = len(lr.logreader_identifiers)
with self._lock:
observers = self._observers.copy()
for callback in observers:
callback({'metadata_loaded': True, 'total_segments': total_segments})
num_processes = max(1, multiprocessing.cpu_count() // 2)
with multiprocessing.Pool(processes=num_processes) as pool, tqdm(total=len(lr.logreader_identifiers), desc="Processing Segments") as pbar:
for segment_result, start_time, end_time in pool.imap(_process_segment, lr.logreader_identifiers):

@ -199,9 +199,8 @@ class MainController:
if dpg.does_item_exist("save_layout_dialog"):
dpg.delete_item("save_layout_dialog")
with dpg.file_dialog(
directory_selector=False, show=True, callback=self._save_layout_callback,
tag="save_layout_dialog", width=int(700 * self.scale), height=int(400 * self.scale),
default_filename="layout", default_path="layouts"
callback=self._save_layout_callback, tag="save_layout_dialog", width=int(700 * self.scale), height=int(400 * self.scale),
default_filename="layout", default_path=os.path.join(os.path.dirname(os.path.realpath(__file__)), "layouts")
):
dpg.add_file_extension(".yaml")
@ -209,8 +208,8 @@ class MainController:
if dpg.does_item_exist("load_layout_dialog"):
dpg.delete_item("load_layout_dialog")
with dpg.file_dialog(
directory_selector=False, show=True, callback=self._load_layout_callback,
tag="load_layout_dialog", width=int(700 * self.scale), height=int(400 * self.scale), default_path="layouts"
callback=self._load_layout_callback, tag="load_layout_dialog", width=int(700 * self.scale), height=int(400 * self.scale),
default_path=os.path.join(os.path.dirname(os.path.realpath(__file__)), "layouts")
):
dpg.add_file_extension(".yaml")

Loading…
Cancel
Save