Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"parentItem",
"mtime",
"contentType",
"md5",
"filename",
]
)
template = template | set(self.temp_keys)
for pos, item in enumerate(items):
if set(item) == set(["links", "library", "version", "meta", "key", "data"]):
# we have an item that was retrieved from the API
item = item["data"]
to_check = set(i for i in list(item.keys()))
difference = to_check.difference(template)
if difference:
raise ze.InvalidItemFields(
"Invalid keys present in item %s: %s"
% (pos + 1, " ".join(i for i in difference))
)
return items
'creators',
'mimeType',
'linkMode',
'note',
'charset',
'dateAdded',
'version',
'collections',
'dateModified',
'relations'])
template = template | set(self.temp_keys)
for pos, item in enumerate(items):
to_check = set(i for i in list(item['data'].keys()))
difference = to_check.difference(template)
if difference:
raise ze.InvalidItemFields(
"Invalid keys present in item %s: %s" % (pos + 1,
' '.join(i for i in difference)))
return [i['data'] for i in items]