mirror of
https://github.com/jessebot/dot_files.git
synced 2025-10-01 01:48:43 +00:00
add additional directories for creating python stuff
This commit is contained in:
parent
fbe917ebe5
commit
5626195e7e
1 changed files with 12 additions and 3 deletions
|
@ -4,13 +4,22 @@ import atexit
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import readline
|
import readline
|
||||||
from xdg_base_dirs import xdg_state_home
|
from xdg_base_dirs import xdg_state_home, xdg_cache_home, xdg_data_home
|
||||||
|
|
||||||
# define and create the state dir for python if it doesn't exist
|
# create the XDG_STATE_HOME/python dir if it doesn't exist
|
||||||
# state_dir = os.path.join(xdg_state_home(), 'python')
|
# most likely going to be $HOME/.local/state/python
|
||||||
state_dir = Path.joinpath(xdg_state_home(), 'python')
|
state_dir = Path.joinpath(xdg_state_home(), 'python')
|
||||||
Path(state_dir).mkdir(exist_ok=True)
|
Path(state_dir).mkdir(exist_ok=True)
|
||||||
|
|
||||||
|
# create the XDG_CACHE_HOME/python dir if it doesn't exist
|
||||||
|
# most likely going to be $HOME/.cache/python
|
||||||
|
cache_dir = Path.joinpath(xdg_cache_home(), 'python')
|
||||||
|
Path(cache_dir).mkdir(exist_ok=True)
|
||||||
|
|
||||||
|
# create the XDG_DATA_HOME/python dir if it doesn't exist
|
||||||
|
# most likely going to be $HOME/.local/share/python
|
||||||
|
data_dir = Path.joinpath(xdg_data_home(), 'python')
|
||||||
|
Path(data_dir).mkdir(exist_ok=True)
|
||||||
|
|
||||||
# define history file name
|
# define history file name
|
||||||
history = os.path.join(state_dir, 'history')
|
history = os.path.join(state_dir, 'history')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue