Skip to content

Conversation

@roger-lo
Copy link
Owner

@roger-lo roger-lo commented Jun 2, 2017

Work in progress.

This is how I imagine things would approximately look.

Let me know what you think.

@roger-lo roger-lo requested a review from ejwmoreau June 2, 2017 16:55
@roger-lo
Copy link
Owner Author

roger-lo commented Jun 2, 2017

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:
Copy link
Collaborator

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

Copy link
Owner Author

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?

Copy link
Collaborator

@ejwmoreau ejwmoreau Jun 3, 2017

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.

Copy link
Contributor

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

Copy link
Collaborator

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')
Copy link
Collaborator

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.

Copy link
Owner Author

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, sounds good :)

Copy link
Collaborator

@ejwmoreau ejwmoreau left a 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.

@roger-lo
Copy link
Owner Author

roger-lo commented Jun 3, 2017

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

@ejwmoreau
Copy link
Collaborator

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))
Copy link
Contributor

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.

Copy link
Contributor

@scottgreenup scottgreenup left a 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.

@scottgreenup
Copy link
Contributor

Should probably close this or merge it?

@ejwmoreau
Copy link
Collaborator

@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 🙂

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.

4 participants