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

Patch 2 #813

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

Patch 2 #813

wants to merge 3 commits into from

Conversation

Tonsofattraction
Copy link
Contributor

support comma in tags for autostop

@@ -20,7 +20,7 @@ def get_type_string():
def __init__(self, autostop, param_str):
AbstractCriterion.__init__(self)
self.seconds_count = 0
params = param_str.split(',')
params = param_str.split(',', 3)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should it be 2, not 3?
In case of 2 as a parameter self.tag would include the rest of the string with commas,
in case of 3 all these trailing commas will be dropped.


params_3 = param_str.split(',', 3)
tag = params_3[2].strip() if len(params_3) == 3 else None
print(tag)
None

params_2 = param_str.split(',', 2)
tag = params_2[2].strip() if len(params_2) == 3 else None
print(tag)
'long tag, with commas'

Copy link
Contributor

Choose a reason for hiding this comment

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

@Tonsofattraction could you comment this, please?

Copy link
Contributor Author

@Tonsofattraction Tonsofattraction Dec 20, 2019

Choose a reason for hiding this comment

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

My mistake, this particular criterion accepts 3 params at most. May be we should check other criteria as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants