summaryrefslogtreecommitdiff
path: root/silx/app/view/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'silx/app/view/main.py')
-rw-r--r--silx/app/view/main.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/silx/app/view/main.py b/silx/app/view/main.py
index 90b8b17..8139175 100644
--- a/silx/app/view/main.py
+++ b/silx/app/view/main.py
@@ -1,6 +1,6 @@
# coding: utf-8
# /*##########################################################################
-# Copyright (C) 2016-2018 European Synchrotron Radiation Facility
+# Copyright (C) 2016-2019 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -27,10 +27,11 @@ __authors__ = ["V. Valls"]
__license__ = "MIT"
__date__ = "17/01/2019"
-import sys
import argparse
import logging
+import os
import signal
+import sys
_logger = logging.getLogger(__name__)
@@ -61,6 +62,12 @@ def createParser():
action="store_true",
default=False,
help='Start the application using new fresh user preferences')
+ parser.add_argument(
+ '--hdf5-file-locking',
+ dest="hdf5_file_locking",
+ action="store_true",
+ default=False,
+ help='Start the application with HDF5 file locking enabled (it is disabled by default)')
return parser
@@ -73,6 +80,11 @@ def mainQt(options):
# Import most of the things here to be sure to use the right logging level
#
+ # This needs to be done prior to load HDF5
+ hdf5_file_locking = 'TRUE' if options.hdf5_file_locking else 'FALSE'
+ _logger.info('Set HDF5_USE_FILE_LOCKING=%s', hdf5_file_locking)
+ os.environ['HDF5_USE_FILE_LOCKING'] = hdf5_file_locking
+
try:
# it should be loaded before h5py
import hdf5plugin # noqa