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

jurigged -w starts python interactive mode #17

Open
mopitithomne opened this issue May 31, 2022 · 5 comments
Open

jurigged -w starts python interactive mode #17

mopitithomne opened this issue May 31, 2022 · 5 comments

Comments

@mopitithomne
Copy link

jurigged -w should start jurigged watching only the specified file.

But: jurigged -w script.py shows this:
image

If I try: jurigged -w script.py script.py the script starts but It watch for the entire current directory instead of just the specified file.

I'd just want to start jurigged and watch for only one file, am I doing it wrongly?

@breuleux
Copy link
Owner

jurigged -w script.py script.py only watches script.py for me (v0.5.2). What does jurigged -vw script.py script.py display? It should show a message for each file it is watching.

@mopitithomne
Copy link
Author

If I start jurigged -w script.py script.py, I see edit of other files in my DEBUG logs:
image
As you can see, I see that some mp4 files are changing. I do not care about them in jurigged, but It seems It watch them.

@breuleux
Copy link
Owner

breuleux commented Jun 1, 2022

Okay, I see. Basically, Jurigged asks watchdog to watch the entire directory and then it filters out events about the files it is not interested in. The reason it does that is that some editors, when saving a file, will essentially write to a new file and then move it into place (I assume for atomicity reasons), so instead of MODIFY there is a DELETE and a CREATE. If I made an observer on the file only, the observer would simply stop, so I made it watch the directory instead. There may be a better solution, but this works. Just know that Jurigged does not actually do anything with these extra events.

@mopitithomne
Copy link
Author

Thank you for the info. Got it now.
So I'm gonna to set watchdog logs to INFO or WARNING to not see these DEBUG logs.

About the jurigged -w script.py command, I think you should make It work.
jurigged -w script.py script.py isn't intuitive in my opinion.

@breuleux
Copy link
Owner

breuleux commented Jun 8, 2022

-w only specifies what you are watching, not what you are doing. You might want to write jurigged -w a.py b.py, for example. I expect its use to be somewhat rare. One thing I might do is exclude the contents of the current virtual env by default, as that might be the main source of noise you want to avoid by using -w.

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

No branches or pull requests

2 participants