add bundle identifier to uri handler
This commit is contained in:
parent
2d07223995
commit
b3cf5e8698
2 changed files with 14 additions and 5 deletions
|
@ -1,16 +1,24 @@
|
|||
import os
|
||||
import json
|
||||
import webbrowser
|
||||
import sys
|
||||
from time import sleep
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from time import sleep
|
||||
from jsonrpc.proxy import JSONRPCProxy
|
||||
|
||||
API_CONNECTION_STRING = "http://localhost:5279/lbryapi"
|
||||
UI_ADDRESS = "http://localhost:5279"
|
||||
|
||||
|
||||
class Timeout(Exception):
|
||||
def __init__(self, value):
|
||||
self.parameter = value
|
||||
|
||||
def __str__(self):
|
||||
return repr(self.parameter)
|
||||
|
||||
|
||||
class LBRYURIHandler(object):
|
||||
def __init__(self):
|
||||
self.started_daemon = False
|
||||
|
@ -28,18 +36,18 @@ class LBRYURIHandler(object):
|
|||
elif status:
|
||||
return True
|
||||
else:
|
||||
exit(1)
|
||||
raise Timeout("LBRY daemon is running, but connection timed out")
|
||||
except:
|
||||
if self.start_timeout < 30:
|
||||
sleep(1)
|
||||
self.start_timeout += 1
|
||||
self.check_status()
|
||||
else:
|
||||
exit(1)
|
||||
raise Timeout("Timed out trying to start LBRY daemon")
|
||||
|
||||
def handle(self, lbry_name):
|
||||
lbry_process = [d for d in subprocess.Popen(['ps','aux'], stdout=subprocess.PIPE).stdout.readlines()
|
||||
if 'LBRY.app' in d]
|
||||
if 'LBRY.app' in d and 'LBRYURIHandler' not in d]
|
||||
try:
|
||||
status = json.loads(self.daemon.is_running())['result']
|
||||
except:
|
||||
|
|
|
@ -7,6 +7,7 @@ OPTIONS = {'argv_emulation': True,
|
|||
'packages': ['jsonrpc'],
|
||||
'plist': {
|
||||
'LSUIElement': True,
|
||||
'CFBundleIdentifier': 'io.lbry.LBRYURIHandler',
|
||||
'CFBundleURLTypes': [
|
||||
{
|
||||
'CFBundleURLTypes': 'LBRYURIHandler',
|
||||
|
|
Loading…
Add table
Reference in a new issue