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

__init__ list: inline comments prevent proper loading #98

Closed
Achllle opened this issue Jan 14, 2020 · 3 comments
Closed

__init__ list: inline comments prevent proper loading #98

Achllle opened this issue Jan 14, 2020 · 3 comments
Assignees
Labels
flexbe_app Actually for repo FlexBE/flexbe_app input required Requires further input before work can continue

Comments

@Achllle
Copy link
Contributor

Achllle commented Jan 14, 2020

I couldn't figure out why my input_keys and output_keys weren't getting loaded and it seemed like updates to the code didn't affect the states even after rebuilding the workspace, sourcing, and relaunching the app.

My state __init__ had something like this:

super(TheGreatestState, self).__init__(
	outcomes=['finished', 'failure'],
	input_keys=['dummy_out_key'],  # should dummy_out_key2 get added here?
	output_keys=['dummy_out_key'])

Finally I realized 'hey I wonder if the comment messes things up'. And when I deleted it, the app immediately updated to include the input and output keys!

AFAIK this shouldn't cause a problem, and at least should throw a warning or error. To check my own sanity I created a dummy class+method to test this and it worked fine with comments included.

@Achllle Achllle changed the title __init__ list: don't add inline comments __init__ list: inline comments prevent proper loading Jan 14, 2020
@pschillinger
Copy link
Member

Thanks for reporting! It looks like this case is not accounted for by the regex-based state parser of the app. I will work on fixing this.

Recently, I added a new alternative state parser that you can manually select in the configuration. It is based on Python instead of regex expressions, so this issue should not show there. If you want, you can switch the state parser and try again in the meantime until this is fixed.

@pschillinger pschillinger self-assigned this Jan 19, 2020
@Achllle
Copy link
Contributor Author

Achllle commented Jan 19, 2020

Makes sense, I didn't think about that. The fix is lower priority imo than a parser error.

@pschillinger
Copy link
Member

I tried to add a comment myself and was actually not able to reproduce this issue, the state was still displayed correctly. Indeed, the example above matches the pattern:
https://regex101.com/r/TldmoK/1

Is there anything else that changed and could be related? Also, I noticed that the regex requires a linebreak in the end, so the following is not recognized:

super(TheGreatestState, self).__init__(
	outcomes=['finished', 'failure'],
	input_keys=['dummy_out_key'],
	output_keys=['dummy_out_key'])  # comment here should not be an issue, but it is

This I will fix already.

@pschillinger pschillinger added flexbe_app Actually for repo FlexBE/flexbe_app input required Requires further input before work can continue labels Feb 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flexbe_app Actually for repo FlexBE/flexbe_app input required Requires further input before work can continue
Projects
None yet
Development

No branches or pull requests

3 participants