Commit 94338f8d authored by Sumit Sahrawat's avatar Sumit Sahrawat Committed by GitHub

Merge pull request #666 from sumitsahrawat/ipython-replyto-config

Fix issue #665: Make EasyKernel more configurable
parents c783897d 6659dd83
......@@ -72,6 +72,9 @@ script:
cd "$TOP";
done
# Ensure that ipython-kernel examples build successfully.
stack build ipython-kernel --flag ipython-kernel:examples
# Ensure that IHaskell notebook remains unchanged.
# Run the notebook to regenerate the outputs, then compare the new notebook to the old one.
stack install --stack-yaml=stack-full.yaml
......
......@@ -233,6 +233,10 @@ mkConfig var = KernelConfig
, inspectInfo = langInfo
, run = parseAndRun
, debug = False
, kernelBanner = "Expanded Hutton's Razor"
, kernelProtocolVersion = "5.0"
, kernelImplName = "expanded_huttons_razor"
, kernelImplVersion = "0.0"
}
where
displayRes (Left err) =
......
......@@ -130,6 +130,10 @@ simpleConfig = KernelConfig
, inspectInfo = languageInspect
, run = languageRun
, debug = False
, kernelBanner = "Simple Arithmetic Expressions"
, kernelProtocolVersion = "5.0"
, kernelImplName = "funcalc"
, kernelImplVersion = "0.0"
}
main :: IO ()
......
......@@ -77,6 +77,14 @@ data KernelConfig m output result =
-- should be handled by defining an appropriate error constructor in your result type.
, run :: T.Text -> IO () -> (output -> IO ()) -> m (result, ExecuteReplyStatus, String)
, debug :: Bool -- ^ Whether to print extra debugging information to
-- | A One-line description of the kernel
, kernelBanner :: String
-- | The version of the messaging specification used by the kernel
, kernelProtocolVersion :: String
-- | Name of the kernel implementation
, kernelImplName :: String
-- | Version of the kernel implementation
, kernelImplVersion :: String
}
-- Install the kernelspec, using the `writeKernelspec` field of the kernel configuration.
......@@ -160,9 +168,12 @@ replyTo config _ _ KernelInfoRequest{} replyHeader =
KernelInfoReply
{ header = replyHeader
, languageInfo = kernelLanguageInfo config
, implementation = "ipython-kernel.EasyKernel"
, implementationVersion = "0.0"
, implementation = kernelImplName config
, implementationVersion = kernelImplVersion config
, banner = kernelBanner config
, protocolVersion = kernelProtocolVersion config
}
replyTo config _ interface ShutdownRequest { restartPending = pending } replyHeader = do
liftIO $ writeChan (shellReplyChannel interface) $ ShutdownReply replyHeader pending
liftIO exitSuccess
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment