Skip to content

Commit

Permalink
cleanup temp debugging output
Browse files Browse the repository at this point in the history
  • Loading branch information
maltfield committed Jun 16, 2023
1 parent 17e3f21 commit a585f03
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 52 deletions.
2 changes: 1 addition & 1 deletion src/buskill_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
File: buskill_cli.py
Authors: Michael Altfield <[email protected]>
Created: 2020-06-23
Updated: 2023-06-14
Updated: 2023-06-16
Version: 0.3
This is the code to handle the BusKill app via CLI
Expand Down
18 changes: 2 additions & 16 deletions src/buskill_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
File: buskill_gui.py
Authors: Michael Altfield <[email protected]>
Created: 2020-06-23
Updated: 2023-06-14
Updated: 2023-06-16
Version: 0.4
This is the code to launch the BusKill GUI app
Expand Down Expand Up @@ -105,9 +105,6 @@ def __init__(self, **kwargs):
# as soon as we've loaded
Clock.schedule_once(self.handle_upgrades, 1)

# TODO: remove auto-switch to Settings screen
#Clock.schedule_once( lambda dt: self.switchToScreen('settings') )

super(MainWindow, self).__init__(**kwargs)

def on_pre_enter( self, *args ):
Expand Down Expand Up @@ -147,9 +144,7 @@ def toggle_buskill(self):
child.background_color = self.color_red

# check for messages from the usb_handler child process
# TODO: change this back to 0.01 after we're done debugging windows
#Clock.schedule_interval( self.bk.check_usb_handler, 0.01 )
Clock.schedule_interval( self.bk.check_usb_handler, 4 )
Clock.schedule_interval( self.bk.check_usb_handler, 0.01 )

else:
self.toggle_btn.text = 'Arm'
Expand All @@ -166,15 +161,6 @@ def toggle_buskill(self):
# stop checking for messages from the usb_handler child process
Clock.unschedule( self.bk.check_usb_handler )

# TODO: remove me after fixing bug https://github.com/BusKill/buskill-app/issues/73#issuecomment-1592195471
if self.bk.trigger == 'soft-shutdown':
Clock.schedule_interval(self.check_root_child, 10)

# TODO: remove me after fixing bug https://github.com/BusKill/buskill-app/issues/73#issuecomment-1592195471
def check_root_child(self, dt):
msg = "DEBUG: bk.root_child:|" +str(self.bk.root_child)+ "|"
print( msg ); logger.debug( msg )

def switchToScreen( self, screen ):
self.manager.current = screen

Expand Down
36 changes: 1 addition & 35 deletions src/packages/buskill/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Authors: Michael Altfield <[email protected]>
Co-Auth: Steven Johnson <[email protected]>
Created: 2020-06-23
Updated: 2023-06-14
Updated: 2023-06-16
Version: 0.5
This is the heart of the buskill app, shared by both the cli and gui
Expand Down Expand Up @@ -136,16 +136,8 @@ class Notification:

def __init__( self, buskill ):

# TODO: remove debugging lines when windows triggers are fixed
msg = "DEBUG: instantiating Windows Notification object"
print( msg ); logger.debug( msg )

self.bk = buskill

# TODO: remove debugging lines when windows triggers are fixed
msg = "DEBUG: \t self.bk.usb_hander_queue:|" +str(self.bk.usb_handler_queue)+ "|"
print( msg ); logger.debug( msg )

message_map = {
win32con.WM_DEVICECHANGE: self.hotplugCallbackWin
}
Expand Down Expand Up @@ -180,17 +172,12 @@ def hotplugCallbackWin(self, hwnd, message, wparam, lparam):
msg = "DEBUG: called hotplubCallbackWin()"
print( msg ); logger.debug( msg )

# TODO: remove debugging lines when windows triggers are fixed
msg = "DEBUG: \t self.bk.usb_hander_queue:|" +str(self.bk.usb_handler_queue)+ "|"
print( msg ); logger.debug( msg )

dev_broadcast_hdr = DEV_BROADCAST_HDR.from_address(lparam)

if wparam == DBT_DEVICEREMOVECOMPLETE:
msg = "DEBUG: Determined USB hotplug event to be a removal"
print( msg ); logger.debug( msg )

#self.bk.triggerWin()
self.bk.usb_handler_queue.put( 'trigger' )

msg = "hwnd:|" +str(hwnd)+ "|"
Expand Down Expand Up @@ -963,7 +950,6 @@ def toggle(self):
# launch an asynchronous child process that'll loop and listen for
# usb events
self.usb_handler = self.Process(
# self.usb_handler = multiprocessing.Process(
target = self.ARM_FUNCTION
)
self.usb_handler.start()
Expand Down Expand Up @@ -1011,13 +997,6 @@ def hotplugCallbackNix( self, *argv ):

# checks the queue from the child usb_handler process
def check_usb_handler( self, dt ):
# TODO: remove debugging lines when windows triggers are fixed
msg = "DEBUG: called check_usb_handler()"
print( msg ); logger.debug( msg )

# TODO: remove debugging lines when windows triggers are fixed
msg = "DEBUG: \t self.usb_hander_queue:|" +str(self.usb_handler_queue)+ "|"
print( msg ); logger.debug( msg )

# is there a message on the queue?
if not self.usb_handler_queue.empty():
Expand Down Expand Up @@ -1091,9 +1070,6 @@ def armNix( self ):
return 0

def armWin( self ):
# TODO: remove debugging lines when windows triggers are fixed
msg = "DEBUG: called armWin()"
print( msg ); logger.debug( msg )

# are we just simulating this USB removal?
if self.SIMULATE_HOTPLUG_REMOVAL:
Expand All @@ -1115,16 +1091,7 @@ def armWin( self ):

return

# TODO: remove debugging lines when windows triggers are fixed
msg = "DEBUG: pre-instantiate Notification"
print( msg ); logger.debug( msg )

w = Notification( self )

# TODO: remove debugging lines when windows triggers are fixed
msg = "DEBUG: post-instantiate Notification"
print( msg ); logger.debug( msg )

win32gui.PumpMessages()

#####################
Expand Down Expand Up @@ -1741,7 +1708,6 @@ def upgrade_bg(self):
# memory and we can't specify a callback when it finishes.

self.upgrade_process = self.Process(
# self.upgrade_process = multiprocessing.Process(
target = self.upgrade
)
self.upgrade_process.start()
Expand Down

0 comments on commit a585f03

Please sign in to comment.