Skip to content

Commit

Permalink
object_info_request for #4
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengj committed Jul 25, 2013
1 parent b2e489a commit eeec46c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions jlkernel/handlers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,35 @@ function shutdown_request(socket, msg)
exit()
end

function object_info_request(socket, msg)
try
s = symbol(msg["name"])
o = eval(s)
content = ["name" => msg["name"],
"found" => true,
"ismagic" => false,
"isalias" => false,
"type_name" => string(typeof(foo)),
"base_class" => string(typeof(foo).super),
"string_form" => msg["detail_level"] == 0 ?
sprint(16384, show, foo) : repr(foo) ]
if method_exists(length, (typeof(o),))
content["length"] = length(o)
end
send_ipython(request, msg_reply(msg, "object_info_reply", content))
catch
send_ipython(request,
msg_reply(msg, "object_info_reply",
["name" => msg["name"],
"found" => false ]))
end
end

const handlers = (String=>Function)[
"execute_request" => execute_request_0x535c5df2,
"complete_request" => complete_request,
"kernel_info_request" => kernel_info_request,
"object_info_request" => object_info_request,
"connect_request" => connect_request,
"shutdown_request" => shutdown_request,
]

0 comments on commit eeec46c

Please sign in to comment.