diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/globeop.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/python/globeop.py b/python/globeop.py index f214996e..a826204b 100644 --- a/python/globeop.py +++ b/python/globeop.py @@ -21,22 +21,22 @@ elif os.name == 'posix': root = '/home/share/Daily'
def get_ped(s):
- regex = re.search("PED=(.+?)\.", s)
+ regex = re.search("PED=([^.]+)", s)
if regex:
PED = datetime.datetime.strptime(regex.group(1), "%Y-%m-%d").date()
else:
- regex = re.search("(.+?)\.", s)
+ regex = re.search("([^.]+)", s)
PED = pd.to_datetime(regex.group(1), "%Y%m%d") - BDay(1)
PED = PED.date()
return PED
def key_fun(s):
PED = get_ped(s)
- regex = re.search("KD=(.+?)\.", s)
+ regex = re.search("KD=([^.]+)", s)
if regex:
KD = datetime.datetime.strptime(regex.group(1), "%Y-%m-%d-%H-%M-%S")
else:
- regex = re.search("(.+?\..+?)\.", s)
+ regex = re.search("([^.]+\.[^.]+)", s)
KD = datetime.datetime.strptime(regex.group(1), "%Y%m%d.%H%M%S")
return (PED, KD)
|
