Guest User

Untitled

a guest
Jun 24th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. def queryNormalChannels(input_item_id,input_channel_name=''):
  2.  
  3. """This function queries channels and returns True-False, the name of the channel,
  4. Total number of channels and the names of the channels
  5. (channel_success?, selected_channel_number[],selected_channel_name[],channel_list[])
  6. """
  7. #Kursad Karatas 2009
  8. try:
  9.  
  10. lx_ItemName=lx.eval("query sceneservice item.name ? %s" %input_item_id)
  11. lx_number_channel=lx.eval("query sceneservice channel.N ?")
  12. lx.out("FUNC CALL: number of channels",lx_number_channel)
  13. lx_selected_channel_name=' '
  14. channel_list=[]
  15. selected_channel_name=[]
  16. selected_channel_number=[]
  17.  
  18. for iterChannel in xrange(lx_number_channel):
  19.  
  20. # lx.eval("select.channel %s add " %lx_item_channels_name)
  21.  
  22. if input_channel_name=='':
  23. lx_item_channels_name=lx.eval("query sceneservice channel.name ? %s" %iterChannel)
  24.  
  25. lx_sel_channel_status=lx.eval("query sceneservice channel.isSelected ? %s" %lx_item_channels_name)
  26.  
  27. else:
  28. lx_item_channels_name=input_channel_name
  29.  
  30.  
  31. if lx_sel_channel_status:
  32. lx.out("lx_sel_channel_status is ",lx_sel_channel_status)
  33. channel_success=lx_sel_channel_status
  34. selected_channel_number.append(iterChannel)
  35. selected_channel_name.append(lx_item_channels_name)
  36.  
  37. lx.out(type(selected_channel_name),"Selected channel name",lx_item_channels_name)
  38.  
  39. channel_list.append(lx_item_channels_name)
  40.  
  41. return channel_success, selected_channel_number,selected_channel_name,channel_list
  42.  
  43. except:
  44. lx.out('Exception "%s" on line: %d' % (sys.exc_value, sys.exc_traceback.tb_lineno))
Add Comment
Please, Sign In to add comment