Skip to content
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

Mr custom #224

Closed
wants to merge 4 commits into from
Closed

Mr custom #224

wants to merge 4 commits into from

Conversation

stefanmaar
Copy link

I'm working on the hamster-cli and had to fix/extend some things in hamster-lib.

@CLAassistant
Copy link

CLAassistant commented Jan 19, 2017

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Stefan Mertl seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@elbenfreund
Copy link
Collaborator

Hello Stefan,

thank you for your interest and contributions. As I am finishing up a project at work this week I may not have time to have a look at your commits before next week - so this is just a initial response.

btw: If you commit several distinct issues with your commits it would be beneficial to split them into separate feature branches/PRs.

Copy link
Collaborator

@elbenfreund elbenfreund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It there a particular rationale for your preference to flooring or just a personal thing?

@@ -366,9 +366,10 @@ def __init__(self, activity, start, end=None, pk=None, description=None, tags=No
self.start = start
self.end = end
self.description = description
self.tags = set()
self.tags = []
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a specific reason for this change?

if tags:
self.tags = set(tags)
tags = set(tags)
self.tags = [Tag(name = x) for x in tags]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whist you are correct that this should be a set of Tag instances the mistake is already in L356! The constructor should expect an iterable of such Tag instances, not strings. I created an issue about this.

@@ -468,7 +479,18 @@ def comma_split(string):
activity_name, back = at_split(rest)

if back:
category_name, description = comma_split(back)
# Check for an existing hashtag.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an interesting approach. The next iteration of hamster-lib will however refactor the entire 'raw fact' parsing machinery in total, which is why no effort has been made to take care of tags.

@@ -477,7 +499,7 @@ def comma_split(string):
category, description = None, None

activity = Activity(activity_name, category=category)
return cls(activity, start, end=end, description=description)
return cls(activity, start, end=end, description=description, tags = tags)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there should not be kwarg assignment should not be surrounded by whitespace as per PEP8

Copy link
Collaborator

@elbenfreund elbenfreund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the sentiment but I think for hamster-lib it makes more sense to provide one default export format that can easily be converted by other tools than trying to cover all possible variations.

In fact, there will be a "universal time tracker data conversion tool" called timetrackerimp you may want to check for timetrackerimp for exactly this purpose which have not release yet in the mid future.

Copy link
Collaborator

@elbenfreund elbenfreund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whilst I agree that such validation is needed I think Fact.end is the right place for this. An issue to fix this has been created

@elbenfreund
Copy link
Collaborator

Will close for now. Please let me know if you want to reopen/get back to this.

@elbenfreund elbenfreund closed this Jun 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants