-
Notifications
You must be signed in to change notification settings - Fork 278
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
base: develop
Are you sure you want to change the base?
Patch 2 #813
Conversation
@@ -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) |
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.
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'
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.
@Tonsofattraction could you comment this, please?
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.
My mistake, this particular criterion accepts 3 params at most. May be we should check other criteria as well.
support comma in tags for autostop