Пример #1
0
 def import_from_dict(cls, data):
     data['executables'] = [
         Executable.import_from_dict(executable_data)
         for executable_data in data['executables']
     ]
     data['executables'] = dict([(executable.filename, executable)
                                 for executable in data['executables']])
     data['testcases'] = [
         Testcase.import_from_dict(testcase_data)
         for testcase_data in data['testcases']
     ]
     data['managers'] = [
         Manager.import_from_dict(manager_data)
         for manager_data in data['managers']
     ]
     data['managers'] = dict([(manager.filename, manager)
                              for manager in data['managers']])
     data['files'] = [
         File.import_from_dict(file_data) for file_data in data['files']
     ]
     data['files'] = dict([(file_.filename, file_)
                           for file_ in data['files']])
     # XXX We convert the key from str to int because it was the key
     # of a JSON object.
     data['evaluations'] = dict(
         (int(k), v) for k, v in data['evaluations'].iteritems())
     return cls(**data)
Пример #2
0
Файл: Job.py Проект: VittGam/cms
 def import_from_dict(cls, data):
     data["files"] = [File.import_from_dict(file_data) for file_data in data["files"]]
     data["files"] = dict([(file_.filename, file_) for file_ in data["files"]])
     data["managers"] = [Manager.import_from_dict(manager_data) for manager_data in data["managers"]]
     data["managers"] = dict([(manager.filename, manager) for manager in data["managers"]])
     data["executables"] = [Executable.import_from_dict(executable_data) for executable_data in data["executables"]]
     data["executables"] = dict([(executable.filename, executable) for executable in data["executables"]])
     return cls(**data)
Пример #3
0
 def import_from_dict(cls, data):
     data['files'] = dict(
         (k, File(k, v)) for k, v in data['files'].iteritems())
     data['managers'] = dict(
         (k, Manager(k, v)) for k, v in data['managers'].iteritems())
     data['executables'] = dict(
         (k, Executable(k, v)) for k, v in data['executables'].iteritems())
     return cls(**data)
Пример #4
0
Файл: Job.py Проект: VittGam/cms
 def import_from_dict(cls, data):
     data["executables"] = [Executable.import_from_dict(executable_data) for executable_data in data["executables"]]
     data["executables"] = dict([(executable.filename, executable) for executable in data["executables"]])
     data["testcases"] = [Testcase.import_from_dict(testcase_data) for testcase_data in data["testcases"]]
     data["managers"] = [Manager.import_from_dict(manager_data) for manager_data in data["managers"]]
     data["managers"] = dict([(manager.filename, manager) for manager in data["managers"]])
     data["files"] = [File.import_from_dict(file_data) for file_data in data["files"]]
     data["files"] = dict([(file_.filename, file_) for file_ in data["files"]])
     # XXX We convert the key from str to int because it was the key
     # of a JSON object.
     data["evaluations"] = dict((int(k), v) for k, v in data["evaluations"].iteritems())
     return cls(**data)
Пример #5
0
 def import_from_dict(cls, data):
     data['files'] = [File.import_from_dict(file_data)
                      for file_data in data['files']]
     data['files'] = dict([(file_.filename, file_)
                           for file_ in data['files']])
     data['managers'] = [Manager.import_from_dict(manager_data)
                         for manager_data in data['managers']]
     data['managers'] = dict([(manager.filename, manager)
                              for manager in data['managers']])
     data['executables'] = [Executable.import_from_dict(executable_data)
                            for executable_data in data['executables']]
     data['executables'] = dict([(executable.filename, executable)
                                 for executable in data['executables']])
     return cls(**data)
Пример #6
0
 def import_from_dict(cls, data):
     data['files'] = dict(
         (k, File(k, v)) for k, v in data['files'].iteritems())
     data['managers'] = dict(
         (k, Manager(k, v)) for k, v in data['managers'].iteritems())
     data['executables'] = dict(
         (k, Executable(k, v)) for k, v in data['executables'].iteritems())
     data['testcases'] = dict(
         (k, Testcase(*v)) for k, v in data['testcases'].iteritems())
     # XXX We convert the key from str to int because it was the key
     # of a JSON object.
     data['evaluations'] = dict(
         (int(k), v) for k, v in data['evaluations'].iteritems())
     return cls(**data)
Пример #7
0
 def import_from_dict(cls, data):
     data['executables'] = [Executable.import_from_dict(executable_data)
                            for executable_data in data['executables']]
     data['executables'] = dict([(executable.filename, executable)
                                 for executable in data['executables']])
     data['testcases'] = [Testcase.import_from_dict(testcase_data)
                          for testcase_data in data['testcases']]
     data['managers'] = [Manager.import_from_dict(manager_data)
                         for manager_data in data['managers']]
     data['managers'] = dict([(manager.filename, manager)
                              for manager in data['managers']])
     data['files'] = [File.import_from_dict(file_data)
                      for file_data in data['files']]
     data['files'] = dict([(file_.filename, file_)
                           for file_ in data['files']])
     return cls(**data)