Skip to content

Patch 2#813

Open
Tonsofattraction wants to merge 3 commits into
yandex:developfrom
Tonsofattraction:patch-2
Open

Patch 2#813
Tonsofattraction wants to merge 3 commits into
yandex:developfrom
Tonsofattraction:patch-2

Conversation

@Tonsofattraction

Copy link
Copy Markdown
Contributor

support comma in tags for autostop

AbstractCriterion.__init__(self)
self.seconds_count = 0
params = param_str.split(',')
params = param_str.split(',', 3)

Copy link
Copy Markdown
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
Copy Markdown
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?

@Tonsofattraction Tonsofattraction Dec 20, 2019

Copy link
Copy Markdown
Contributor Author

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