python error: TypeError: an integer is required

The problem is that programs_width is a list.

programs_width = list()

If none of these if statements

if prog_width == '342':
    programs_width = 181

#1 hour
if prog_width == '691':
    programs_width = 181

trigger, then programs_width will still be a list here:

self.getControl(prog_ids).setWidth(programs_width)

which causes an error.

Leave a Comment