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
avoid spamming by outputting state only once when a file changes #2049
avoid spamming by outputting state only once when a file changes #2049
Conversation
👍 |
try: | ||
py_compile.compile(filename, doraise=True) | ||
except py_compile.PyCompileError: | ||
print("%s has a SyntaxError; NOT reloading." % filename) |
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'd rather print the message for all files in self.syntax_error_files
here, just to be explicit what is blocking the reload.
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.
Okay cool, I'll mess with that for a few and see how it feels. The reason I like it the way it is right now is that you only get notifications on the files that actually changed which I think it's somewhat intuitive.
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.
But the information you're looking for is what files to fix to get reloader to work again
One nitpick, otherwise 👍 |
Ok new version prints out the syntax error for the new file as well as the names of all the files that have errors. Printing out all the files really doesn't feel quite right but it's not a big deal since most people should only have one or two files with errors at a time. |
I created a temp file that py_compile uses to avoid changing the actual pyc file. It seems to have fixed the infinite loop issues. |
Shipit On Fri, 13 Nov 2015, 19:53 Michael Merickel notifications@github.com
|
avoid spamming by outputting state only once when a file changes
This reduces the output to only when a file changes. However, I'm able to get it into a weird state where it keeps spamming and I haven't figured out the fix for that yet.
pserve --reload
It doesn't happen every time but it's somewhat consistent for me (especially when B.py is pserve.py).