mirror of
https://github.com/coursera-dl/coursera-dl.git
synced 2026-01-23 02:35:37 +00:00
Use OrderedDict in api.py
This commit is contained in:
parent
95666a6fdf
commit
ad53c28961
1 changed files with 9 additions and 9 deletions
|
|
@ -492,16 +492,16 @@ class ItemsV2(object):
|
|||
|
||||
@staticmethod
|
||||
def from_json(data):
|
||||
return ItemsV2({
|
||||
item['id']:
|
||||
ItemV2(item['name'],
|
||||
item['id'],
|
||||
item['slug'],
|
||||
item['contentSummary']['typeName'],
|
||||
item['lessonId'],
|
||||
item['moduleId'])
|
||||
return ItemsV2(OrderedDict(
|
||||
(item['id'],
|
||||
ItemV2(item['name'],
|
||||
item['id'],
|
||||
item['slug'],
|
||||
item['contentSummary']['typeName'],
|
||||
item['lessonId'],
|
||||
item['moduleId']))
|
||||
for item in data
|
||||
})
|
||||
))
|
||||
|
||||
def __getitem__(self, key):
|
||||
return self.children[key]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue