mirror of
https://github.com/aljazceru/hummingbot-dashboard.git
synced 2026-01-02 04:54:24 +01:00
(feat) add os_functionalities
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
import yaml
|
||||
|
||||
|
||||
@@ -7,6 +9,20 @@ def remove_files_from_directory(directory: str):
|
||||
os.remove(f"{directory}/{file}")
|
||||
|
||||
|
||||
def remove_directory(directory: str):
|
||||
process = subprocess.Popen(f"rm -rf {directory}", shell=True)
|
||||
process.wait()
|
||||
|
||||
def dump_dict_to_yaml(data_dict, filename):
|
||||
with open(filename, 'w') as file:
|
||||
yaml.dump(data_dict, file)
|
||||
|
||||
|
||||
def read_yaml_file(file_path):
|
||||
with open(file_path, 'r') as file:
|
||||
data = yaml.safe_load(file)
|
||||
return data
|
||||
|
||||
|
||||
def directory_exists(directory: str):
|
||||
return os.path.exists(directory)
|
||||
|
||||
Reference in New Issue
Block a user