all commands (almost): cleaner DMS closing at the end
This commit is contained in:
@ -266,9 +266,9 @@ def run(config):
|
|||||||
# If the input and the output DMS are different, delete the temporary result view in the input DMS
|
# If the input and the output DMS are different, delete the temporary result view in the input DMS
|
||||||
if i_dms != o_dms:
|
if i_dms != o_dms:
|
||||||
View.delete_view(i_dms, o_view_name)
|
View.delete_view(i_dms, o_view_name)
|
||||||
o_dms.close()
|
o_dms.close(force=True)
|
||||||
|
|
||||||
i_dms.close()
|
i_dms.close(force=True)
|
||||||
|
|
||||||
logger("info", "Done.")
|
logger("info", "Done.")
|
||||||
|
|
@ -247,10 +247,10 @@ def run(config):
|
|||||||
#print("\n\nOutput view:\n````````````", file=sys.stderr)
|
#print("\n\nOutput view:\n````````````", file=sys.stderr)
|
||||||
#print(repr(view), file=sys.stderr)
|
#print(repr(view), file=sys.stderr)
|
||||||
|
|
||||||
input[0].close()
|
input[0].close(force=True)
|
||||||
if two_views:
|
if two_views:
|
||||||
rinput[0].close()
|
rinput[0].close(force=True)
|
||||||
output[0].close()
|
output[0].close(force=True)
|
||||||
|
|
||||||
logger("info", "Done.")
|
logger("info", "Done.")
|
||||||
|
|
@ -379,7 +379,7 @@ def run(config):
|
|||||||
# If the input and the output DMS are different, delete the temporary imported view used to create the final view
|
# If the input and the output DMS are different, delete the temporary imported view used to create the final view
|
||||||
if i_dms != o_dms:
|
if i_dms != o_dms:
|
||||||
View.delete_view(o_dms, imported_view_name)
|
View.delete_view(o_dms, imported_view_name)
|
||||||
o_dms.close()
|
o_dms.close(force=True)
|
||||||
i_dms.close()
|
i_dms.close(force=True)
|
||||||
|
|
||||||
logger("info", "Done.")
|
logger("info", "Done.")
|
||||||
|
@ -97,9 +97,9 @@ def run(config):
|
|||||||
# If the input and the output DMS are different, delete the temporary result view in the input DMS
|
# If the input and the output DMS are different, delete the temporary result view in the input DMS
|
||||||
if i_dms != o_dms:
|
if i_dms != o_dms:
|
||||||
View.delete_view(i_dms, o_view_name)
|
View.delete_view(i_dms, o_view_name)
|
||||||
o_dms.close()
|
o_dms.close(force=True)
|
||||||
|
|
||||||
i_dms.close()
|
i_dms.close(force=True)
|
||||||
|
|
||||||
logger("info", "Done.")
|
logger("info", "Done.")
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ def run(config):
|
|||||||
#print(repr(view), file=sys.stderr)
|
#print(repr(view), file=sys.stderr)
|
||||||
|
|
||||||
for d in idms_list:
|
for d in idms_list:
|
||||||
d.close()
|
d.close(force=True)
|
||||||
o_dms.close()
|
o_dms.close(force=True)
|
||||||
|
|
||||||
logger("info", "Done.")
|
logger("info", "Done.")
|
||||||
|
@ -124,8 +124,8 @@ def run(config):
|
|||||||
# If the input and the output DMS are different, delete the temporary result view in the input DMS
|
# If the input and the output DMS are different, delete the temporary result view in the input DMS
|
||||||
if i_dms != o_dms:
|
if i_dms != o_dms:
|
||||||
View.delete_view(i_dms, o_view_name)
|
View.delete_view(i_dms, o_view_name)
|
||||||
o_dms.close()
|
o_dms.close(force=True)
|
||||||
|
|
||||||
i_dms.close()
|
i_dms.close(force=True)
|
||||||
|
|
||||||
logger("info", "Done.")
|
logger("info", "Done.")
|
@ -56,3 +56,5 @@ def run(config):
|
|||||||
print(count2)
|
print(count2)
|
||||||
else:
|
else:
|
||||||
print(count1)
|
print(count1)
|
||||||
|
|
||||||
|
input[0].close(force=True)
|
||||||
|
@ -86,7 +86,7 @@ def run(config):
|
|||||||
if not BrokenPipeError and not IOError:
|
if not BrokenPipeError and not IOError:
|
||||||
output_object.close()
|
output_object.close()
|
||||||
iview.close()
|
iview.close()
|
||||||
input[0].close()
|
input[0].close(force=True)
|
||||||
|
|
||||||
logger("info", "Done.")
|
logger("info", "Done.")
|
||||||
|
|
||||||
|
@ -370,7 +370,7 @@ def run(config):
|
|||||||
# If the input and the output DMS are different, delete the temporary imported view used to create the final view
|
# If the input and the output DMS are different, delete the temporary imported view used to create the final view
|
||||||
if i_dms != o_dms:
|
if i_dms != o_dms:
|
||||||
View.delete_view(i_dms, o_view_name)
|
View.delete_view(i_dms, o_view_name)
|
||||||
o_dms.close()
|
o_dms.close(force=True)
|
||||||
i_dms.close()
|
i_dms.close(force=True)
|
||||||
|
|
||||||
logger("info", "Done.")
|
logger("info", "Done.")
|
||||||
|
@ -103,7 +103,7 @@ def run(config):
|
|||||||
# If the input and the output DMS are different, delete the temporary imported view used to create the final view
|
# If the input and the output DMS are different, delete the temporary imported view used to create the final view
|
||||||
if i_dms != o_dms:
|
if i_dms != o_dms:
|
||||||
View.delete_view(i_dms, o_view_name)
|
View.delete_view(i_dms, o_view_name)
|
||||||
o_dms.close()
|
o_dms.close(force=True)
|
||||||
i_dms.close()
|
i_dms.close(force=True)
|
||||||
|
|
||||||
logger("info", "Done.")
|
logger("info", "Done.")
|
||||||
|
@ -55,3 +55,4 @@ def run(config):
|
|||||||
else:
|
else:
|
||||||
raise Exception("ASCII history only available for views")
|
raise Exception("ASCII history only available for views")
|
||||||
|
|
||||||
|
input[0].close(force=True)
|
||||||
|
@ -46,5 +46,5 @@ def run(config):
|
|||||||
process.wait()
|
process.wait()
|
||||||
|
|
||||||
iview.close()
|
iview.close()
|
||||||
input[0].close()
|
input[0].close(force=True)
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ def run(config):
|
|||||||
l = []
|
l = []
|
||||||
for view in input[0]:
|
for view in input[0]:
|
||||||
l.append(tostr(view) + "\t(Date created: " + str(bytes2str_object(dms[view].comments["Date created"]))+")")
|
l.append(tostr(view) + "\t(Date created: " + str(bytes2str_object(dms[view].comments["Date created"]))+")")
|
||||||
|
dms[view].close()
|
||||||
l.sort()
|
l.sort()
|
||||||
for v in l:
|
for v in l:
|
||||||
print(v)
|
print(v)
|
||||||
@ -52,3 +53,4 @@ def run(config):
|
|||||||
print("\n### Comments:")
|
print("\n### Comments:")
|
||||||
print(str(input[1].comments))
|
print(str(input[1].comments))
|
||||||
|
|
||||||
|
input[0].close(force=True)
|
||||||
|
@ -141,7 +141,7 @@ def run(config):
|
|||||||
# If the input and the output DMS are different, delete the temporary imported view used to create the final view
|
# If the input and the output DMS are different, delete the temporary imported view used to create the final view
|
||||||
if i_dms != o_dms:
|
if i_dms != o_dms:
|
||||||
View.delete_view(i_dms, o_view_name)
|
View.delete_view(i_dms, o_view_name)
|
||||||
o_dms.close()
|
o_dms.close(force=True)
|
||||||
i_dms.close()
|
i_dms.close(force=True)
|
||||||
|
|
||||||
logger("info", "Done.")
|
logger("info", "Done.")
|
||||||
|
@ -106,7 +106,7 @@ def run(config):
|
|||||||
# If the input and the output DMS are different, delete the temporary imported view used to create the final view
|
# If the input and the output DMS are different, delete the temporary imported view used to create the final view
|
||||||
if i_dms != o_dms:
|
if i_dms != o_dms:
|
||||||
View.delete_view(i_dms, o_view_name)
|
View.delete_view(i_dms, o_view_name)
|
||||||
o_dms.close()
|
o_dms.close(force=True)
|
||||||
i_dms.close()
|
i_dms.close(force=True)
|
||||||
|
|
||||||
logger("info", "Done.")
|
logger("info", "Done.")
|
||||||
|
@ -529,7 +529,7 @@ def run(config):
|
|||||||
test_taxo(config, infos)
|
test_taxo(config, infos)
|
||||||
|
|
||||||
infos['view'].close()
|
infos['view'].close()
|
||||||
infos['dms'].close()
|
infos['dms'].close(force=True)
|
||||||
shutil.rmtree(config['obi']['defaultdms']+'.obidms', ignore_errors=True)
|
shutil.rmtree(config['obi']['defaultdms']+'.obidms', ignore_errors=True)
|
||||||
|
|
||||||
print("Done.")
|
print("Done.")
|
||||||
|
Reference in New Issue
Block a user