aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2014-10-06 04:42:06 +0200
committerSebastian Pipping <sebastian@pipping.org>2014-10-24 22:42:08 +0200
commit1e357447364a118ff284148a3be862d7969a36d5 (patch)
treeb77c31adb632b3c5c1ae1daf264d653ab796cb32
parentfix homepage (diff)
downloadelogv-1e357447364a118ff284148a3be862d7969a36d5.tar.gz
elogv-1e357447364a118ff284148a3be862d7969a36d5.tar.bz2
elogv-1e357447364a118ff284148a3be862d7969a36d5.zip
Make log filename parsing more robust (Gentoo bug 503904)
-rwxr-xr-xelogv8
1 files changed, 5 insertions, 3 deletions
diff --git a/elogv b/elogv
index 435d9ad..acd41de 100755
--- a/elogv
+++ b/elogv
@@ -370,9 +370,11 @@ class ElogViewer:
# then we split the string using as pattern / or : to obtain in any
# case
# ( "x11-themes", "haematite-xcursors", "1.0:20091018-195827.log")
- if not filepath.endswith == ".log":
- tmpfilepath = re.sub('\.log.*$', '.log', filepath)
- (cat,pn,other) = re.split(":|" + os.path.sep, tmpfilepath.replace(elogdir + os.path.sep, "") )
+ tmpfilepath = re.sub('\.log.*$', '.log', filepath)
+ split_up = re.split(":|" + os.path.sep, tmpfilepath.replace(elogdir + os.path.sep, ""))
+ if len(split_up) < 3:
+ continue
+ (cat, pn, other) = split_up[-3:]
if sys.version_info[:2] >= (2, 5):
date = datetime.strptime(other, "%Y%m%d-%H%M%S.log")
else: