Skip to content

Commit

Permalink
restructure (#175)
Browse files Browse the repository at this point in the history
Part of the clean up was to make all of the db function fail if open had not been called first. Modified dawgie.tools.trace to open and close the db always since the pipeline has correctly closed it already.
  • Loading branch information
al-niessner authored Aug 2, 2022
1 parent 2118848 commit 2974a46
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Python/dawgie/tools/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ def main (fn:str=None, at=None):
images = ''
routes = {}
traces = {}
dawgie.db.open()
for root in at: routes.update (_trace (root))
for key in sorted (routes, key='.'.join):
algs = set()
Expand Down Expand Up @@ -194,6 +195,8 @@ def main (fn:str=None, at=None):
os.makedirs (os.path.dirname (fn))
shutil.move (tfn, fn)
else: webbrowser.open_new_tab ('file://' + tfn)

dawgie.db.close()
return

if __name__ == '__main__':
Expand Down Expand Up @@ -223,9 +226,7 @@ def main (fn:str=None, at=None):
args = ap.parse_args()
dawgie.context.log_level = args.log_level
dawgie.context.override (args)
dawgie.db.open()
dawgie.tools.trace.main(fn=args.file_name)
dawgie.db.close()
else:
import dawgie.context
import dawgie.db
Expand Down

0 comments on commit 2974a46

Please sign in to comment.