Module Expr Str Import alias Import alias Import alias Import alias Import alias Import alias ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults Num kwarg body Assign AttributeStore NameLoad attr Call NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str AttributeLoad NameLoad attr Assign SubscriptStore AttributeLoad NameLoad attr Index Str AttributeLoad NameLoad attr Assign SubscriptStore AttributeLoad NameLoad attr Index Str NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad Str Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr If CompareGt AttributeLoad NameLoad attr Num body Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr ListLoad TupleLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr ListLoad TupleLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr ListLoad For TupleStore NameStore NameStore AttributeLoad NameLoad attr body Assign NameStore BinOpBitOr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AttributeLoad NameLoad attr BinOpBitOr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Expr Call AttributeLoad AttributeLoad NameLoad attr attr handlers ExceptHandler body Pass decorator_list FunctionDef arguments args NameParam defaults vararg body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr If CompareIsNot AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr For TupleStore NameStore NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr For TupleStore NameStore NameStore AttributeLoad NameLoad attr body While NameLoad body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num If CompareEq Call NameLoad NameLoad Num body Break Expr Call AttributeLoad NameLoad attr ListLoad NameLoad handlers ExceptHandler body Break decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr Num decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr Num decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return AttributeLoad AttributeLoad NameLoad attr attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Return Call AttributeLoad Str attr SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index Num decorator_list FunctionDef arguments args NameParam defaults body Raise Call NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults vararg kwarg body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body If UnaryOpNot AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr NameLoad Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list If CompareEq NameLoad Str body Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assert CompareNotEq NameLoad Num Assert NameLoad Print TupleLoad Str Call NameLoad NameLoad Str Call NameLoad NameLoad Str Call NameLoad NameLoad Str Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assert CompareEq NameLoad Num Assert UnaryOpNot NameLoad Print TupleLoad Str Call NameLoad NameLoad Str Call NameLoad NameLoad Str Call NameLoad NameLoad Str Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assert CompareNotEq NameLoad Num Assert UnaryOpNot NameLoad Print TupleLoad Str Call NameLoad NameLoad Str Call NameLoad NameLoad Str Call NameLoad NameLoad Str Call NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Expr Call AttributeLoad NameLoad attr decorator_list Assign NameStore Call NameLoad NameLoad keyword Num keyword ListLoad Str Str Assign NameStore Call NameLoad NameLoad keyword Num keyword ListLoad Str Str Assign NameStore Call NameLoad NameLoad keyword Num keyword ListLoad Str Str Assign NameStore Call NameLoad NameLoad keyword Num keyword ListLoad Str Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr TryExcept body Expr Call AttributeLoad NameLoad attr Assert NameLoad handlers ExceptHandler body Print Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr BinOpAdd Call AttributeLoad NameLoad attr Num NameLoad Expr Call AttributeLoad NameLoad attr
N/A N/A 
Copyright (c) 2012, Vukasin Toroman <vukasin@toroman.name>
 N/A subprocess N/A tornado.ioloop N/A time N/A fcntl N/A functools N/A os GenericSubprocess N/A object N/A __init__ N/A N/A self timeout N/A -1 popen_args N/A N/A N/A self args N/A dict N/A N/A N/A self args N/A stdout N/A subprocess PIPE N/A N/A N/A self args N/A stderr N/A subprocess PIPE N/A N/A N/A self args N/A close_fds True N/A N/A N/A N/A self args update popen_args N/A N/A self ioloop None N/A N/A self expiration None N/A N/A self pipe None N/A N/A self timeout timeout N/A N/A self streams N/A N/A N/A self has_timed_out False N/A start N/A N/A self N/A N/A N/A Spawn the task.

        Throws RuntimeError if the task was already started. N/A N/A N/A self pipe None N/A N/A N/A RuntimeError Cannot start task twice N/A N/A self ioloop N/A N/A N/A N/A tornado ioloop IOLoop instance N/A N/A N/A self timeout 0 N/A N/A N/A self expiration N/A N/A N/A self ioloop add_timeout N/A N/A N/A time time N/A self timeout N/A self on_timeout N/A N/A self pipe N/A N/A subprocess Popen N/A self args N/A N/A self streams N/A N/A N/A N/A N/A N/A self pipe stdout fileno N/A N/A N/A N/A N/A N/A self pipe stderr fileno N/A N/A N/A fd d N/A self streams N/A N/A flags N/A N/A N/A fcntl fcntl fd N/A fcntl F_GETFL N/A os O_NDELAY N/A N/A N/A fcntl fcntl fd N/A fcntl F_SETFL flags N/A N/A N/A N/A self ioloop add_handler fd N/A self stat N/A N/A N/A self ioloop READ N/A N/A self ioloop ERROR N/A on_timeout N/A N/A self N/A N/A N/A N/A self has_timed_out True N/A N/A N/A self cancel N/A cancel N/A N/A self N/A N/A N/A Cancel task execution

        Sends SIGKILL to the child process. N/A N/A N/A N/A N/A N/A self pipe kill N/A N/A N/A N/A N/A stat N/A N/A self N/A args N/A N/A Check process completion and consume pending I/O data N/A N/A N/A N/A self pipe poll N/A N/A N/A N/A self pipe returncode None N/A N/A cleanup handlers and timeouts N/A N/A N/A self expiration None N/A N/A N/A N/A N/A self ioloop remove_timeout N/A self expiration N/A N/A fd dest N/A self streams N/A N/A N/A N/A N/A self ioloop remove_handler fd N/A schedulle callback (first try to read all pending data) N/A N/A N/A N/A self ioloop add_callback N/A self on_finish N/A N/A fd dest N/A self streams N/A N/A True N/A N/A N/A N/A data N/A N/A os read fd 4096 N/A N/A N/A len data 0 N/A N/A N/A N/A N/A dest extend N/A data N/A N/A N/A N/A N/A stdout N/A N/A self N/A N/A N/A N/A N/A self get_output 0 N/A property stderr N/A N/A self N/A N/A N/A N/A N/A self get_output 1 N/A property status N/A N/A self N/A N/A N/A N/A N/A self pipe returncode N/A property get_output N/A N/A self index N/A N/A N/A N/A N/A join N/A N/A N/A self streams N/A index N/A 1 N/A on_finish N/A N/A self N/A N/A N/A N/A NotImplemented N/A N/A Subprocess N/A GenericSubprocess N/A N/A Create new instance

    Arguments:
        callback: method to be called after completion. This method should take 3 arguments: statuscode(int), stdout(str), stderr(str), has_timed_out(boolean)
        timeout: wall time allocated for the process to complete. After this expires Task.cancel is called. A negative timeout value means no limit is set

    The task is not started until start is called. The process will then be spawned using subprocess.Popen(**popen_args). The stdout and stderr are always set to subprocess.PIPE.
     __init__ N/A N/A self callback N/A args kwargs N/A N/A Create new instance

        Arguments:
            callback: method to be called after completion. This method should take 3 arguments: statuscode(int), stdout(str), stderr(str), has_timed_out(boolean)
            timeout: wall time allocated for the process to complete. After this expires Task.cancel is called. A negative timeout value means no limit is set

        The task is not started until start is called. The process will then be spawned using subprocess.Popen(**popen_args). The stdout and stderr are always set to subprocess.PIPE.
         N/A N/A self callback callback N/A N/A self done_callback False N/A N/A N/A GenericSubprocess __init__ self args kwargs N/A on_finish N/A N/A self N/A N/A N/A N/A N/A self done_callback N/A N/A N/A self done_callback True N/A prevent calling callback twice N/A N/A N/A N/A self ioloop add_callback N/A N/A functools partial N/A self callback N/A self status N/A self stdout N/A self stderr N/A self has_timed_out N/A N/A N/A N/A __name__ __main__ N/A N/A ioloop N/A N/A N/A N/A tornado ioloop IOLoop instance print_timeout N/A N/A status stdout stderr has_timed_out N/A N/A N/A N/A status 0 N/A has_timed_out N/A N/A OK status: N/A repr status stdout: N/A repr stdout stderr: N/A repr stderr timeout: N/A repr has_timed_out N/A print_ok N/A N/A status stdout stderr has_timed_out N/A N/A N/A N/A status 0 N/A N/A has_timed_out N/A N/A OK status: N/A repr status stdout: N/A repr stdout stderr: N/A repr stderr timeout: N/A repr has_timed_out N/A print_error N/A N/A status stdout stderr has_timed_out N/A N/A N/A N/A status 0 N/A N/A has_timed_out N/A N/A OK status: N/A repr status stdout: N/A repr stdout stderr: N/A repr stderr timeout: N/A repr has_timed_out N/A stop_test N/A N/A N/A N/A N/A N/A N/A ioloop stop N/A N/A t1 N/A Subprocess print_timeout timeout 3 args N/A sleep 5 N/A t2 N/A Subprocess print_ok timeout 3 args N/A sleep 1 N/A t3 N/A Subprocess print_ok timeout 3 args N/A sleepdsdasdas 1 N/A t4 N/A Subprocess print_error timeout 3 args N/A cat /etc/sdfsdfsdfsdfsdfsdfsdf N/A N/A N/A t1 start N/A N/A N/A t2 start N/A N/A N/A N/A N/A t3 start N/A false N/A N/A N/A N/A OK N/A N/A N/A t4 start N/A N/A N/A ioloop add_timeout N/A N/A N/A time time 10 stop_test N/A N/A N/A ioloop start