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

Customizable list of "watched" directories #1920

Closed
honzajavorek opened this issue Feb 28, 2016 · 7 comments
Closed

Customizable list of "watched" directories #1920

honzajavorek opened this issue Feb 28, 2016 · 7 comments

Comments

@honzajavorek
Copy link
Contributor

List of watched directories during development is now hardcoded:

print('  --- AutoReload Mode: Monitoring `content`, `theme` and'
      ' `settings` for changes. ---')

It would be nice if I could customize this list in settings if I want to use a slightly more crazy directory structure, e.g. I use just one settings.py file, not a directory of settings, and the file won't get monitored this way... or I want to watch my plugins directory.

I'm willing to work on this, just give me pointers if there are any and let me know if this feature is something Pelican would want to have.

@ingwinlu
Copy link
Contributor

settings.py is watched not as a directory. it is watched as a file.

First suggestion is to actually look at the code in question and trying to understand it. If you are having troubles we are reachable via IRC.

To make it customizable we would need to introduce a new setting. Since the current auto-reloader is no good anyway and there are already issues/pr's open regarding that I am not really in favor of trying to improve it via an additional setting.

@honzajavorek
Copy link
Contributor Author

OK, thanks! I'll take a look at the other PRs to see first what's this part of Pelican up to.

@honzajavorek
Copy link
Contributor Author

Regarding settings.py, I got mistaken. It is watched properly, but I import something to it from other file, which is elsewhere and not watched. Since most of the time I edit the other file, I got an impression my settings are not watched correctly for some reason.

But custom list of locations to watch would help to solve that as well as the plugins directory, so the original point is still valid.

@justinmayer
Copy link
Member

Hey Honza! This issue has been around for a while without any activity, so I thought I'd ask if this is something you'd like to work on implementing. What do you think?

@honzajavorek
Copy link
Contributor Author

Hey 🙂 I have several blogs on Pelican, but it's been a while I had time to do anything about them 😞 It's been 3 years now since I filed the feature request and there is apparently nobody else needing it (commenting, voting by 👍 ), so I suppose this can be closed. Not worth adding if I'm the only one with crazy setup.

@justinmayer
Copy link
Member

@honzajavorek: No worries. If and when you (or anyone else who comes across this issue) wants to submit a pull request that implements this kind of enhancement, please feel free to comment here and we can re-open it. Thanks!

@S1SYPHOS
Copy link

S1SYPHOS commented Sep 24, 2022

Hey there @justinmayer and @honzajavorek,
I know this was in the past and all, and I'm not sure if this counts as new issue (= feature request) or should go here .. but since it's best practice to search for existing issues first, I decided to post here:

For a plugin adding data directory inside content for various data files to be added to Pelican's context (see here), I'm looking for a way to reload the page on data file changes. Their filetypes are json, yaml etc, so nothing that Pelican usually has to deal with or recognizes out-of-the-box - and even though pelican -r -l tells me this: --- AutoReload Mode: Monitoring content, themeandsettings for changes. ---, changes inside content/data don't trigger an autoreload.

Now, as for tackling this issue, I noticed that FileSystemWatcher in utils.py queries suitable extensions by asking self.reader_class(settings).extensions (line 771) - since the plugin in question implements a generator rather than a reader and taking into account that files below content directory worth reloading might not only be content files (eg .rst, .md etc) but also images, videos, whatever, we could think about making extensions configurable / overwritrable via pelicanconf.py.

Thanks for considering options together, I'm having great fun using Pelican so far (first issue / contribution, so please go easy on me 🦊)

Cheers,
S1SYPHOS

PS: I guess I'm kindly suggesting to reopen this issue 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants