Merge pull request #41 from ckornacker/feature/splitgetid

addition of get_id_from_node_data()
This commit is contained in:
Richard O'Dwyer 2013-05-08 04:41:07 -07:00
commit 3904ec54d4

View file

@ -281,9 +281,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']