-
Notifications
You must be signed in to change notification settings - Fork 94
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
cylc gscan: add --name option #2065
Conversation
Looks like PEP8 test failing on Travis CI. |
Pep8 fixed. |
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.
Minor comment. OK otherwise.
name_pattern = name | ||
else: | ||
name_pattern = ['.*'] | ||
name_pattern = "(" + ")|(".join(name_pattern) + ")" |
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 may want to compile the pattern here with re.compile
- to catch any re.error
that it may generate. (In addition, using a compiled regular expression object's .match
method for matching a string should in theory be faster than using re.match
.)
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.
Now being compiled.
@@ -1126,6 +1144,9 @@ def update(self): | |||
self.tasks_by_state[(suite, host)] = suite_info[ | |||
'tasks-by-state'] | |||
|
|||
if not (re.match(self.name_pattern, suite)): |
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 should now be able to do self.name_pattern.match(suite)
.
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.
Now good.
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.
Looks OK, tested as working.
Partially addresses #1625
Adds --name option for filtering suites to display in gscan as per cylc scan.
@oliver-sanders - please review1
@matthewrmshin - please review2