Feb-26-2018, 10:03 PM
Hi,
I need your help with my current code. I am working on the if statements to check on the CurrentRowX value and the CurrentWidth value to see if I can get pass on one of these statement so I can add the program_id value or use to call the
I would like to reduce the code to make it much shorter, easy and simple, but I have no idea how I could reduce it.
Here is what I am using right now:
Thanks in advance
I need your help with my current code. I am working on the if statements to check on the CurrentRowX value and the CurrentWidth value to see if I can get pass on one of these statement so I can add the program_id value or use to call the
EPG_Right
function to move the buttons object.I would like to reduce the code to make it much shorter, easy and simple, but I have no idea how I could reduce it.
Here is what I am using right now:
if int(CurrentRowX) == 375 and int(CurrentWidth) <= 864: program_id = int(program_id) + 1 elif int(CurrentRowX) == 375 and int(CurrentWidth) > 864: self.move_right_flag = True self.time_flag = True EPG_Right.GoRight(self) elif int(CurrentRowX) == 441 and int(CurrentWidth) <= 568: program_id = int(program_id) + 1 elif int(CurrentRowX) == 441 and int(CurrentWidth) >= 626: self.move_right_flag = True self.time_flag = True EPG_Right.GoRight(self) elif int(CurrentRowX) == 507 and int(CurrentWidth) <= 456: program_id = int(program_id) + 1 elif int(CurrentRowX) == 507 and int(CurrentWidth) >= 515: self.move_right_flag = True self.time_flag = True EPG_Right.GoRight(self) elif int(CurrentRowX) == 559 and int(CurrentWidth) >= 515: self.move_right_flag = True self.time_flag = True EPG_Right.GoRight(self) elif int(CurrentRowX) == 610 and int(CurrentWidth) < 691: program_id = int(program_id) + 1 elif int(CurrentRowX) == 610 and int(CurrentWidth) >= 691: self.move_right_flag = True self.time_flag = True EPG_Right.GoRight(self) elif int(CurrentRowX) == 669 and int(CurrentWidth) < 691: program_id = int(program_id) + 1 elif int(CurrentRowX) == 669 and int(CurrentWidth) >= 691: self.move_right_flag = True self.time_flag = True EPG_Right.GoRight(self) elif int(CurrentRowX) == 724 and int(CurrentWidth) <= 515: program_id = int(program_id) + 1 elif int(CurrentRowX) == 724 and int(CurrentWidth) >= 567: self.move_right_flag = True self.time_flag = True EPG_Right.GoRight(self) elif int(CurrentRowX) == 790 and int(CurrentWidth) <= 344: program_id = int(program_id) + 1 elif int(CurrentRowX) == 790 and int(CurrentWidth) >= 456: self.move_right_flag = True self.time_flag = True EPG_Right.GoRight(self) elif int(CurrentRowX) == 838 and int(CurrentWidth) >= 456: self.move_right_flag = True self.time_flag = True EPG_Right.GoRight(self) elif int(CurrentRowX) == 897 and int(CurrentWidth) < 396: program_id = int(program_id) + 1 elif int(CurrentRowX) == 897 and int(CurrentWidth) >= 396: self.move_right_flag = True self.time_flag = True EPG_Right.GoRight(self) elif int(CurrentRowX) == 959 and int(CurrentWidth) < 342: program_id = int(program_id) + 1 elif int(CurrentRowX) == 959 and int(CurrentWidth) >= 342: self.move_right_flag = True self.time_flag = True EPG_Right.GoRight(self) elif int(CurrentRowX) == 1009 and int(CurrentWidth) >= 227: self.move_right_flag = True self.time_flag = True EPG_Right.GoRight(self) elif int(CurrentRowX) == 1072 and int(CurrentWidth) < 227: program_id = int(program_id) + 1 elif int(CurrentRowX) == 1072 and int(CurrentWidth) >= 227: self.move_right_flag = True self.time_flag = True EPG_Right.GoRight(self) elif int(CurrentRowX) == 1138 and int(CurrentWidth) < 165: program_id = int(program_id) + 1 elif int(CurrentRowX) == 1138 and int(CurrentWidth) >= 165: self.move_right_flag = True self.time_flag = True EPG_Right.GoRight(self) elif int(CurrentRowX) == 1184 and int(CurrentWidth) < 167: program_id = int(program_id) + 1 elif int(CurrentRowX) == 1184 and int(CurrentWidth) >= 167: self.move_right_flag = True self.time_flag = True EPG_Right.GoRight(self) elif int(CurrentRowX) == 1246 and int(CurrentWidth) >= 59: self.move_right_flag = True self.time_flag = True EPG_Right.GoRight(self)If you could show me how I could reduce it to make it easy and simple, that would be great.
Thanks in advance