Skip to content
Snippets Groups Projects
Commit 27f5e33b authored by Izzard's avatar Izzard
Browse files

still issues with the decorators...

parent eb9d4cac
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,7 @@ import json ...@@ -12,6 +12,7 @@ import json
import msgpack import msgpack
import os import os
import pathlib import pathlib
import subprocess
import time import time
from typing import Union, Any from typing import Union, Any
...@@ -734,9 +735,19 @@ class dataIO(): ...@@ -734,9 +735,19 @@ class dataIO():
def NFSpath(self,path): def NFSpath(self,path):
""" """
Test path to see if it's on an NFS mount. Test path to see if it's on an NFS mount.
"""
if os.path.exists(path) and os.path.ismount(path):
s = os.stat(path)
print(s)
# use `stat -f -L -c %T "$_[0]"`=~/^nfs/io ? 1 : 0; Args:
path : the path to be tested
Returns:
True : if on an NFS mount point.
False : if not.
None : if the path does not exist.
"""
if os.path.exists(path):
cmd = 'stat -f -L -c %T "' + path + '"'
return 'nfs' in subprocess.Popen(cmd,
shell=True,
stdout=subprocess.PIPE).stdout.read().decode()
else:
return None
...@@ -339,7 +339,7 @@ class spacing_functions(): ...@@ -339,7 +339,7 @@ class spacing_functions():
else: else:
__decorator = __dummy_decorator __decorator = __dummy_decorator
@__decorator() @__decorator
def _const_dt(cachedir=None, def _const_dt(cachedir=None,
num_cores=None, num_cores=None,
bse_options_json=None, # JSON string bse_options_json=None, # JSON string
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment