Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Oceano2python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
US191
Oceano2python
Commits
61d2f59d
Commit
61d2f59d
authored
5 years ago
by
jacques Grelet
Browse files
Options
Downloads
Patches
Plain Diff
__skip_header is realy private
parent
9b00e2f2
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
file_extractor.py
+7
-9
7 additions, 9 deletions
file_extractor.py
oceano.py
+0
-1
0 additions, 1 deletion
oceano.py
with
7 additions
and
10 deletions
file_extractor.py
+
7
−
9
View file @
61d2f59d
...
...
@@ -34,7 +34,7 @@ class FileExtractor:
self
.
FillValue
=
1e36
# private:
self
.
skip_header
=
skip_header
self
.
__
skip_header
=
skip_header
self
.
__header
=
{}
self
.
__data
=
{}
# overloading operators
...
...
@@ -103,13 +103,10 @@ class FileExtractor:
n
=
0
m
=
0
#print(device, cfg[device.lower()])
print
(
device
)
# set skip_header is declared in toml section, 0 by default
if
'
skikHeader
'
in
cfg
[
device
.
lower
()]:
self
.
skip_header
=
cfg
[
device
.
lower
()][
'
skipHeader
'
]
#
logging
.
debug
(
self
.
skip_header
)
# set skipHeader is declared in toml section, 0 by default
if
'
skipHeader
'
in
cfg
[
device
.
lower
()]:
self
.
__skip_header
=
cfg
[
device
.
lower
()][
'
skipHeader
'
]
logging
.
debug
(
self
.
__skip_header
)
# get the dictionary from toml block, device must be is in lower case
hash
=
cfg
[
'
split
'
][
device
.
lower
()]
...
...
@@ -124,7 +121,7 @@ class FileExtractor:
with
fileinput
.
input
(
file
,
openhook
=
fileinput
.
hook_encoded
(
"
ISO-8859-1
"
))
as
f
:
for
line
in
f
:
if
f
.
filelineno
()
<
self
.
skip_header
+
1
:
if
f
.
filelineno
()
<
self
.
__
skip_header
+
1
:
continue
if
line
[
0
]
==
'
#
'
or
line
[
0
]
==
'
*
'
:
continue
...
...
@@ -138,6 +135,7 @@ class FileExtractor:
# debug info
str
+=
"
{:>{width}}
"
.
format
(
p
[
hash
[
key
]],
width
=
8
)
logging
.
debug
(
str
)
logging
.
debug
(
str
)
# increment m indice (the line number)
...
...
This diff is collapsed.
Click to expand it.
oceano.py
+
0
−
1
View file @
61d2f59d
...
...
@@ -88,7 +88,6 @@ if __name__ == "__main__":
# read config Toml file and get the physical parameter list (Roscop code) for the specified instrument
cfg
=
toml
.
load
(
args
.
config
)
device
=
str
(
args
.
instrument
)
# convert one element list to str
print
(
device
)
keys
=
cfg
[
'
split
'
][
device
.
lower
()].
keys
()
# test arguements from sys.argv, args is never to None with default option set
...
...
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