Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefane Fermigier
neo
Commits
9ee4e04d
Commit
9ee4e04d
authored
Nov 17, 2017
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
neolog: --from option now also tries to parse with dateutil
parent
d6f61422
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
4 deletions
+19
-4
neo/scripts/neolog.py
neo/scripts/neolog.py
+16
-4
setup.py
setup.py
+3
-0
No files found.
neo/scripts/neolog.py
View file @
9ee4e04d
...
...
@@ -241,16 +241,28 @@ def main():
parser
.
add_option
(
'-s'
,
'--sleep-interval'
,
type
=
"float"
,
default
=
1
,
help
=
'with -f, sleep for approximately N seconds (default 1.0)'
' between iterations'
,
metavar
=
'N'
)
parser
.
add_option
(
'--from'
,
dest
=
'filter_from'
,
type
=
"float"
,
parser
.
add_option
(
'--from'
,
dest
=
'filter_from'
,
help
=
'show records more recent that timestamp N if N > 0,'
' or now+N if N < 0'
,
metavar
=
'N'
)
' or now+N if N < 0; N can also be a string that is'
' parseable by dateutil '
,
metavar
=
'N'
)
options
,
args
=
parser
.
parse_args
()
if
options
.
sleep_interval
<=
0
:
parser
.
error
(
"sleep_interval must be positive"
)
if
not
args
:
parser
.
error
(
"no log specified"
)
filter_from
=
options
.
filter_from
if
filter_from
and
filter_from
<
0
:
if
filter_from
:
try
:
filter_from
=
float
(
options
.
filter_from
)
except
ValueError
:
from
dateutil.parser
import
parse
x
=
parse
(
filter_from
)
if
x
.
tzinfo
:
filter_from
=
(
x
-
x
.
fromtimestamp
(
0
,
x
.
tzinfo
)).
total_seconds
()
else
:
filter_from
=
time
.
mktime
(
x
.
timetuple
())
+
x
.
microsecond
*
1e-6
else
:
if
filter_from
<
0
:
filter_from
+=
time
.
time
()
node_list
=
options
.
node
or
[]
try
:
...
...
setup.py
View file @
9ee4e04d
...
...
@@ -89,6 +89,9 @@ setup(
'neo = neo.client.zodburi:resolve_uri [client]'
,
],
},
install_requires
=
[
'python-dateutil'
,
# neolog --from
],
extras_require
=
extras_require
,
package_data
=
{
'neo.client'
:
[
...
...
Write
Preview
Markdown
is supported
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