Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tommy Olofsson
LabComm
Commits
585d3f69
Commit
585d3f69
authored
Feb 02, 2015
by
Tommy Olofsson
Browse files
Do not assume system arguments.
parent
27dc184c
Changes
1
Hide whitespace changes
Inline
Side-by-side
tools/lc2csv.py
View file @
585d3f69
#!/usr/bin/env python
import
time
import
argparse
import
labcomm
import
sys
import
time
class
Reader
(
object
):
...
...
@@ -90,7 +91,7 @@ def dump_labels(current, _type):
print
def
main
():
def
main
(
main_args
):
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'elc'
,
type
=
str
,
help
=
"The log file."
)
parser
.
add_argument
(
'-f'
,
'--follow'
,
action
=
'store_true'
,
...
...
@@ -105,7 +106,7 @@ def main():
help
=
"timeout to terminate when no changes are detected. "
"Requires -f."
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
(
main_args
)
seen
=
{}
current
=
{}
_type
=
{}
...
...
@@ -147,4 +148,4 @@ def main():
if
__name__
==
"__main__"
:
main
()
main
(
sys
.
argv
[
1
:]
)
Write
Preview
Supports
Markdown
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