-
Notifications
You must be signed in to change notification settings - Fork 1
Spiked a core-engine with example predicate and action #8
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
base: master
Are you sure you want to change the base?
Conversation
|
I have no idea how to add an extra person to a PR. @scottgreenup |
|
|
||
| # Skip comments | ||
| if line.startswith('#'): | ||
| if line.startswith('#') or not len(line) > 1: |
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.
Maybe that condition could be rewritten?
len(line) == 0 or len(line) <= 0
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.
Can I do just 'len(line)' is python? Like with truthy falsy values?
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.
Yeah, not len(line) works too. Not sure which is better.
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 can also do not line because "" is considered falsey
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.
Cool!
| def main(): | ||
| config_files = [ | ||
| '~/.filedrc' | ||
| path.join(path.dirname(__file__), 'resource/filedrc') |
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.
So we'll be getting a user's config from the "resource/filedrc" file? Good for testing but maybe we need to allow a certain file/folder for all user's configs.
Okay for now, just something that would need to be discussed.
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.
Oh. I should have mentioned that was just to wire up the example configure file.
We still need to figure out how we want to lay out the confit file.
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.
Yep, sounds good :)
ejwmoreau
left a comment
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.
I think the src folder needs a init.py file in order to properly import the predicates/predicate.py file.
Maybe also init.py files in predicates and actions folders.
|
It's interesting you say that. PyCharm was complaining about not finding the file but python was executing this just fine. I might be missing the init.py file |
|
Huh, interesting |
| parts = line.split(':') | ||
| if len(parts) != 3: | ||
| logging.warning("{}:{}: Error reading line".format(filename, num)) | ||
| logging.warning("{}:{}: Error reading line".format(line, num)) |
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.
filename gives you the config file that is having a problem. The line itself should be part of the error, IMO.
scottgreenup
left a comment
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.
I like the general layout, but we need to discuss the layout/configuration from the user's perspective before you commit to this.
|
Should probably close this or merge it? |
|
@scottgreenup Did you hear Roger and I might work on this in the upcoming weeks? :P This PR is probably a good start, so I'm up for merging 🙂 |
Work in progress.
This is how I imagine things would approximately look.
Let me know what you think.