-
Notifications
You must be signed in to change notification settings - Fork 589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redline Import in tsctl #603
Conversation
Ok I have no idea why travis failed, help is appreciated @adamjnichols @berggren ? |
This is because the linter complains: I'm reviewing the code tomorrow :) We will rerun Travis when done. |
timesketch/lib/utils.py
Outdated
@@ -36,6 +36,30 @@ def random_color(): | |||
rgb = tuple(int(i * 256) for i in colorsys.hsv_to_rgb(hue, 0.5, 0.95)) | |||
return u'{0:02X}{1:02X}{2:02X}'.format(rgb[0], rgb[1], rgb[2]) | |||
|
|||
# to avoid hickups in timesketch, some newlines, commas etc will be removed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't need this. What happens in Timesketch? What do you mean with hickup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
skipt this one for now, add tests later.
timesketch/lib/utils.py
Outdated
@@ -36,6 +36,30 @@ def random_color(): | |||
rgb = tuple(int(i * 256) for i in colorsys.hsv_to_rgb(hue, 0.5, 0.95)) | |||
return u'{0:02X}{1:02X}{2:02X}'.format(rgb[0], rgb[1], rgb[2]) | |||
|
|||
# to avoid hickups in timesketch, some newlines, commas etc will be removed | |||
def clean_summary(argument): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renove function
timesketch/lib/utils.py
Outdated
# method to create the datetime | ||
def convert_date_to_datetime(argument): | ||
argument = argument.replace('Z', '') | ||
d = datetime.datetime.strptime(argument, '%Y-%m-%d %H:%M:%S') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dt = parser.parse(timestring)
timestamp = int(time.mktime(dt.timetuple())) * 1000
timesketch/lib/utils.py
Outdated
argument = argument.replace('Z', '') | ||
d = datetime.datetime.strptime(argument, '%Y-%m-%d %H:%M:%S') | ||
iso_date = d.isoformat() | ||
iso_date_new = iso_date + "+00:00" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just replace this with:
dt.isoformat()
timesketch/lib/utils.py
Outdated
|
||
|
||
# method to create the datetime | ||
def convert_date_to_datetime(argument): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe rename to convert_to_isoformat
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
test |
I commited that with a wrong usermail in my config but I already signed the CLA with my right account |
The CLA bot is confused again. I'm sitting next to @deralexxx and confirm he is the one pushing commits. |
As discussed here:
#601
That adds the capability to import redline files using CLI.
What I have not done yet is made it exposed to the WebUI.
But IMHO it is a good point to start with
If the new introduced helper methods are not wanted, it is easy to move that code in the method itself.
Once it is okay to merge, I would also mention it in the README file of course