mirror of
https://github.com/clockworkpi/launcher.git
synced 2025-12-12 09:48:50 +01:00
run.py add CurrentPage.OnAria2CompleteCb
21_Warehouse/__init__.py text correspondence[_FootMsg] Warehouse beta now
This commit is contained in:
parent
9b1c89af4c
commit
ad4a82bad5
@ -927,6 +927,9 @@ class GameStorePage(Page):
|
||||
|
||||
def OnAria2CompleteCb(self,gid):
|
||||
print("OnAria2CompleteCb ", gid)
|
||||
self.SyncList()
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
def raw_github_com(self,_url):#eg: github.com/clockworkpi/warehouse
|
||||
if _url.startswith("github.com")== False:
|
||||
|
||||
@ -23,6 +23,7 @@ import gobject
|
||||
import socket
|
||||
import pygame
|
||||
from sys import exit
|
||||
import json
|
||||
|
||||
#from beeprint import pp
|
||||
########
|
||||
@ -481,7 +482,21 @@ def gobject_pygame_event_timer(main_screen):
|
||||
@misc.threaded
|
||||
def aria2_ws(main_screen):
|
||||
def on_message(ws, message):
|
||||
print(message)
|
||||
print("run.py aria2_ws on_message: ",message)
|
||||
try:
|
||||
aria2_noti = json.loads(message)
|
||||
if "method" in aria2_noti and aria2_noti["method"] == "aria2.onDownloadError":
|
||||
gid = aria2_noti["params"][0]["gid"]
|
||||
|
||||
if "method" in aria2_noti and aria2_noti["method"] == "aria2.onDownloadComplete":
|
||||
gid = aria2_noti["params"][0]["gid"]
|
||||
on_comp_cb = getattr(main_screen._CurrentPage,"OnAria2CompleteCb",None)
|
||||
if on_comp_cb != None:
|
||||
if callable( on_comp_cb ):
|
||||
main_screen._CurrentPage.OnAria2CompleteCb(gid)
|
||||
#game_install_thread(gid)
|
||||
except Exception as ex:
|
||||
print(ex)
|
||||
|
||||
def on_error(ws, error):
|
||||
print(error)
|
||||
@ -490,7 +505,7 @@ def aria2_ws(main_screen):
|
||||
print("### closed ###")
|
||||
|
||||
|
||||
websocket.enableTrace(True)
|
||||
#websocket.enableTrace(True)
|
||||
try:
|
||||
ws = websocket.WebSocketApp("ws://localhost:6800/jsonrpc",
|
||||
on_message = on_message,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user