Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 53.95 KB | None | 0 0
  1. import datetime
  2. import time
  3. import xbmc
  4. import xbmcgui
  5. import os
  6. from sqlite3 import dbapi2 as database
  7.  
  8.  
  9. def get_programming_times(self):
  10.      #global self.program_stop_minutes, self.program_stop_time, self.epg_time_1, self.epg_time_2, self.epg_time_3
  11.      print "you are now calling the get_programming_times function now chrisssssssssssssssss"
  12.  
  13.      if self.select_db_flag == True:
  14.          self.select_db_flag = False
  15.          program_id = ''.join(str(x) for x in self.program_id)
  16.          print "program_id"
  17.          print program_id
  18.  
  19.          profilePath = xbmc.translatePath(os.path.join('special://userdata/addon_data/script.tvguide', 'source.db'))
  20.          conn1 = database.connect(profilePath)
  21.          cur1 = conn1.cursor()
  22.          cur1.execute('SELECT stop_date FROM programs where program_id=?', [program_id])
  23.          data = cur1.fetchone()
  24.  
  25.          if data is not None:
  26.              stop_date = str(data[0])
  27.              stop_time = time.strptime(str(stop_date), '%Y%m%d%H%M%S')
  28.              stop_time = datetime.datetime.fromtimestamp(time.mktime(stop_time))
  29.              #self.program_stop_time.append(stop_time)
  30.              print "stop_time timestamp"
  31.              print stop_time
  32.      
  33.      
  34.      
  35.  
  36.  
  37.      #for pos_X, pos_Y, prog_id, prog_width in zip(positions_X, positions_Y, programs_id, program_width):
  38.          #if self.select_db_flag == True:
  39.              #self.select_db_flag = False
  40.              #profilePath = xbmc.translatePath(os.path.join('special://userdata/addon_data/script.tvguide', 'source.db'))
  41.              #conn1 = database.connect(profilePath)
  42.              #cur1 = conn1.cursor()
  43.              #cur1.execute('SELECT stop_date FROM programs where program_id=?', [program_id])
  44.              #stop_date = cur1.fetchone()
  45.  
  46.              #if stop_date is not None:
  47.                  #stop_date = str(stop_date[0])
  48.                  #stop_time = time.strptime(str(stop_date), '%Y%m%d%H%M%S')
  49.                  #stop_time = datetime.datetime.fromtimestamp(time.mktime(stop_time))
  50.                  #program_stop_hours = stop_time.strftime('%H')
  51.                  #self.program_stop_minutes = stop_time.strftime('%M')
  52.                  #program_AM_PM = stop_time.strftime('%p')
  53.                  #half_hour = str(self.getControl(344).getLabel())
  54.                  #one_hour = str(self.getControl(345).getLabel())
  55.                  #one_hour_half = str(self.getControl(346).getLabel())
  56.                  #self.epg_time_1 = time.strptime(half_hour, '%I:%M%p')
  57.                  #self.epg_time_2 = time.strptime(one_hour, '%I:%M%p')
  58.                  #self.epg_time_3 = time.strptime(one_hour_half, '%I:%M%p')
  59.  
  60.                  #program_stop_time = time.strptime(stop_date, '%Y%m%d%H%M%S')
  61.                  #program_stop_time = datetime.datetime.fromtimestamp(time.mktime(program_stop_time))
  62.  
  63.  
  64.                  #program_stop_time = program_stop_hours +':' + self.program_stop_minutes + program_AM_PM
  65.                  #program_stop_time = time.strptime(program_stop_time, '%I:%M%p')
  66.                  #self.program_stop_time.append(program_stop_time)
  67.  
  68.  
  69.          #return self.program_stop_minutes, self.program_stop_time
  70.  
  71.  
  72.  
  73.  
  74. def GoRight(self):
  75.      print "self.move_right_flag"
  76.      print self.move_right_flag
  77.      self.program_id = list()
  78.  
  79.  
  80.      # change program controls to display the proper junks
  81.      if self.channels_Index != len(self.program_buttons) - 1:
  82.          if self.channel_page >= 0:
  83.              CurrentId = self.getFocusId()
  84.              CurrentRow = self.getControl(CurrentId).getX()
  85.              CurrentRowY = self.getControl(CurrentId).getY()
  86.              CurrentWidth = self.getControl(CurrentId).getWidth()
  87.              epg_time_1 = ''.join(str(x) for x in self.epg_time_1)
  88.              epg_time_2 = ''.join(str(x) for x in self.epg_time_2)
  89.              epg_time_3 = ''.join(str(x) for x in self.epg_time_1)
  90.              pixel_start = 375
  91.              pixel_middle = 724
  92.              pixel_end = 1073
  93.  
  94.  
  95.              if self.move_right_flag == False:
  96.                  if self.channel_page == 15750:
  97.                      pass
  98.              else:
  99.                  if CurrentRow:
  100.                      program_button = [elem.control for elem in self.program_buttons]
  101.                      programs_id = list()
  102.                      positions_X = list()
  103.                      epg_time_1 = ''.join(str(x) for x in self.epg_time_1)
  104.                      epg_time_2 = ''.join(str(x) for x in self.epg_time_2)
  105.                      epg_time_3 = ''.join(str(x) for x in self.epg_time_3)
  106.  
  107.                      for elem in program_button:
  108.                          programs_id.append(elem.getId())
  109.                          positions_X.append(elem.getX())
  110.                      programs_id = map(str, programs_id)
  111.                      posX = map(str, positions_X)
  112.  
  113.                      test_id = list()
  114.  
  115.                      #Store the list of strings in the lists
  116.                      for i in range(len(posX)):
  117.                          pos_X = posX[i]
  118.  
  119.                          if pos_X == '375':
  120.                              self.program_id = list()
  121.                              self.program_id.append(programs_id[i])
  122.  
  123.  
  124.  
  125.                      for program_id in self.program_id:
  126.                          test_id = list()
  127.                          test_id.append(program_id)
  128.  
  129.                      print "test_id"
  130.                      print test_id
  131.                      
  132.  
  133.                      #Time to connect to the database
  134.                      #self.select_db_flag = True
  135.                      #get_programming_times(self)
  136.                      
  137.  
  138.  
  139.  
  140.                      for program_id in self.program_id:
  141.                          #print "program_id"
  142.                          #print program_id
  143.                          #program_id = int(program_id)
  144.                          nextprogram = int(program_id) + 1
  145.                          nextprogram1 = int(nextprogram) + 1
  146.                          nextprogram2 = int(nextprogram1) + 1
  147.                          nextprogram3 = int(nextprogram2) + 1
  148.                          nextprogram4 = int(nextprogram3) + 1
  149.                          nextprogram5 = int(nextprogram4) + 1
  150.                          nextprogram6 = int(nextprogram5) + 1
  151.                          nextprogram7 = int(nextprogram6) + 1
  152.                          program_button_1 = self.getControl(int(program_id))
  153.                          program_button_2 = self.getControl(int(nextprogram))
  154.                          program_button_3 = self.getControl(int(nextprogram1))
  155.                          program_button_4 = self.getControl(int(nextprogram2))
  156.                          program_button_5 = self.getControl(int(nextprogram3))
  157.                          program_button_6 = self.getControl(int(nextprogram4))
  158.                          program_button_7 = self.getControl(int(nextprogram5))
  159.                          program_button_8 = self.getControl(int(nextprogram6))
  160.                          program_button_9 = self.getControl(int(nextprogram7))
  161.                          program_width = program_button_1.getWidth()
  162.                          programX = program_button_1.getX()
  163.                          pos_X = program_button_1.getX()
  164.                          pos_Y = program_button_1.getY()
  165.                          
  166.                          nextprogram_width = program_button_2.getWidth()
  167.                          nextprogramX = program_button_2.getX()
  168.                          
  169.                          nextprogramX = program_button_2.getX()
  170.                          nextprogram_width = program_button_2.getWidth()
  171.                          nextprogram_label = program_button_2.getLabel()
  172.                          nextprogram1X = program_button_3.getX()
  173.                          nextprogram1_width = program_button_3.getWidth()
  174.                          nextprogram1_label = program_button_3.getLabel()
  175.                          nextprogram2X = program_button_4.getX()
  176.                          nextprogram2_width = program_button_4.getWidth()
  177.                          nextprogram2_label = program_button_4.getLabel()
  178.                          nextprogram3X = program_button_5.getX()
  179.                          nextprogram3_width = program_button_5.getWidth()
  180.                          nextprogram3_label = program_button_5.getLabel()
  181.                          nextprogram4X = program_button_6.getX()
  182.                          nextprogram4_width = program_button_6.getWidth()
  183.                          nextprogram4_label = program_button_6.getLabel()
  184.                          nextprogram5X = program_button_7.getX()
  185.                          nextprogram5_width = program_button_7.getWidth()
  186.                          nextprogram5_label = program_button_7.getLabel()
  187.                          nextprogram6X = program_button_8.getX()
  188.                          nextprogram6_width = program_button_8.getWidth()
  189.                          nextprogram6_label = program_button_8.getLabel()
  190.                          nextprogram7X = program_button_9.getX()
  191.                          nextprogram7_width = program_button_9.getWidth()
  192.                          nextprogram7_label = program_button_9.getLabel()
  193.                          CurrentRowID = self.getFocusId()
  194.                          CurrentRow = self.getControl(CurrentRowID).getX()
  195.                          CurrentWidth = self.getControl(CurrentRowID).getWidth()
  196.  
  197.  
  198.                          if int(program_button_1.getX()) != 375:
  199.                              continue
  200.  
  201.                          if int(program_width) >= 1191 and int(program_width) <= 1197:
  202.                              programs_width = 857
  203.                              program_button_1.setWidth(int(program_width))
  204.                              program_width = program_button_1.getWidth()
  205.                              nextprogram_width = program_button_2.getWidth()
  206.                              print "you are working on 1197"
  207.  
  208.                              if int(programs_width) == 857:
  209.                                  program_button_2.setPosition(1238, int(pos_Y))
  210.  
  211.  
  212.  
  213.                          elif int(program_width) == 1124:
  214.                              programs_width = 691
  215.                              program_button_1.setWidth(int(programs_width))
  216.  
  217.  
  218.  
  219.                          elif int(program_width) == 1083:
  220.                              programs_width = 626
  221.                              program_button_1.setWidth(int(programs_width))
  222.  
  223.  
  224.  
  225.                          elif int(program_width) >= 1026 and int(program_width) <= 1038:
  226.                              programs_width = 691
  227.                              program_button_1.setWidth(int(program_width))
  228.                              program_width = program_button_1.getWidth()
  229.                              nextprogram_width = program_button_2.getWidth()
  230.                              print "you are working on 1026"
  231.  
  232.                              if int(programs_width) == 691:
  233.                                  program_button_2.setPosition(1072, int(pos_Y))
  234.  
  235.  
  236.  
  237.                          elif int(program_width) == 969:
  238.                              programs_width = 626
  239.                              program_button_1.setWidth(int(programs_width))
  240.  
  241.  
  242.  
  243.  
  244.                          elif int(program_width) == 879:
  245.                              programs_width = 516
  246.                              program_button_1.setWidth(int(programs_width))
  247.  
  248.  
  249.  
  250.                          elif int(program_width) == 847:
  251.                              programs_width = 515
  252.                              program_button_1.setWidth(int(programs_width))
  253.  
  254.  
  255.  
  256.                          elif int(program_width) >= 804 and int(program_width) <= 814:
  257.                              programs_width = 456
  258.                              program_button_1.setWidth(int(programs_width))
  259.                              print "you are working on 814"
  260.  
  261.  
  262.  
  263.                          elif int(program_width) >= 741 and int(program_width) <= 757:
  264.                              print "you are working on 741 and 757"
  265.                              programs_width = 399
  266.                              program_button_1.setWidth(int(programs_width))
  267.  
  268.                              if int(programs_width) == 399:
  269.                                  program_button_2.setPosition(782, int(pos_Y))
  270.  
  271.  
  272.  
  273.                          elif int(program_width) == 691:
  274.                              programs_width = 344
  275.                              program_button_1.setWidth(int(programs_width))
  276.                              program_width = program_button_1.getWidth()
  277.                              nextprogram_width = program_button_2.getWidth()
  278.                              print "catch this goright 1"
  279.  
  280.                              if int(program_width) >= 342 and int(program_width) <= 344:
  281.                                  program_button_2.setPosition(724, int(pos_Y))
  282.  
  283.                                  if int(nextprogram_width) == 167:
  284.                                      program_button_3.setPosition(897, int(pos_Y))
  285.  
  286.                                      if int(nextprogram1_width) == 117:
  287.                                          program_button_4.setPosition(1020, int(pos_Y))
  288.  
  289.  
  290.  
  291.                                  elif int(nextprogram_width) == 227:
  292.                                      nextprogram_width = 228
  293.                                      program_button_2.setWidth(int(nextprogram_width))
  294.  
  295.                                      if int(nextprogram_width) == 228:
  296.                                          program_button_3.setPosition(959, int(pos_Y))
  297.  
  298.                                          if int(nextprogram1_width) == 117:
  299.                                              nextprogram1_width = 107
  300.                                              program_button_3.setWidth(int(nextprogram1_width))
  301.  
  302.                                              if int(nextprogram1_width) == 107:
  303.                                                      program_button_4.setPosition(1072, int(pos_Y))
  304.  
  305.  
  306.  
  307.                                  elif int(nextprogram_width) >= 342 and int(nextprogram_width) <= 344:
  308.                                      nextprogram_width = 342
  309.                                      program_button_2.setWidth(int(nextprogram_width))
  310.  
  311.                                      if int(nextprogram_width) == 342:
  312.                                          program_button_3.setPosition(1072, int(pos_Y))
  313.  
  314.                                          if int(nextprogram1_width) == 117:
  315.                                              program_button_4.setPosition(1196, int(pos_Y))
  316.  
  317.  
  318.                                          elif int(nextprogram1_width) == 167:
  319.                                              program_button_4.setPosition(1246, int(pos_Y))
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.                                  elif int(program_width) == 691:
  327.                                      program_button_2.setPosition(1072, int(pos_Y))
  328.  
  329.  
  330.  
  331.  
  332.                          elif int(program_width) >= 625 and int(program_width) <= 630:
  333.                              self.program_id = list()
  334.                              self.program_id.append(program_id)
  335.                              self.select_db_flag = True
  336.                              get_programming_times(self)
  337.                              #self.program_stop_time = get_programming_times(self)
  338.                              #epg_time_2 = ''.join(str(x) for x in self.epg_time_2)
  339.                              #program_stop_time = ''.join(str(x) for x in self.program_stop_time)
  340.                              print "you are now working on 625 code now chrisssssssssssssssssssssssssssss 1"
  341.  
  342.                              #if program_stop_time > epg_time_2:
  343.                                  #print "it is now time to pass now chrisssssssssssssssssssssssss"
  344.                              #else:
  345.                                  #print "it is now time to write the code for 625 now chrisssssssssssssssssssssssss 2"
  346.                              #program_width = 277
  347.                              #program_button_1.setWidth(int(program_width))
  348.                              #nextprogram_width = program_button_2.getWidth()
  349.                              #nextprogram1_width = program_button_3.getWidth()
  350.                              #nextprogram2_width = program_button_4.getWidth()
  351.                              #nextprogram3_width = program_button_5.getWidth()
  352.  
  353.                              #if int(program_width) == 277:
  354.                                  #program_button_2.setPosition(659, int(pos_Y))
  355.  
  356.                                  #if int(nextprogram_width) == 56:
  357.                                      #nextprogram_width = 59
  358.                                      #program_button_2.setWidth(int(nextprogram_width))
  359.                                      #print "catch this one now chrissssssssssssssssssssssssssssssss"
  360.  
  361.                                      #if int(nextprogram_width) == 59:
  362.                                          #program_button_3.setPosition(724, int(pos_Y))
  363.  
  364.                                          #if int(nextprogram1_width) == 344:
  365.                                              #nextprogram1_width = 342
  366.                                              #program_button_3.setWidth(int(nextprogram1_width))
  367.  
  368.                                              #if int(nextprogram1_width) == 342:
  369.                                                      #program_button_4.setPosition(1072, int(pos_Y))
  370.  
  371.  
  372.  
  373.  
  374.                          elif int(program_width) == 577:
  375.                              program_width = 167
  376.                              program_button_1.setWidth(int(program_width))
  377.                              nextprogram_width = program_button_2.getWidth()
  378.                              nextprogram1_width = program_button_3.getWidth()
  379.                              nextprogram2_width = program_button_4.getWidth()
  380.                              nextprogram3_width = program_button_5.getWidth()
  381.  
  382.                              if int(program_width) == 167:
  383.                                  program_button_2.setPosition(549, int(pos_Y))
  384.  
  385.                                  if int(nextprogram_width) == 59:
  386.                                      program_button_3.setPosition(610, int(pos_Y))
  387.  
  388.  
  389.                                  elif int(nextprogram_width) == 172:
  390.                                      nextprogram_width = 167
  391.                                      program_button_2.setWidth(int(nextprogram_width))
  392.  
  393.                                      if int(nextprogram_width) == 167:
  394.                                          program_button_3.setPosition(783, int(pos_Y))
  395.  
  396.                                          if int(nextprogram1_width) == 117:
  397.                                              nextprogram1_width = 108
  398.                                              program_button_3.setWidth(int(nextprogram1_width))
  399.  
  400.                                              if int(nextprogram1_width) == 108:
  401.                                                      program_button_4.setPosition(897, int(pos_Y))
  402.  
  403.  
  404.  
  405.                                  elif int(nextprogram_width) == 344:
  406.                                      nextprogram_width = 342
  407.                                      program_button_2.setWidth(int(nextprogram_width))
  408.  
  409.                                      if int(nextprogram_width) == 342:
  410.                                          program_button_3.setPosition(959, int(pos_Y))
  411.  
  412.  
  413.  
  414.                                  elif int(nextprogram_width) == 515:
  415.                                      nextprogram_width = 516
  416.                                      program_button_2.setWidth(int(nextprogram_width))
  417.  
  418.                                      if int(nextprogram_width) == 516:
  419.                                          program_button_3.setPosition(1072, int(pos_Y))
  420.  
  421.  
  422.  
  423.                                  elif int(nextprogram_width) == 567:
  424.                                      nextprogram_width = 570
  425.                                      program_button_2.setWidth(int(nextprogram_width))
  426.  
  427.                                      if int(nextprogram_width) == 570:
  428.                                          program_button_3.setPosition(1125, int(pos_Y))
  429.  
  430.                                          if int(nextprogram1_width) == 59:
  431.                                              nextprogram1_width = 41
  432.                                              program_button_2.setWidth(int(nextprogram_width))
  433.  
  434.                                              if int(nextprogram_width) == 41:
  435.                                                      program_button_3.setPosition(1175, int(pos_Y))
  436.  
  437.  
  438.  
  439.                                  elif int(nextprogram_width) == 626:
  440.                                      nextprogram_width = 629
  441.                                      program_button_2.setWidth(int(nextprogram_width))
  442.  
  443.                                      if int(nextprogram_width) == 629:
  444.                                          program_button_3.setPosition(1246, int(pos_Y))
  445.  
  446.  
  447.  
  448.  
  449.                          elif int(program_width) == 567:
  450.                              print "fix this goright 1"
  451.                              programs_width = 232
  452.                              program_button_1.setWidth(int(programs_width))
  453.  
  454.  
  455.  
  456.                          elif int(program_width) >= 515 and int(program_width) <= 517:
  457.                              print "you are working on 515 and 517"
  458.                              programs_width = 167
  459.                              program_button_1.setWidth(int(programs_width))
  460.                              program_width = program_button_1.getWidth()
  461.                              nextprogram_width = program_button_2.getWidth()
  462.  
  463.                              if int(programs_width) == 167:
  464.                                  program_button_2.setPosition(549, int(pos_Y))
  465.  
  466.                                  if int(nextprogram_width) == 56:
  467.                                      nextprogram_width = 53
  468.                                      program_button_2.setWidth(int(nextprogram_width))
  469.  
  470.                                      if int(nextprogram_width) == 53:
  471.                                          program_button_3.setPosition(609, int(pos_Y))
  472.  
  473.  
  474.                                  elif int(nextprogram_width) == 515:
  475.                                      program_button_3.setPosition(1072, int(pos_Y))
  476.  
  477.  
  478.                                  elif int(nextprogram_width) == 691:
  479.                                      program_button_3.setPosition(1246, int(pos_Y))
  480.  
  481.  
  482.  
  483.                              elif int(program_width) == 691:
  484.                                  programs_width = 691
  485.                                  program_button_1.setWidth(int(programs_width))
  486.  
  487.                                  if int(programs_width) == 691:
  488.                                      program_button_2.setPosition(1246, int(pos_Y))
  489.  
  490.  
  491.  
  492.  
  493.                          elif int(program_width) >= 450 and int(program_width) <= 456:
  494.                              programs_width = 117
  495.                              program_button_1.setWidth(int(programs_width))
  496.                              program_width = program_button_1.getWidth()
  497.                              nextprogram_width = program_button_2.getWidth()
  498.  
  499.                              if int(program_width) == 117:
  500.                                  program_button_2.setPosition(499, int(pos_Y))
  501.  
  502.                                  if int(nextprogram_width) == 53:
  503.                                      nextprogram_width = 59
  504.                                      program_button_2.setWidth(int(nextprogram_width))
  505.  
  506.                                      if int(nextprogram_width) == 59:
  507.                                          program_button_3.setPosition(565, int(pos_Y))
  508.  
  509.                                          if int(nextprogram1_width) == 396:
  510.                                              nextprogram1_width = 389
  511.                                              program_button_3.setWidth(int(nextprogram1_width))
  512.  
  513.                                              if int(nextprogram1_width) == 389:
  514.                                                      program_button_3.setPosition(959, int(pos_Y))
  515.  
  516.  
  517.  
  518.                                  elif int(nextprogram_width) == 567:
  519.                                      nextprogram_width = 565
  520.                                      program_button_3.setWidth(int(nextprogram1_width))
  521.  
  522.                                      if int(nextprogram_width) == 565:
  523.                                          program_button_3.setPosition(1072, int(pos_Y))
  524.  
  525.  
  526.  
  527.                                  elif int(nextprogram_width) == 626:
  528.                                      nextprogram_width = 633
  529.                                      program_button_2.setWidth(int(nextprogram_width))
  530.  
  531.                                      if int(nextprogram_width) == 633:
  532.                                          program_button_3.setPosition(1138, int(pos_Y))
  533.  
  534.                                          if int(nextprogram1_width) == 117:
  535.                                              program_button_4.setPosition(1263, int(pos_Y))
  536.  
  537.  
  538.  
  539.                                  elif int(nextprogram_width) == 691:
  540.                                      nextprogram_width = 692
  541.                                      program_button_2.setWidth(int(nextprogram_width))
  542.  
  543.                                      if int(nextprogram_width) == 691:
  544.                                          program_button_3.setPosition(1197, int(pos_Y))
  545.  
  546.  
  547.  
  548.  
  549.                          elif int(program_width) >= 399 and int(program_width) <= 408:
  550.                              programs_width = 59
  551.                              program_button_1.setWidth(int(programs_width))
  552.                              program_width = program_button_1.getWidth()
  553.                              nextprogram_width = program_button_2.getWidth()
  554.                              nextprogram1_width = program_button_3.getWidth()
  555.                              nextprogram2_width = program_button_4.getWidth()
  556.                              nextprogram3_width = program_button_5.getWidth()
  557.  
  558.                              if int(program_width) == 59:
  559.                                  program_button_2.setPosition(441, int(pos_Y))
  560.  
  561.                                  if int(nextprogram_width) == 41:
  562.                                      nextprogram_width = 53
  563.                                      program_button_2.setWidth(int(nextprogram_width))
  564.  
  565.                                      if int(nextprogram_width) == 53:
  566.                                          program_button_3.setPosition(509, int(pos_Y))
  567.  
  568.                                          if int(nextprogram1_width) > 691:
  569.                                              program_button_4.setPosition(1572, int(pos_Y))
  570.  
  571.  
  572.  
  573.                                  elif int(nextprogram_width) == 276:
  574.                                      nextprogram_width = 277
  575.                                      program_button_2.setWidth(int(nextprogram_width))
  576.  
  577.                                      if int(nextprogram_width) == 277:
  578.                                          program_button_3.setPosition(724, int(pos_Y))
  579.  
  580.                                          if int(nextprogram1_width) == 344:
  581.                                              nextprogram1_width = 342
  582.                                              program_button_3.setWidth(int(nextprogram1_width))
  583.  
  584.                                              if int(nextprogram1_width) == 342:
  585.                                                      program_button_4.setPosition(1072, int(pos_Y))
  586.  
  587.  
  588.  
  589.                                  elif int(nextprogram_width) == 342:
  590.                                       program_button_3.setPosition(790, int(pos_Y))
  591.  
  592.  
  593.  
  594.                                  elif int(nextprogram_width) == 567:
  595.                                      nextprogram_width = 562
  596.                                      program_button_2.setWidth(int(nextprogram_width))
  597.  
  598.                                      if int(nextprogram_width) == 562:
  599.                                          program_button_3.setPosition(1007, int(pos_Y))
  600.  
  601.                                          if int(nextprogram1_width) == 59:
  602.                                              program_button_4.setPosition(1072, int(pos_Y))
  603.  
  604.  
  605.  
  606.                                  elif int(nextprogram_width) == 626:
  607.                                       program_button_3.setPosition(1072, int(pos_Y))
  608.  
  609.  
  610.  
  611.  
  612.                          elif int(program_width) >= 342 and int(program_width) <= 344:
  613.                              #print "you are working on 342 and 344 button"
  614.                              print "catch this goright 2"
  615.                              program_button_1.setLabel(nextprogram_label)
  616.                              program_button_1.setWidth(nextprogram_width)
  617.  
  618.                              program_button_2.setLabel(nextprogram1_label)
  619.                              program_button_2.setWidth(nextprogram1_width)
  620.                              program_button_3.setLabel(nextprogram2_label)
  621.                              program_button_3.setWidth(nextprogram2_width)
  622.                              program_button_4.setLabel(nextprogram3_label)
  623.                              program_button_4.setWidth(nextprogram3_width)
  624.                              program_button_5.setLabel(nextprogram4_label)
  625.                              program_button_5.setWidth(nextprogram4_width)
  626.                              program_button_6.setLabel(nextprogram5_label)
  627.                              program_button_6.setWidth(nextprogram5_width)
  628.                              program_button_7.setLabel(nextprogram6_label)
  629.                              program_button_7.setWidth(nextprogram6_width)
  630.                              program_button_8.setLabel(nextprogram7_label)
  631.                              program_button_8.setWidth(nextprogram7_width)
  632.                              program_width = program_button_1.getWidth()
  633.                              nextprogram_width = program_button_2.getWidth()
  634.                              nextprogram1_width = program_button_3.getWidth()
  635.                              nextprogram2_width = program_button_4.getWidth()
  636.                              nextprogram3_width = program_button_5.getWidth()
  637.  
  638.  
  639.                              if int(program_width) >= 342 and int(program_width) <= 344:
  640.                                  programs_width = 344
  641.                                  program_button_1.setWidth(int(programs_width))
  642.  
  643.                                  if int(programs_width) == 344:
  644.                                      program_button_2.setPosition(724, int(pos_Y))
  645.  
  646.                                      if int(nextprogram_width) == 167:
  647.                                          program_button_3.setPosition(897, int(pos_Y))
  648.  
  649.                                          if int(nextprogram1_width) >= 515:
  650.                                              program_button_4.setPosition(1412, int(pos_Y))
  651.  
  652.  
  653.                                      elif int(nextprogram_width) >= 342 and int(nextprogram_width) <= 344:
  654.                                          if int(program_width) >= 342 and int(program_width) <= 344 and int(nextprogram_width) >= 342 and int(nextprogram_width) <= 344:
  655.                                              nextprogram_width = 342
  656.                                              program_button_2.setWidth(int(nextprogram_width))
  657.                                              print "you are here in 344 chris"
  658.  
  659.                                              if int(nextprogram_width) == 342:
  660.                                                          program_button_3.setPosition(1072, int(pos_Y))
  661.  
  662.  
  663.  
  664.                                      elif int(nextprogram_width) == 408:
  665.                                          program_button_3.setPosition(787, int(pos_Y))
  666.                                          print "you are in 408"
  667.  
  668.                                          if int(nextprogram1_width) == 691:
  669.                                              program_button_4.setPosition(1482, int(pos_Y))
  670.  
  671.  
  672.  
  673.                                      elif int(nextprogram_width) == 515:
  674.                                          program_button_3.setPosition(1246, int(pos_Y))
  675.  
  676.  
  677.  
  678.                                      elif int(nextprogram_width) == 626:
  679.                                          program_button_3.setPosition(1419, int(pos_Y))
  680.  
  681.  
  682.  
  683.                                      elif int(nextprogram_width) >= 691:
  684.                                          program_button_3.setPosition(1419, int(pos_Y))
  685.  
  686.  
  687.  
  688.                              elif int(program_width) == 167:
  689.                                  program_button_2.setPosition(549, int(pos_Y))
  690.  
  691.                                  if int(nextprogram_width) == 342:
  692.                                      program_button_3.setPosition(897, int(pos_Y))
  693.  
  694.                                      if int(nextprogram1_width) == 691:
  695.                                          program_button_3.setPosition(1592, int(pos_Y))
  696.  
  697.  
  698.  
  699.                                  elif int(nextprogram_width) == 691:
  700.                                      program_button_3.setPosition(1246, int(pos_Y))
  701.  
  702.  
  703.  
  704.  
  705.                              elif int(program_width) == 228:
  706.                                  program_button_2.setPosition(610, int(pos_Y))
  707.  
  708.                                  if int(nextprogram_width) == 107:
  709.                                      program_button_3.setPosition(724, int(pos_Y))
  710.  
  711.                                      if int(nextprogram1_width) == 456:
  712.                                          program_button_4.setPosition(1186, int(pos_Y))
  713.  
  714.  
  715.  
  716.                              elif int(program_width) == 408:
  717.                                  program_button_2.setPosition(787, int(pos_Y))
  718.  
  719.  
  720.  
  721.                              elif int(program_width) == 456:
  722.                                  program_button_2.setPosition(837, int(pos_Y))
  723.  
  724.                                  if int(nextprogram_width) >= 1197:
  725.                                      program_button_3.setPosition(1572, int(pos_Y))
  726.  
  727.  
  728.  
  729.                              elif int(program_width) == 515:
  730.                                  programs_width = 516
  731.                                  program_button_1.setWidth(int(programs_width))
  732.  
  733.                                  if int(programs_width) == 516:
  734.                                      program_button_2.setPosition(897, int(pos_Y))
  735.  
  736.                                      if int(nextprogram_width) == 59:
  737.                                          nextprogram_width = 56
  738.                                          program_button_2.setWidth(int(nextprogram_width))
  739.  
  740.                                          if int(nextprogram_width) == 56:
  741.                                              program_button_3.setPosition(959, int(pos_Y))
  742.  
  743.  
  744.                                      elif int(nextprogram_width) >= 515:
  745.                                          program_button_3.setPosition(1572, int(pos_Y))
  746.  
  747.  
  748.  
  749.                              elif int(program_width) == 567:
  750.                                  program_button_2.setPosition(949, int(pos_Y))
  751.  
  752.  
  753.  
  754.                              elif int(program_width) == 626:
  755.                                  programs_width = 627
  756.                                  program_button_1.setWidth(int(programs_width))
  757.                                  print "you are in the 627 area for channel 4 chris"
  758.  
  759.                                  if int(programs_width) == 627:
  760.                                      program_button_2.setPosition(1009, int(pos_Y))
  761.  
  762.                                      if int(nextprogram_width) == 59:
  763.                                          nextprogram_width = 56
  764.                                          program_button_2.setWidth(int(nextprogram_width))
  765.  
  766.                                          if int(nextprogram_width) == 56:
  767.                                              program_button_3.setPosition(1072, int(pos_Y))
  768.  
  769.  
  770.  
  771.                              elif int(program_width) >= 691 and int(program_width) <= 692:
  772.                                  program_widths = 691
  773.                                  program_button_1.setWidth(int(program_widths))
  774.  
  775.                                  if int(program_widths) == 691:
  776.                                      program_button_2.setPosition(1072, int(pos_Y))
  777.  
  778.  
  779.  
  780.                              elif int(program_width) >= 741:
  781.                                  program_button_2.setPosition(1124, int(pos_Y))
  782.  
  783.  
  784.  
  785.                              elif int(program_width) > 1072:
  786.                                  program_button_2.setPosition(1618, int(pos_Y))
  787.  
  788.  
  789.  
  790.                          elif int(program_width) == 286:
  791.                              print "you are working on 286"
  792.                              program_button_1.setLabel(nextprogram_label)
  793.                              program_button_1.setWidth(nextprogram_width)
  794.                              program_button_2.setLabel(nextprogram1_label)
  795.                              program_button_2.setWidth(nextprogram1_width)
  796.                              program_button_3.setLabel(nextprogram2_label)
  797.                              program_button_3.setWidth(nextprogram2_width)
  798.                              program_button_4.setLabel(nextprogram3_label)
  799.                              program_button_4.setWidth(nextprogram3_width)
  800.                              program_width = program_button_1.getWidth()
  801.                              nextprogram_width = program_button_2.getWidth()
  802.                              nextprogram1_width = program_button_3.getWidth()
  803.                              nextprogram2_width = program_button_4.getWidth()
  804.                              nextprogram3_width = program_button_5.getWidth()
  805.                              print "program_width"
  806.                              print program_width
  807.  
  808.                              if int(program_width) == 286:
  809.                                  print "here 1"
  810.  
  811.                              elif int(program_width) == 344:
  812.                                  print "here 2"
  813.  
  814.  
  815.  
  816.  
  817.                          elif int(program_width) >= 276 and int(program_width) <= 278:
  818.                              print "you are working on 276 and 278"
  819.                              program_button_1.setLabel(nextprogram_label)
  820.                              program_button_1.setWidth(nextprogram_width)
  821.                              program_button_2.setLabel(nextprogram1_label)
  822.                              program_button_2.setWidth(nextprogram1_width)
  823.                              program_button_3.setLabel(nextprogram2_label)
  824.                              program_button_3.setWidth(nextprogram2_width)
  825.                              program_button_4.setLabel(nextprogram3_label)
  826.                              program_button_4.setWidth(nextprogram3_width)
  827.                              program_width = program_button_1.getWidth()
  828.                              nextprogram_width = program_button_2.getWidth()
  829.                              nextprogram1_width = program_button_3.getWidth()
  830.                              nextprogram2_width = program_button_4.getWidth()
  831.                              nextprogram3_width = program_button_5.getWidth()
  832.                              print "program_width"
  833.                              print program_width
  834.  
  835.                              if int(program_width) == 59:
  836.                                  print "you are in the 59 for 277 now"
  837.                                  program_button_2.setPosition(441, int(pos_Y))
  838.  
  839.                                  if int(nextprogram_width) == 691:
  840.                                      program_button_3.setPosition(1138, int(pos_Y))
  841.  
  842.                                      if int(nextprogram1_width) == 59:
  843.                                          program_button_4.setPosition(1201, int(pos_Y))
  844.  
  845.  
  846.  
  847.                              elif int(program_width) > 1072:
  848.                                  program_button_2.setPosition(1618, int(pos_Y))
  849.  
  850.  
  851.  
  852.  
  853.  
  854.                          elif int(program_width) >= 228 and int(program_width) <= 235:
  855.                              print "you are working on the 228"
  856.                              programs_width = program_button_1.getWidth()
  857.                              nextprograms_width = program_button_2.getWidth()
  858.                              nextprograms1_width = program_button_3.getWidth()
  859.                              nextprograms2_width = program_button_4.getWidth()
  860.                              nextprograms3_width = program_button_5.getWidth()
  861.  
  862.                              if int(programs_width) == 228 and int(programs_width) == 108:
  863.                                  program_button_1.setLabel(nextprogram1_label)
  864.                                  program_button_1.setWidth(nextprogram1_width)
  865.                                  program_button_2.setLabel(nextprogram2_label)
  866.                                  program_button_2.setWidth(nextprogram2_width)
  867.                                  program_button_3.setLabel(nextprogram3_label)
  868.                                  program_button_3.setWidth(nextprogram3_width)
  869.  
  870.  
  871.                                  if int(program_width) == 459:
  872.                                      program_widths = 456
  873.                                      program_button_1.setWidth(program_widths)
  874.  
  875.                                      if int(program_widths) == 456:
  876.                                          program_button_2.setPosition(837, int(pos_Y))
  877.  
  878.                                          if int(nextprogram_width) > 691:
  879.                                              program_button_3.setPosition(1572, int(pos_Y))
  880.                                              program_button_4.setPosition(1874, int(pos_Y))
  881.                                              program_button_5.setPosition(2216, int(pos_Y))
  882.  
  883.  
  884.                              else:
  885.                                  program_button_1.setLabel(nextprogram_label)
  886.                                  program_button_1.setWidth(nextprogram_width)
  887.                                  program_button_2.setLabel(nextprogram1_label)
  888.                                  program_button_2.setWidth(nextprogram1_width)
  889.                                  program_button_3.setLabel(nextprogram2_label)
  890.                                  program_button_3.setWidth(nextprogram2_width)
  891.                                  program_button_4.setLabel(nextprogram3_label)
  892.                                  program_button_4.setWidth(nextprogram3_width)
  893.  
  894.  
  895.                                  if int(program_width) == 167:
  896.                                      print "you are in the 228 number 1"
  897.                                      program_button_2.setPosition(549, int(pos_Y))
  898.  
  899.                                      if int(nextprogram_width) == 108:
  900.                                          nextprogram_width = 118
  901.                                          program_button_2.setWidth(int(nextprogram_width))
  902.  
  903.                                          if int(nextprogram_width) == 118:
  904.                                              program_button_3.setPosition(673, int(pos_Y))
  905.  
  906.                                              if int(nextprogram1_width) == 691:
  907.                                                      program_button_4.setPosition(1369, int(pos_Y))
  908.  
  909.  
  910.  
  911.                                  elif int(program_width) == 228:
  912.                                      print "you are in the 228 number 2"
  913.                                      program_button_2.setPosition(410, int(pos_Y))
  914.  
  915.                                      if int(nextprogram_width) == 108:
  916.                                          nextprogram_width = 118
  917.                                          program_button_2.setWidth(int(nextprogram_width))
  918.  
  919.                                          if int(nextprogram_width) == 118:
  920.                                              program_button_3.setPosition(710, int(pos_Y))
  921.  
  922.  
  923.  
  924.                                  elif int(program_width) == 459:
  925.                                      print "you are in the 459 box"
  926.  
  927.  
  928.  
  929.                                  elif int(program_width) == 691:
  930.                                      print "you are in the 228 number 2"
  931.                                      program_button_2.setPosition(1072, int(pos_Y))
  932.  
  933.                                      if int(nextprogram_width) == 167:
  934.                                          program_button_3.setPosition(1246, int(pos_Y))
  935.  
  936.  
  937.  
  938.  
  939.                          elif int(program_width) == 167:
  940.                              program_button_1.setLabel(nextprogram_label)
  941.                              program_button_1.setWidth(nextprogram_width)
  942.                              program_button_2.setLabel(nextprogram1_label)
  943.                              program_button_2.setWidth(nextprogram1_width)
  944.                              program_button_3.setLabel(nextprogram2_label)
  945.                              program_button_3.setWidth(nextprogram2_width)
  946.                              program_button_4.setLabel(nextprogram3_label)
  947.                              program_button_4.setWidth(nextprogram3_width)
  948.                              program_button_5.setLabel(nextprogram4_label)
  949.                              program_button_5.setWidth(nextprogram4_width)
  950.                              program_button_6.setLabel(nextprogram5_label)
  951.                              program_button_6.setWidth(nextprogram5_width)
  952.                              program_button_7.setLabel(nextprogram6_label)
  953.                              program_button_7.setWidth(nextprogram6_width)
  954.                              program_button_8.setLabel(nextprogram7_label)
  955.                              program_button_8.setWidth(nextprogram7_width)
  956.                              program_width = program_button_1.getWidth()
  957.                              nextprogram_width = program_button_2.getWidth()
  958.                              nextprogram1_width = program_button_3.getWidth()
  959.                              nextprogram2_width = program_button_4.getWidth()
  960.                              nextprogram3_width = program_button_5.getWidth()
  961.                              print "program_width"
  962.                              print program_width
  963.  
  964.                              if int(program_width) == 167:
  965.                                  print "you are working on the 167 right nowwwwwwwwwwwwwwwwwwwwwwww"
  966.  
  967.                                  if int(nextprogram_width) == 59:
  968.                                      nextprogram_width = 56
  969.                                      program_button_2.setWidth(int(nextprogram_width))
  970.  
  971.                                      if int(nextprogram_width) == 56:
  972.                                          program_button_3.setPosition(610, int(pos_Y))
  973.  
  974.  
  975.                              elif int(program_width) == 342:
  976.                                  program_widths = 344
  977.                                  program_button_1.setWidth(int(program_widths))
  978.                                  print "you are in the 344 in 167 area"
  979.  
  980.                                  if int(program_widths) >= 342 and int(program_widths) <= 344:
  981.                                      program_button_2.setPosition(724, int(pos_Y))
  982.  
  983.                                      if int(nextprogram_width) == 396:
  984.                                          nextprogram_width = 408
  985.                                          program_button_2.setWidth(int(nextprogram_width))
  986.  
  987.                                          if int(nextprogram_width) == 408:
  988.                                              program_button_3.setPosition(1138, int(pos_Y))
  989.  
  990.  
  991.  
  992.                                      elif int(nextprogram_width) == 515:
  993.                                          program_button_3.setPosition(1246, int(pos_Y))
  994.  
  995.  
  996.  
  997.                                      elif int(nextprogram_width) == 691:
  998.                                          program_button_3.setPosition(1419, int(pos_Y))
  999.  
  1000.  
  1001.  
  1002.                              elif int(program_width) >= 515 and int(program_width) <= 517:
  1003.                                  programs_width = 344
  1004.                                  program_button_1.setWidth(int(programs_width))
  1005.                                  #self.program_id.append(program_id)
  1006.                                  print "you are here nooooooooooooooowwwwwwwwwwwwwwwwwww 1"
  1007.                                  print "program_id"
  1008.  
  1009.                                  if int(programs_width) == 344:
  1010.                                      program_button_2.setPosition(724, int(pos_Y))
  1011.  
  1012.                                      if int(nextprogram_width) == 167:
  1013.                                          nextprogram_width = 168
  1014.                                          program_button_1.setWidth(int(program_widths))
  1015.  
  1016.                                          if int(nextprogram_width) == 168:
  1017.                                              program_button_3.setPosition(1072, int(pos_Y))
  1018.  
  1019.                                              if int(nextprogram1_width) == 691:
  1020.                                                  program_button_4.setPosition(1767, int(pos_Y))
  1021.  
  1022.  
  1023.  
  1024.  
  1025.                                      elif int(nextprogram_width) >= 342 and int(nextprogram_width) <= 344:
  1026.                                          nextprogram_width = 342
  1027.                                          program_button_2.setWidth(int(nextprogram_width))
  1028.  
  1029.                                          if int(nextprogram_width) == 342:
  1030.                                              program_button_3.setPosition(1072, int(pos_Y))
  1031.  
  1032.  
  1033.  
  1034.                                          elif int(nextprogram_width) >= 691:
  1035.                                              program_button_3.setPosition(1572, int(pos_Y))
  1036.  
  1037.  
  1038.  
  1039.                                      elif int(nextprogram_width) >= 515 and int(nextprogram_width) <= 517:
  1040.                                          program_button_3.setPosition(1246, int(pos_Y))
  1041.  
  1042.  
  1043.  
  1044.  
  1045.                              elif int(program_width) == 691:
  1046.                                  program_button_2.setPosition(1072, int(pos_Y))
  1047.                                  #test = int(program_id) + 1
  1048.                                  #print "test"
  1049.                                  #test = ''
  1050.                                  #cur.execute('UPDATE programs SET program_id=? WHERE program_id=?', [program_id, test])
  1051.                                  #con.commit()
  1052.  
  1053.                                  if int(nextprogram_width) == 691:
  1054.                                      program_button_3.setPosition(1767, int(pos_Y))
  1055.  
  1056.  
  1057.  
  1058.                              elif int(program_width) >= 1197:
  1059.                                  program_button_2.setPosition(1572, int(pos_Y))
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.                          elif int(program_width) == 117:
  1066.                              pass
  1067.  
  1068.  
  1069.  
  1070.  
  1071.                          elif int(program_width) == 59:
  1072.                              print "you are working on number 59"
  1073.                              program_button_1.setLabel(nextprogram_label)
  1074.                              program_button_1.setWidth(nextprogram_width)
  1075.                              program_button_2.setLabel(nextprogram1_label)
  1076.                              program_button_2.setWidth(nextprogram1_width)
  1077.                              program_button_3.setWidth(nextprogram2_width)
  1078.                              program_button_3.setLabel(nextprogram2_label)
  1079.                              program_button_4.setWidth(nextprogram3_width)
  1080.                              program_button_4.setLabel(nextprogram3_label)
  1081.                              program_widths = program_button_1.getWidth()
  1082.                              nextprogram_width = program_button_2.getWidth()
  1083.                              nextprogram1_width = program_button_3.getWidth()
  1084.                              nextprogram2_width = program_button_4.getWidth()
  1085.                              nextprogram3_width = program_button_5.getWidth()
  1086.  
  1087.                              if int(program_widths) == 59 and int(nextprogram_width) >= 560 and nextprogram_width <= 567:
  1088.                                  nextprogram_width = 277
  1089.                                  program_button_2.setWidth(int(nextprogram_width))
  1090.  
  1091.                                  if int(nextprogram_width) == 277:
  1092.                                      program_button_2.setPosition(659, int(pos_Y))
  1093.  
  1094.  
  1095.  
  1096.  
  1097.                              elif int(program_widths) == 59 and nextprogram_width == 278:
  1098.                                  print "hello"
  1099.                                  program_button_2.setPosition(724, int(pos_Y))
  1100.                                  program_button_3.setPosition(1072, int(pos_Y))
  1101.  
  1102.  
  1103.  
  1104.                              elif int(program_widths) == 277:
  1105.                                  program_button_2.setPosition(659, int(pos_Y))
  1106.  
  1107.                                  if int(nextprogram_width) == 342:
  1108.                                      program_button_3.setPosition(724, int(pos_Y))
  1109.  
  1110.  
  1111.                              elif int(program_widths) == 278:
  1112.                                  pass
  1113.                                  #program_button_2.setPosition(659, int(pos_Y))
  1114.                                  
  1115.  
  1116.  
  1117.  
  1118.                              elif int(program_widths) == 342:
  1119.                                  program_button_3.setPosition(724, int(pos_Y))
  1120.                                  program_button_4.setPosition(1072, int(pos_Y))
  1121.  
  1122.  
  1123.  
  1124.                              elif int(program_widths) == 567:
  1125.                                  program_button_2.setPosition(959, int(pos_Y))
  1126.                                  print "you are working on 567 in the 59"
  1127.  
  1128.                                  if int(nextprogram_width) == 59:
  1129.                                      program_button_3.setPosition(1022, int(pos_Y))
  1130.  
  1131.                                      if int(nextprogram1_width) == 691:
  1132.                                          program_button_4.setPosition(1718, int(pos_Y))
  1133.  
  1134.  
  1135.  
  1136.                              elif int(program_widths) == 741:
  1137.                                  program_widths = 399
  1138.                                  program_button_1.setWidth(program_widths)
  1139.  
  1140.                                  if int(program_widths) == 399:
  1141.                                      program_button_2.setPosition(782, int(pos_Y))
  1142.  
  1143.                                      if int(nextprogram_width) > 1072:
  1144.                                          program_button_3.setPosition(1856, int(pos_Y))
  1145.  
  1146.  
  1147.                              elif int(program_widths) >= 1197:
  1148.                                  program_button_2.setPosition(1419, int(pos_Y))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement