Skip to content

Commit

Permalink
log folder creation
Browse files Browse the repository at this point in the history
  • Loading branch information
alpha-xone committed Apr 17, 2021
1 parent 9d4422b commit 4e4dc82
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion xbbg/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Intuitive Bloomberg data API"""

__version__ = '0.7.6a7'
__version__ = '0.7.6a8'
8 changes: 6 additions & 2 deletions xbbg/core/trials.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ def num_trials(**kwargs) -> int:
data_path = root_path()
if not data_path: return 0

with db.SQLite(f'{data_path}/Logs/xbbg.db') as con:
db_file = f'{data_path}/Logs/xbbg.db'
files.create_folder(db_file, is_file=True)
with db.SQLite(db_file) as con:
con.execute(TRIALS_TABLE)
num = con.execute(db.select(
table='trials',
Expand All @@ -119,7 +121,9 @@ def update_trials(**kwargs):
if 'cnt' not in kwargs:
kwargs['cnt'] = num_trials(**kwargs) + 1

with db.SQLite(f'{data_path}/Logs/xbbg.db') as con:
db_file = f'{data_path}/Logs/xbbg.db'
files.create_folder(db_file, is_file=True)
with db.SQLite(db_file) as con:
con.execute(TRIALS_TABLE)
con.execute(db.replace_into(
table='trials',
Expand Down

0 comments on commit 4e4dc82

Please sign in to comment.