added debugging feature; fixed dnd problem, cleaning

This commit is contained in:
itdominator 2023-04-30 18:43:12 -05:00
parent 33cde33e6f
commit 3a6f0f7478
4 changed files with 33 additions and 7 deletions

View File

@ -149,13 +149,17 @@ class WindowMixin(TabMixin):
path_at_loc = None path_at_loc = None
try: try:
path_at_loc = icons_grid.get_item_at_pos(x, y)[0] data = icons_grid.get_dest_item_at_pos(x, y)
path_at_loc = data[0]
drop_position = data[1]
highlighted_item_path = icons_grid.get_drag_dest_item().path highlighted_item_path = icons_grid.get_drag_dest_item().path
if path_at_loc and path_at_loc == highlighted_item_path: if path_at_loc and path_at_loc == highlighted_item_path and drop_position == Gtk.IconViewDropPosition.DROP_INTO:
uri = self.format_to_uris(store, wid, tid, highlighted_item_path)[0].replace("file://", "") uri = self.format_to_uris(store, wid, tid, highlighted_item_path)[0].replace("file://", "")
self.override_drop_dest = uri if isdir(uri) else None self.override_drop_dest = uri if isdir(uri) else None
else:
self.override_drop_dest = None
except Exception as e: except Exception as e:
... self.override_drop_dest = None
if target not in current: if target not in current:
self.fm_controller.set_wid_and_tid(wid, tid) self.fm_controller.set_wid_and_tid(wid, tid)

View File

@ -144,13 +144,17 @@ class WindowMixin(TabMixin):
path_at_loc = None path_at_loc = None
try: try:
path_at_loc = icons_grid.get_item_at_pos(x, y)[0] data = icons_grid.get_dest_item_at_pos(x, y)
path_at_loc = data[0]
drop_position = data[1]
highlighted_item_path = icons_grid.get_drag_dest_item().path highlighted_item_path = icons_grid.get_drag_dest_item().path
if path_at_loc and path_at_loc == highlighted_item_path: if path_at_loc and path_at_loc == highlighted_item_path and drop_position == Gtk.IconViewDropPosition.DROP_INTO:
uri = self.format_to_uris(store, wid, tid, highlighted_item_path)[0].replace("file://", "") uri = self.format_to_uris(store, wid, tid, highlighted_item_path)[0].replace("file://", "")
self.override_drop_dest = uri if isdir(uri) else None self.override_drop_dest = uri if isdir(uri) else None
else:
self.override_drop_dest = None
except Exception as e: except Exception as e:
... self.override_drop_dest = None
if target not in current: if target not in current:
self.fm_controller.set_wid_and_tid(wid, tid) self.fm_controller.set_wid_and_tid(wid, tid)

View File

@ -19,12 +19,29 @@ def debug_signal_handler(signal, frame):
rpdb2.setbreak(depth=1) rpdb2.setbreak(depth=1)
return return
except StandardError: except StandardError:
pass ...
try: try:
from rfoo.utils import rconsole from rfoo.utils import rconsole
logger.debug("\n\nStarting embedded rconsole debugger...\n\n") logger.debug("\n\nStarting embedded rconsole debugger...\n\n")
rconsole.spawn_server() rconsole.spawn_server()
return
except StandardError as ex:
...
try:
from pudb import set_trace
logger.debug("\n\nStarting PuDB debugger...\n\n")
set_trace(paused = True)
return
except StandardError as ex:
...
try:
import pdb
logger.debug("\n\nStarting embedded PDB debugger...\n\n")
pdb.Pdb(skip=['gi.*']).set_trace()
return
except StandardError as ex: except StandardError as ex:
... ...

View File

@ -41,6 +41,7 @@ class StartCheckMixin:
def _write_new_pid(self): def _write_new_pid(self):
pid = os.getpid() pid = os.getpid()
self._write_pid(pid) self._write_pid(pid)
print(f"{app_name} PID: {pid}")
def _clean_pid(self): def _clean_pid(self):
os.unlink(self._PID_FILE) os.unlink(self._PID_FILE)