forked from nadir/adobe-rpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhandler.py
30 lines (22 loc) · 1.02 KB
/
handler.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import sys
def get_rpc_update():
if sys.platform in ['Windows', 'win32', 'cygwin']:
try:
from api.windows import get_title, get_process_info, get_status
app_info = get_process_info()
app_title = get_title(app_info['pid'])
app_state = get_status(app_info, app_title)
rpc_update = {'state': app_state,
'small_image': app_info['smallImageKey'],
'large_image': app_info['largeImageKey'],
'large_text': app_info['largeText'],
'small_text': app_info['smallText'],
'details': app_info['largeText']}
return rpc_update
except ImportError:
print("Make sure you have pywin32 installed, for more info read README.md")
elif sys.platform in ['Mac', 'darwin', 'os2', 'os2emx']:
print("Macos support is currently not available.")
sys.exit(0)
def exception_handler(exception, future):
print("")