# -*- coding: utf-8 -*-
from ppms.migration.packet import *

class FixPacketReleaseDFSize(ChangeDTPPacket):
    '''Increase size of the "Packet release" DF in the migration module.'''
    version = 1
    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 11192

    def fix(self, runner):
        OLD_VAL = 200
        NEW_VAL = 1660

        record_todo = self.get_record(411, ['053340', 742595], [3703])
        if not self.change_value(record_todo, 'width', OLD_VAL, NEW_VAL):
            return self.fail()

        record_done = self.get_record(411, ['053345', 742652], [3703])
        if not self.change_value(record_done, 'width', OLD_VAL, NEW_VAL):
            return self.fail()

        return self.success()
