Commit 9036da3d authored by Andrew Gibiansky's avatar Andrew Gibiansky

made stdin work

parent 699e292b
......@@ -7,6 +7,7 @@
// Only load this script once.
var kernel = IPython.notebook.kernel;
var initialized = kernel !== undefined && kernel != null;
console.log("Initialized", initialized);
if (initialized && window.parsecWidgetRegistered === undefined) {
// Do not load this script again.
......
......@@ -141,7 +141,6 @@ executable IHaskell
directory -any,
ghc ==7.6.*,
ihaskell -any,
ipython-kernel -any,
MissingH >=1.2,
text -any,
unix >= 2.6
......@@ -173,7 +172,6 @@ Test-Suite hspec
hspec -any,
HTTP -any,
HUnit -any,
ipython-kernel -any,
MissingH >=1.2,
mtl >=2.1,
parsec -any,
......
......@@ -2,7 +2,7 @@
"metadata": {
"language": "haskell",
"name": "",
"signature": "sha256:a97e75023c94aa5ee7bcd22c902e508c1e4d91e89ccea56df5c4fec8f369f94a"
"signature": "sha256:e714927a2d2b479853e19f3784692d8043ea0de9bcba6778363470d13d4f3f85"
},
"nbformat": 3,
"nbformat_minor": 0,
......@@ -44,8 +44,7 @@
"metadata": {},
"output_type": "display_data"
}
],
"prompt_number": 2
]
},
{
"cell_type": "code",
......@@ -84,17 +83,8 @@
" return (read (value ++ \".\" ++ after) :: Float)\n",
" \n",
" -- Parse any whitespace\n",
" whitespace = many $ oneOf \" \\t\""
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 1
},
{
"cell_type": "code",
"collapsed": false,
"input": [
" whitespace = many $ oneOf \" \\t\"\n",
"\n",
"parser"
],
"language": "python",
......@@ -111,6 +101,7 @@
"// Only load this script once.\n",
"var kernel = IPython.notebook.kernel;\n",
"var initialized = kernel !== undefined && kernel != null;\n",
"console.log(\"Initialized\", initialized);\n",
"if (initialized && window.parsecWidgetRegistered === undefined) {\n",
"\n",
"// Do not load this script again.\n",
......@@ -194,7 +185,7 @@
"output_type": "display_data"
}
],
"prompt_number": 9
"prompt_number": 1
},
{
"cell_type": "code",
......
......@@ -106,7 +106,7 @@ globalImports :: [String]
globalImports =
[ "import IHaskell.Display()"
, "import qualified IHaskell.Display"
, "import qualified IPython.Stdin"
, "import qualified IHaskell.IPython.Stdin"
, "import qualified System.Posix.IO as IHaskellIO"
, "import qualified System.IO as IHaskellSysIO"
]
......@@ -134,7 +134,7 @@ interpret allowedStdin action = runGhc (Just libdir) $ do
-- Close stdin so it can't be used.
-- Otherwise it'll block the kernel forever.
dir <- liftIO getIHaskellDir
let cmd = printf "IPython.Stdin.fixStdin \"%s\"" dir
let cmd = printf "IHaskell.IPython.Stdin.fixStdin \"%s\"" dir
when allowedStdin $ void $
runStmt cmd RunToCompletion
......
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