Onionr/onionr/utils/createdirs.py

16 lines
437 B
Python
Raw Normal View History

2019-07-20 06:02:30 +00:00
import os
2019-07-18 17:40:48 +00:00
from . import identifyhome
import dbcreator, filepaths
home = identifyhome.identify_home()
2019-07-20 06:02:30 +00:00
def create_dirs():
2019-07-27 02:42:55 +00:00
gen_dirs = [home, filepaths.block_data_location, filepaths.contacts_location, filepaths.export_location]
for path in gen_dirs:
if not os.path.exists(path):
os.mkdir(path)
2019-07-18 17:40:48 +00:00
2019-07-20 06:02:30 +00:00
for db in dbcreator.create_funcs:
try:
db()
except FileExistsError:
pass