def broadcast_to_sharejs(action, sharejs_uuid, node=None, wiki_name='home', data=None):
 url = 'http://{host}:{port}/{action}/{id}/'.format(host=wiki_settings.SHAREJS_HOST, port=wiki_settings.SHAREJS_PORT, action=action, id=sharejs_uuid)
 if ((action == 'redirect') or (action == 'delete')):
  redirect_url = urllib.quote(node.web_url_for('project_wiki_view', wname=wiki_name, _guid=True), safe='')
  url = os.path.join(url, redirect_url)
 try:
  requests.post(url, json=data)
 except requests.ConnectionError:
  pass

def broadcast_to_sharejs ( action , sharejs_uuid , node = None , wiki_name = 'home' , data = None ) : url = 'http://{host}:{port}/{action}/{id}/' . format ( host = wiki_settings . SHAREJS_HOST , port = wiki_settings . SHAREJS_PORT , action = action , id = sharejs_uuid ) if ( ( action == 'redirect' ) or ( action == 'delete' ) ) : redirect_url = urllib . quote ( node . web_url_for ( 'project_wiki_view' , wname = wiki_name , _guid = True ) , safe = '' ) url = os . path . join ( url , redirect_url ) try : requests . post ( url , json = data ) except requests . ConnectionError : pass
broadcast an action to all documents connected to a wiki .