Fixup for meganz login

Signed-off-by: lzzy12 <jhashivam2020@gmail.com>
This commit is contained in:
lzzy12 2020-06-05 13:15:00 +05:30
parent 8b3805c55a
commit 3217b67df0

View File

@ -11,6 +11,8 @@ class MegaDownloaderException(Exception):
class MegaAppListener(MegaListener):
_NO_EVENT_ON = (MegaRequest.TYPE_LOGIN,
MegaRequest.TYPE_FETCH_NODES)
def __init__(self, continue_event: threading.Event, listener):
self.continue_event = continue_event
@ -58,15 +60,14 @@ class MegaAppListener(MegaListener):
.format(request, error))
request_type = request.getType()
if request_type == MegaRequest.TYPE_GET_PUBLIC_NODE:
self.node = request.getPublicMegaNode()
if request_type == MegaRequest.TYPE_LOGIN:
LOGGER.info("Fetching Nodes.")
api.fetchNodes()
if request_type == MegaRequest.TYPE_FETCH_NODES:
elif request_type == MegaRequest.TYPE_GET_PUBLIC_NODE:
self.node = request.getPublicMegaNode()
elif request_type == MegaRequest.TYPE_FETCH_NODES:
LOGGER.info("Fetching Root Node.")
self.node = api.getRootNode()
if request_type != MegaRequest.TYPE_LOGIN:
if request_type not in self._NO_EVENT_ON:
self.continue_event.set()
def onRequestTemporaryError(self, api, request, error: MegaError):