From 08b76bacedafc89adc761ac2cb35f0564b8d87dd Mon Sep 17 00:00:00 2001 From: Christian Kornacker Date: Mon, 6 May 2013 17:50:40 +0200 Subject: [PATCH] split get_id_from_public_handle --- mega/mega.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mega/mega.py b/mega/mega.py index d6ac841..9d82a4b 100644 --- a/mega/mega.py +++ b/mega/mega.py @@ -276,9 +276,13 @@ class Mega(object): #get node data #TODO fix this function node_data = self.api_request({'a': 'f', 'f': 1, 'p': public_handle}) + + return self.get_id_from_node_data(node_data) + + def get_id_from_node_data(self, node_data): + #determine node id node_id = None - #determine node id for i in node_data['f']: if i['h'] is not u'': node_id = i['h']