@blocking_call_on_reactor_thread
def can_edit_channel(channel_id, channel_vote):
 from Tribler.Core.Session import Session
 if Session.get_instance().get_dispersy():
  dispersy = Session.get_instance().get_dispersy_instance()
  try:
   cmty = dispersy.get_community(channel_id)
   (channel_type, is_mod) = cmty.get_channel_mode()
   if (is_mod or ((channel_vote == VOTE_SUBSCRIBE) and (channel_type == ChannelCommunity.CHANNEL_OPEN))):
    return True
  except CommunityNotFoundException:
   return False
 return False

@ blocking_call_on_reactor_thread def can_edit_channel ( channel_id , channel_vote ) : from Tribler . Core . Session import Session if Session . get_instance ( ) . get_dispersy ( ) : dispersy = Session . get_instance ( ) . get_dispersy_instance ( ) try : cmty = dispersy . get_community ( channel_id ) ( channel_type , is_mod ) = cmty . get_channel_mode ( ) if ( is_mod or ( ( channel_vote == VOTE_SUBSCRIBE ) and ( channel_type == ChannelCommunity . CHANNEL_OPEN ) ) ) : return True except CommunityNotFoundException : return False return False
this method returns whether the channel can be edited or not .