aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2023-04-07 03:35:52 +0200
committerache <ache@ache.one>2023-04-07 03:35:52 +0200
commit7666988f3cae377477a3e2f83e6218b2f80bbff0 (patch)
tree27cceb30e99f267ae828da04ca1123d08a0655c5
parentRemove trailing spaces (diff)
[autoMMS]Improove strip
-rwxr-xr-xautoMMS.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/autoMMS.py b/autoMMS.py
index f691e19..34302de 100755
--- a/autoMMS.py
+++ b/autoMMS.py
@@ -17,13 +17,13 @@ if __name__ == "__main__":
with open(sys.argv[1],'r') as f:
for line in f:
if "Text00 = " in line:
- info = line[9:-1] # 9 = len('Text00 = ') ,strip the final '\n'
+ info = line.split(' = ')[1].strip() # 9 = len('Text00 = ') ,strip the final '\n'
elif line.startswith('Text'):
- info += line[9:-1]
+ info += line.split(' = ')[1].strip()
if line.startswith('DateTime'):
- date = line[9:-1]
- time = time.strptime(date, '%Y%m%dT%H%M%S')
- if info :
+ date = line.split(' = ')[1].strip()
+ timeInfo = time.strptime(date, '%Y%m%dT%H%M%S')
+ if info:
a = info
else:
print("Error : MMS invalide format, no data info found")