Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Grib Processor
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Max Drexler
Grib Processor
Commits
fd8aea0f
Commit
fd8aea0f
authored
8 months ago
by
Max Drexler
Browse files
Options
Downloads
Patches
Plain Diff
change grib source cli default
parent
133c16cc
No related branches found
Branches containing commit
No related tags found
1 merge request
!2
Switch to package setup
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
grib_processor/main.py
+8
-6
8 additions, 6 deletions
grib_processor/main.py
with
8 additions
and
6 deletions
grib_processor/main.py
+
8
−
6
View file @
fd8aea0f
...
...
@@ -86,8 +86,10 @@ def setup() -> tuple[Iterable[GribPayload], Callable[[GribPayload], None]]:
)
parser
.
add_argument
(
"
grib_src
"
,
nargs
=
"
?
"
,
default
=
None
,
metavar
=
"
grib_source
"
,
help
=
"
Directory to watch for new
grib files
,
f
ile to read grib paths from, or
'
--
'
to read file paths from stdin
.
"
,
help
=
"
Where to get
grib files f
rom. Either stdin (default), a directory to watch, or a grib file itself
.
"
,
)
parser
.
add_argument
(
"
-v
"
,
...
...
@@ -161,7 +163,10 @@ def setup() -> tuple[Iterable[GribPayload], Callable[[GribPayload], None]]:
# Get an iterator over grib files to process
file_iter
:
Iterable
[
str
]
if
os
.
path
.
isdir
(
args
.
grib_src
):
if
args
.
grib_src
is
None
:
LOG
.
info
(
"
Sourcing grib files from stdin, realtime=%s
"
,
args
.
realtime
)
file_iter
=
map
(
str
.
strip
,
iter
(
sys
.
stdin
.
readline
,
""
))
elif
os
.
path
.
isdir
(
args
.
grib_src
):
LOG
.
info
(
"
Sourcing grib files from directory watch @ %s realtime=%s
"
,
args
.
grib_src
,
...
...
@@ -177,11 +182,8 @@ def setup() -> tuple[Iterable[GribPayload], Callable[[GribPayload], None]]:
args
.
grib_src
,
debounce
=
debounce
,
recursive
=
args
.
recursive
)
elif
os
.
path
.
isfile
(
args
.
grib_src
):
LOG
.
info
(
"
Sourcing grib file directly from CLI
, %s
"
,
args
.
grib_src
)
LOG
.
info
(
"
Grib source is a file, parsing directly
, %s
"
,
args
.
grib_src
)
file_iter
=
(
str
(
args
.
grib_src
),)
elif
args
.
grib_src
==
"
--
"
:
LOG
.
info
(
"
Sourcing grib files from stdin, realtime=%s
"
,
args
.
realtime
)
file_iter
=
map
(
str
.
strip
,
iter
(
sys
.
stdin
.
readline
,
""
))
else
:
parser
.
error
(
"
{0} is not a valid source!
"
.
format
(
args
.
grib_src
))
...
...
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