Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
4df808fe
Commit
4df808fe
authored
Aug 16, 2015
by
Andrew Gibiansky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for ipython 4
parent
801d35b4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
11 deletions
+18
-11
ZeroMQ.hs
ipython-kernel/src/IHaskell/IPython/ZeroMQ.hs
+3
-3
IPython.hs
src/IHaskell/IPython.hs
+14
-7
stack.yaml
stack.yaml
+1
-1
No files found.
ipython-kernel/src/IHaskell/IPython/ZeroMQ.hs
View file @
4df808fe
...
@@ -143,9 +143,9 @@ bindLocalEphemeralPort socket = do
...
@@ -143,9 +143,9 @@ bindLocalEphemeralPort socket = do
-- The sockets will be closed when the callback returns.
-- The sockets will be closed when the callback returns.
withEphemeralPorts
::
ByteString
-- ^ HMAC encryption key
withEphemeralPorts
::
ByteString
-- ^ HMAC encryption key
->
Bool
-- ^ Print debug output
->
Bool
-- ^ Print debug output
->
(
ZeroMQEphemeralPorts
->
ZeroMQInterface
->
IO
a
)
-- ^ Callback that takes the
->
(
ZeroMQEphemeralPorts
-- interface to th
e
->
ZeroMQInterfac
e
--
sockets.
->
IO
a
)
-- ^ Callback that takes the interface to the
sockets.
->
IO
a
->
IO
a
withEphemeralPorts
key
debug
callback
=
do
withEphemeralPorts
key
debug
callback
=
do
channels
<-
newZeroMQInterface
key
channels
<-
newZeroMQInterface
key
...
...
src/IHaskell/IPython.hs
View file @
4df808fe
...
@@ -69,7 +69,7 @@ ipython suppress args = do
...
@@ -69,7 +69,7 @@ ipython suppress args = do
liftIO
$
installHandler
keyboardSignal
(
CatchOnce
$
return
()
)
Nothing
liftIO
$
installHandler
keyboardSignal
(
CatchOnce
$
return
()
)
Nothing
-- We have this because using `run` does not let us use stdin.
-- We have this because using `run` does not let us use stdin.
SH
.
runHandles
"
ipython
"
args
handles
doNothing
SH
.
runHandles
"
jupyter
"
args
handles
doNothing
where
where
handles
=
[
SH
.
InHandle
SH
.
Inherit
,
outHandle
suppress
,
errorHandle
suppress
]
handles
=
[
SH
.
InHandle
SH
.
Inherit
,
outHandle
suppress
,
errorHandle
suppress
]
...
@@ -128,18 +128,25 @@ replaceIPythonKernelspec kernelSpecOpts = SH.shelly $ do
...
@@ -128,18 +128,25 @@ replaceIPythonKernelspec kernelSpecOpts = SH.shelly $ do
-- | Verify that a proper version of IPython is installed and accessible.
-- | Verify that a proper version of IPython is installed and accessible.
verifyIPythonVersion
::
SH
.
Sh
()
verifyIPythonVersion
::
SH
.
Sh
()
verifyIPythonVersion
=
do
verifyIPythonVersion
=
do
pathMay
<-
SH
.
which
"ipython"
pathMay
<-
SH
.
which
"jupyter"
case
pathMay
of
pathMay'
<-
SH
.
which
"ipython"
Nothing
->
badIPython
"No IPython detected -- install IPython 3.0+ before using IHaskell."
case
(
pathMay
,
pathMay'
)
of
Just
path
->
do
(
Nothing
,
Nothing
)
->
badIPython
"No Jupyter detected -- install Jupyter 3.0+ before using IHaskell."
output
<-
T
.
unpack
<$>
SH
.
silently
(
SH
.
run
path
[
"--version"
])
(
Just
path
,
_
)
->
do
SH
.
silently
(
SH
.
run
path
[
"--version"
])
output
<-
T
.
unpack
<$>
SH
.
lastStderr
case
parseVersion
output
of
case
parseVersion
output
of
Just
(
4
:
_
)
->
return
()
Just
(
4
:
_
)
->
return
()
Just
(
3
:
_
)
->
return
()
Just
(
3
:
_
)
->
return
()
Just
(
2
:
_
)
->
oldIPython
Just
(
2
:
_
)
->
oldIPython
Just
(
1
:
_
)
->
oldIPython
Just
(
1
:
_
)
->
oldIPython
Just
(
0
:
_
)
->
oldIPython
Just
(
0
:
_
)
->
oldIPython
_
->
badIPython
"Detected IPython, but could not parse version number."
_
->
badIPython
"Detected Jupyter, but could not parse version number."
(
_
,
Just
path
)
->
do
output
<-
T
.
unpack
<$>
SH
.
silently
(
SH
.
run
path
[
"--version"
])
case
parseVersion
output
of
Just
(
x
:
_
)
->
if
x
>=
3
then
return
()
else
oldIPython
_
->
badIPython
"Detected Jupyter, but could not parse version number."
where
where
badIPython
::
Text
->
SH
.
Sh
()
badIPython
::
Text
->
SH
.
Sh
()
...
...
stack.yaml
View file @
4df808fe
...
@@ -37,4 +37,4 @@ extra-deps:
...
@@ -37,4 +37,4 @@ extra-deps:
-
system-argv0-0.1.1
-
system-argv0-0.1.1
-
vinyl-0.5.1
-
vinyl-0.5.1
-
xformat-0.1.2.1
-
xformat-0.1.2.1
resolver
:
nightly-2015-08-1
0
resolver
:
nightly-2015-08-1
5
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment