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
807d76df
Commit
807d76df
authored
5 years ago
by
jacques.grelet_ird.fr
Browse files
Options
Downloads
Patches
Plain Diff
add global/codeRoscop path in toml configuration file, give priority to cmd line arg value
parent
1a05b3d1
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
oceano.py
+9
-7
9 additions, 7 deletions
oceano.py
tests/test.toml
+1
-0
1 addition, 0 deletions
tests/test.toml
with
10 additions
and
7 deletions
oceano.py
+
9
−
7
View file @
807d76df
...
...
@@ -6,7 +6,7 @@ import PySimpleGUI as sg
import
toml
import
logging
from
file_extractor
import
FileExtractor
import
p
ath
lib
from
pathlib
import
P
ath
from
configparser
import
ConfigParser
import
os
import
distutils.util
as
du
...
...
@@ -180,14 +180,19 @@ if __name__ == "__main__":
if
args
.
debug
:
logging
.
basicConfig
(
format
=
'
%(levelname)s:%(message)s
'
,
level
=
logging
.
DEBUG
)
# get roscop file
r
=
Roscop
(
"
code_roscop.csv
"
)
# read config Toml file and get the physical parameter list (Roscop code) for the specified instrument
cfg
=
toml
.
load
(
args
.
config
)
# this the select device from command line !
device
=
str
(
args
.
instrument
)
# convert one element list to str
# get roscop file
if
cfg
[
'
global
'
][
'
codeRoscop
'
]
!=
None
:
defaultRoscop
=
Path
(
cfg
[
'
global
'
][
'
codeRoscop
'
])
if
args
.
roscop
!=
None
:
defaultRoscop
=
args
.
roscop
print
(
defaultRoscop
)
r
=
Roscop
(
defaultRoscop
)
# test arguements from sys.argv, args is never to None with default option set
if
args
.
gui
or
len
(
sys
.
argv
)
==
1
:
...
...
@@ -278,9 +283,6 @@ if __name__ == "__main__":
# print = sg.Print(size=(80,40))
else
:
if
args
.
roscop
!=
None
:
defaultRoscop
=
args
.
roscop
r
=
Roscop
(
defaultRoscop
)
# demo mode, only in command line
if
args
.
demo
!=
None
:
print
(
'
demo mode: {}
'
.
format
(
args
.
demo
))
...
...
This diff is collapsed.
Click to expand it.
tests/test.toml
+
1
−
0
View file @
807d76df
...
...
@@ -2,6 +2,7 @@
author
=
"jgrelet IRD March 2019 PIRATA-FR29 cruise"
debug
=
false
echo
=
true
codeRoscop
=
'C:\git\python\oceano2python\code_roscop.csv'
[cruise]
cycleMesure
=
"PIRATA-FR29"
...
...
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