Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
debomatic-webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
debomatic-webui-admins
debomatic-webui
Commits
6b7d7b02
Commit
6b7d7b02
authored
Jul 17, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
smarter and more efficient way to get last line in piuparts
parent
3a282105
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
debomatic-modules/JSONLogger.py
debomatic-modules/JSONLogger.py
+8
-1
No files found.
debomatic-modules/JSONLogger.py
View file @
6b7d7b02
...
@@ -204,7 +204,14 @@ class LogParser():
...
@@ -204,7 +204,14 @@ class LogParser():
def
parse_piuparts
(
self
):
def
parse_piuparts
(
self
):
with
open
(
self
.
file
,
'r'
)
as
fd
:
with
open
(
self
.
file
,
'r'
)
as
fd
:
last_line
=
fd
.
readlines
()[
-
1
]
offs
=
-
1024
while
True
:
fd
.
seek
(
offs
,
2
)
lines
=
fd
.
readlines
()
if
len
(
lines
)
>
1
:
last_line
=
lines
[
-
1
]
break
offs
*=
2
if
last_line
.
find
(
'ERROR:'
)
>=
0
:
if
last_line
.
find
(
'ERROR:'
)
>=
0
:
return
'E'
return
'E'
return
None
return
None
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment