예제 #1
0
 def migrate_context(cls, context, version):
     values = context.values
     if version < 3:
         values["attr_color"] = values["graph"]["attr_color"]
         values["attr_size"] = values["graph"]["attr_size"]
         values["attr_shape"] = values["graph"]["attr_shape"]
         values["attr_label"] = values["graph"]["attr_label"]
     if version < 4:
         if values["attr_x"][1] % 100 == 1 or values["attr_y"][1] % 100 == 1:
             raise IncompatibleContext()
예제 #2
0
 def migrate_context(context, _):
     if context.foo == 13:
         raise IncompatibleContext()