def update_translation_project(tp, initialize_from_templates, response_url):
 script_name = (u'/' if (settings.FORCE_SCRIPT_NAME is None) else force_unicode(settings.FORCE_SCRIPT_NAME))
 set_script_prefix(script_name)
 try:
  with useable_connection():
   if initialize_from_templates:
    tp.init_from_templates()
   else:
    tp.update_from_disk()
 except Exception as e:
  tp_init_failed_async.send(sender=tp.__class__, instance=tp)
  raise e
 tp_inited_async.send(sender=tp.__class__, instance=tp, response_url=response_url)

def update_translation_project ( tp , initialize_from_templates , response_url ) : script_name = ( u'/' if ( settings . FORCE_SCRIPT_NAME is None ) else force_unicode ( settings . FORCE_SCRIPT_NAME ) ) set_script_prefix ( script_name ) try : with useable_connection ( ) : if initialize_from_templates : tp . init_from_templates ( ) else : tp . update_from_disk ( ) except Exception as e : tp_init_failed_async . send ( sender = tp . __class__ , instance = tp ) raise e tp_inited_async . send ( sender = tp . __class__ , instance = tp , response_url = response_url )
wraps translation project initializing to allow it to be running as rq job .