Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AossTower
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MetObs
AossTower
Commits
c1f5e2ea
Commit
c1f5e2ea
authored
10 years ago
by
Bruce Flynn
Browse files
Options
Downloads
Patches
Plain Diff
Fix _make_frames
parent
84f20276
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aosstower/l00/parser.py
+5
-4
5 additions, 4 deletions
aosstower/l00/parser.py
with
5 additions
and
4 deletions
aosstower/l00/parser.py
+
5
−
4
View file @
c1f5e2ea
...
@@ -57,16 +57,17 @@ class LineParseError(Exception):
...
@@ -57,16 +57,17 @@ class LineParseError(Exception):
def
_make_frame
(
data
):
def
_make_frame
(
data
):
"""
Construct a frame from a list of tuples.
"""
Construct a frame from a list of tuples.
"""
"""
frame
=
{}
for
key
,
value
in
data
:
for
key
,
value
in
data
:
if
key
==
'
stamp
'
:
if
key
==
'
stamp
'
:
continue
continue
if
key
in
database
:
if
key
in
database
:
try
:
try
:
data
[
key
]
=
database
[
key
].
type
(
data
[
key
]
)
frame
[
key
]
=
database
[
key
].
type
(
value
)
except
(
ValueError
,
TypeError
):
except
(
ValueError
,
TypeError
):
raise
LineParseError
(
"
error converting
'
%s
'
using %s
"
,
raise
LineParseError
(
"
error converting
'
%s
'
using %s
"
,
data
[
key
]
,
database
[
key
].
type
)
value
,
database
[
key
].
type
)
return
data
return
frame
class
ParserV0
(
object
):
class
ParserV0
(
object
):
...
@@ -169,7 +170,7 @@ def read_frames(source, error_handler=lambda *a: None):
...
@@ -169,7 +170,7 @@ def read_frames(source, error_handler=lambda *a: None):
for
parser
in
[
ParserV1V2
(),
ParserV0
()]:
for
parser
in
[
ParserV1V2
(),
ParserV0
()]:
if
parser
.
maybe_mine
(
line
):
if
parser
.
maybe_mine
(
line
):
try
:
try
:
yield
parser
.
pars
e
(
line
)
yield
parser
.
make_fram
e
(
line
)
except
LineParseError
as
err
:
except
LineParseError
as
err
:
error_handler
(
idx
+
1
,
line
,
err
)
error_handler
(
idx
+
1
,
line
,
err
)
break
break
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment