index
execution_count
cell_type
toolbar
started_at
completed_at
source
loc
metadata
outputs
1
unexecuted
In
[
]
markdown
# configuration files
i'm going to include my configuration files in this package. it seems like a great place to keep them for consistency.
we can import them.
metadata
4
i'm going to include my configuration files in this package. it seems like a great place to keep them for consistency.
we can import them.
2
unexecuted
In
[
None
]
code
from tonyfast import ipython_config , jupyter_lab_config
metadata
1
Out
[
None
]
3
unexecuted
In
[
]
markdown
the configurations on the `c` symbol staying consistent with traitlets configurations.
metadata
1
the configurations on the
c
symbol staying consistent with traitlets configurations.
4
unexecuted
In
[
None
]
code
metadata
1
Out
[
None
]
5
unexecuted
In
[
]
markdown
then we can apply the configuration files to the property directories.
`IPython` and `jupyter_core` ship their path locations
metadata
2
then we can apply the configuration files to the property directories.
IPython
and
jupyter_core
ship their path locations
6
unexecuted
In
[
None
]
code
import IPython.paths , jupyter_core.paths
from pathlib import Path
metadata
2
Out
[
None
]
7
unexecuted
In
[
None
]
code
JUPYTER = Path ( jupyter_core . paths . jupyter_config_dir ())
IPYTHON = Path ( IPython . paths . get_ipython_dir ())
metadata
2
Out
[
None
]
8
unexecuted
In
[
]
markdown
set the configuration files for `IPython` and `jupyter`
metadata
1
set the configuration files for
IPython
and
jupyter
9
unexecuted
In
[
None
]
code
def set_configs ( use_platform_dir : bool = True ):
import shutil
if use_platform_dir :
shutil . copy ( jupyter_lab_config . __file__ , JUPYTER / Path ( jupyter_lab_config . __file__ ) . name )
shutil . copy ( ipython_config . __file__ , IPYTHON / Path ( ipython_config . __file__ ) . name )
else :
shutil . copy ( jupyter_lab_config . __file__ , Path ( jupyter_lab_config . __file__ ) . name )
shutil . copy ( ipython_config . __file__ , Path ( ipython_config . __file__ ) . name )
metadata
8
Out
[
None
]
10
unexecuted
In
[
None
]
code
if __name__ == "__main__" :
if "__file__" in locals ():
__import__ ( "typer" ) . run ( set_configs )
else :
! importnb 2022 - 12 - 31 - jupyter - config - files . ipynb -- help
metadata
5
Out
[
None
]