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
e52d4181
Commit
e52d4181
authored
Oct 27, 2013
by
Andrew Gibiansky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding more general configuration mechanism.
parent
89fdda8a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
36 additions
and
11 deletions
+36
-11
IHaskell.cabal
IHaskell.cabal
+1
-0
Config.hs
IHaskell/Config.hs
+17
-0
IPython.hs
IHaskell/IPython.hs
+8
-11
ipython_config.py
config/ipython_config.py
+7
-0
ipython_console_config.py
config/ipython_console_config.py
+1
-0
ipython_notebook_config.py
config/ipython_notebook_config.py
+1
-0
ipython_qtconsole_config.py
config/ipython_qtconsole_config.py
+1
-0
No files found.
IHaskell.cabal
View file @
e52d4181
...
...
@@ -86,5 +86,6 @@ executable IHaskell
shelly ==1.3.*,
system-argv0,
directory,
here,
system-filepath,
text ==0.11.*
IHaskell/Config.hs
0 → 100644
View file @
e52d4181
{-# LANGUAGE QuasiQuotes #-}
module
IHaskell.Config
(
ipython
,
notebook
,
console
,
qtconsole
)
where
import
Data.String.Here
import
ClassyPrelude
ipython
::
String
->
String
ipython
executable
=
[
template
|
config/ipython_config.py
|]
notebook
::
String
notebook
=
[
template
|
config/ipython_notebook_config.py
|]
console
::
String
console
=
[
template
|
config/ipython_console_config.py
|]
qtconsole
::
String
qtconsole
=
[
template
|
config/ipython_qtconsole_config.py
|]
IHaskell/IPython.hs
View file @
e52d4181
...
...
@@ -10,6 +10,8 @@ import System.Argv0
import
System.Directory
import
qualified
Filesystem.Path.CurrentOS
as
FS
import
qualified
IHaskell.Config
as
Config
-- | Run IPython with any arguments.
ipython
::
[
Text
]
->
Sh
()
ipython
args
=
do
...
...
@@ -64,18 +66,13 @@ setupIPythonProfile profile = shelly $ do
writeConfigFilesTo
::
Text
-- ^ Profile directory to write to. Must have a trailing slash.
->
String
-- ^ Path to IHaskell executable.
->
Sh
()
writeConfigFilesTo
profileDir
ihaskellPath
=
writeFile
(
fromText
configFile
)
config
writeConfigFilesTo
profileDir
ihaskellPath
=
do
writeFile
(
conf
"ipython_config.py"
)
$
Config
.
ipython
ihaskellPath
writeFile
(
conf
"ipython_notebook_config.py"
)
Config
.
notebook
writeFile
(
conf
"ipython_console_config.py"
)
Config
.
console
writeFile
(
conf
"ipython_qtconsole_config.py"
)
Config
.
qtconsole
where
configFile
=
profileDir
++
"ipython_config.py"
config
::
String
config
=
unlines
[
"c = get_config()"
,
printf
"exe = '%s'.replace(' ', '
\\\\
')"
ihaskellPath
,
"c.KernelManager.kernel_cmd = [exe, 'kernel', '{connection_file}']"
,
"c.Session.key = b''"
,
"c.Session.keyfile = b''"
]
conf
filename
=
fromText
$
profileDir
++
filename
-- | Get the absolute path to this IHaskell executable.
getIHaskellPath
::
Sh
String
...
...
config/ipython_config.py
0 → 100644
View file @
e52d4181
# Available Subsitutions:
# ${executable}: Path to IHaskell kernel.
c
=
get_config
()
exe
=
'${executable}'
.
replace
(
' '
,
'
\\\\
'
)
c
.
KernelManager
.
kernel_cmd
=
[
exe
,
'kernel'
,
'{connection_file}'
]
c
.
Session
.
key
=
b
''
c
.
Session
.
keyfile
=
b
''
config/ipython_console_config.py
0 → 100644
View file @
e52d4181
# Empty.
config/ipython_notebook_config.py
0 → 100644
View file @
e52d4181
# Empty.
config/ipython_qtconsole_config.py
0 → 100644
View file @
e52d4181
# Empty.
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