Workaround for winrt not importing in debug
This commit is contained in:
		
							parent
							
								
									d5b1d50105
								
							
						
					
					
						commit
						3faeb5d6aa
					
				| @ -1,5 +1,10 @@ | ||||
| import asyncio | ||||
| DEBUG=False | ||||
| try: | ||||
| from  winrt.windows.media.control import GlobalSystemMediaTransportControlsSessionManager as MediaManager | ||||
| except: | ||||
|     print("DEBUG; winrt disabled") | ||||
|     DEBUG = True | ||||
| import win32com.client | ||||
| import pythoncom | ||||
| import time | ||||
| @ -50,6 +55,7 @@ class PhoneLineEventHandler(): | ||||
| 
 | ||||
| async def try_play(): | ||||
|     print("try_play") | ||||
|     if not DEBUG: | ||||
|     sessions = await MediaManager.request_async() | ||||
|     current_session = sessions.get_current_session() | ||||
|     if current_session: | ||||
| @ -57,6 +63,7 @@ async def try_play(): | ||||
| 
 | ||||
| async def try_pause(): | ||||
|     print("try_pause") | ||||
|     if not DEBUG: | ||||
|     sessions = await MediaManager.request_async() | ||||
|     current_session = sessions.get_current_session() | ||||
|     if current_session: | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user