catch non string type input for filename construction
This commit is contained in:
parent
3cb73fb948
commit
ba7ab07473
@ -12,7 +12,10 @@ import obspy.core.event as ope
|
|||||||
|
|
||||||
|
|
||||||
def fnConstructor(s):
|
def fnConstructor(s):
|
||||||
s = s.split('/')[-1]
|
if type(s) is str:
|
||||||
|
s = s.split('/')[-1]
|
||||||
|
else:
|
||||||
|
s = getHash(UTCDateTime())
|
||||||
|
|
||||||
badchars = re.compile(r'[^A-Za-z0-9_. ]+|^\.|\.$|^ | $|^$')
|
badchars = re.compile(r'[^A-Za-z0-9_. ]+|^\.|\.$|^ | $|^$')
|
||||||
badsuffix = re.compile(r'(aux|com[1-9]|con|lpt[1-9]|prn)(\.|$)')
|
badsuffix = re.compile(r'(aux|com[1-9]|con|lpt[1-9]|prn)(\.|$)')
|
||||||
|
Loading…
Reference in New Issue
Block a user