Merge branch 'develop' of ariadne.geophysik.ruhr-uni-bochum.de:/data/git/pylot into develop
This commit is contained in:
commit
20e86cee5a
@ -39,7 +39,7 @@ class Data(object):
|
|||||||
elif isinstance(evtdata, dict):
|
elif isinstance(evtdata, dict):
|
||||||
evt = readPILOTEvent(**evtdata)
|
evt = readPILOTEvent(**evtdata)
|
||||||
evtdata = evt
|
evtdata = evt
|
||||||
elif isinstance(evtdata, str):
|
elif isinstance(evtdata, basestring):
|
||||||
try:
|
try:
|
||||||
cat = read_events(evtdata)
|
cat = read_events(evtdata)
|
||||||
if len(cat) is not 1:
|
if len(cat) is not 1:
|
||||||
|
@ -5,10 +5,7 @@ import hashlib
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
from scipy.interpolate import splrep, splev
|
from scipy.interpolate import splrep, splev
|
||||||
import os
|
import os
|
||||||
try:
|
import platform
|
||||||
import pwd
|
|
||||||
except:
|
|
||||||
print('Warning: Could not import module pwd')
|
|
||||||
import re
|
import re
|
||||||
import warnings
|
import warnings
|
||||||
import subprocess
|
import subprocess
|
||||||
@ -271,7 +268,15 @@ def getOwner(fn):
|
|||||||
:type fn: str
|
:type fn: str
|
||||||
:return: login ID of the file's owner
|
:return: login ID of the file's owner
|
||||||
'''
|
'''
|
||||||
|
system_name = platform.system()
|
||||||
|
if system_name in ["Linux", "Darwin"]:
|
||||||
|
import pwd
|
||||||
return pwd.getpwuid(os.stat(fn).st_uid).pw_name
|
return pwd.getpwuid(os.stat(fn).st_uid).pw_name
|
||||||
|
elif system_name == "Windows":
|
||||||
|
import win32security
|
||||||
|
f = win32security.GetFileSecurity(fn, win32security.OWNER_SECURITY_INFORMATION)
|
||||||
|
(username, domain, sid_name_use) = win32security.LookupAccountSid(None, f.GetSecurityDescriptorOwner())
|
||||||
|
return username
|
||||||
|
|
||||||
|
|
||||||
def getPatternLine(fn, pattern):
|
def getPatternLine(fn, pattern):
|
||||||
|
Loading…
Reference in New Issue
Block a user