<s> from threading import Thread <EOL> class ServiceThread ( Thread ) : <EOL> __method = None <EOL> __params = None <EOL> callback_url = None <EOL> request_user = None <EOL> @ staticmethod <EOL> def start_method_new_thread ( method , request_user = None , url = None , * params ) : <EOL> thread = ServiceThread ( ) <EOL> if request_user : <EOL> thread . request_user = request_user <EOL> if url : <EOL> thread . callback_url = url <EOL> thread . start_method ( method , * params ) <EOL> def start_method ( self , method , * params ) : <EOL> self . __method = method <EOL> self . __params = params <EOL> self . start ( ) <EOL> def run ( self ) : <EOL> try : <EOL> self . __method ( * self . __params ) <EOL> except Exception as e : <EOL> print "<STR_LIT>" % ( str ( self . __method ) , str ( self . __params ) , str ( e ) ) </s>
