feat: add replication again
feat: non existent config folder
This commit is contained in:
4
.gitmodules
vendored
4
.gitmodules
vendored
@ -1,3 +1,3 @@
|
|||||||
[submodule "libs/replication"]
|
[submodule "multi_user/libs/replication"]
|
||||||
path = libs/replication
|
path = multi_user/libs/replication
|
||||||
url = git@gitlab.com:slumber/replication.git
|
url = git@gitlab.com:slumber/replication.git
|
||||||
|
@ -35,6 +35,7 @@ def save_config(config):
|
|||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
logger.info("saving config")
|
logger.info("saving config")
|
||||||
|
|
||||||
with open(CONFIG, 'w') as outfile:
|
with open(CONFIG, 'w') as outfile:
|
||||||
yaml.dump(config, outfile, default_flow_style=False)
|
yaml.dump(config, outfile, default_flow_style=False)
|
||||||
|
|
||||||
@ -65,6 +66,9 @@ def install_package(name):
|
|||||||
subprocess.run([str(PYTHON_PATH), "-m", "pip", "install",
|
subprocess.run([str(PYTHON_PATH), "-m", "pip", "install",
|
||||||
name, '--target', target], cwd=SUBPROCESS_DIR)
|
name, '--target', target], cwd=SUBPROCESS_DIR)
|
||||||
|
|
||||||
|
def check_dir(dir):
|
||||||
|
if not os.path.exists(dir):
|
||||||
|
os.makedirs(dir)
|
||||||
|
|
||||||
def setup(dependencies, python_path):
|
def setup(dependencies, python_path):
|
||||||
global PYTHON_PATH, SUBPROCESS_DIR
|
global PYTHON_PATH, SUBPROCESS_DIR
|
||||||
@ -72,6 +76,9 @@ def setup(dependencies, python_path):
|
|||||||
PYTHON_PATH = Path(python_path)
|
PYTHON_PATH = Path(python_path)
|
||||||
SUBPROCESS_DIR = PYTHON_PATH.parent
|
SUBPROCESS_DIR = PYTHON_PATH.parent
|
||||||
|
|
||||||
|
check_dir(CACHE_DIR)
|
||||||
|
check_dir(CONFIG_DIR)
|
||||||
|
|
||||||
if not module_can_be_imported("pip"):
|
if not module_can_be_imported("pip"):
|
||||||
install_pip()
|
install_pip()
|
||||||
|
|
||||||
|
1
multi_user/libs/replication
Submodule
1
multi_user/libs/replication
Submodule
Submodule multi_user/libs/replication added at 7eecb7fe46
Reference in New Issue
Block a user