How to get variety to recognise new quote file without restart?

Asked by Liam Flood

I am using crontab and wget to get input every 15 minutes for a quote file that is then put in ~/.config/variety/pluginconfig/quotes/

How do I get variety to recognise this updated file without restarting the application?

Cheers
Liam

Question information

Language:
English Edit question
Status:
Answered
For:
Variety Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Peter Levi (peterlevi) said :
#2

The current LocalFilesSource quote plugin reads the quote files only on load and does not refresh them live.

If you feel fine with programming, you can implement a custom quote plugin RefreshableLocalFilesSource based on the current one that would reread the file every time it is asked for quotes, or would use file-monitoring APIs to reload the files when necessary (more complex programming, but less resource-intensive). Keep in mind that there is another level of caching of quotes, so the methods get_random(), get_by_keyword(), etc. will have to return lists with one quote only, not all the quotes at once as the current plugin does.

If you go that way, please keep me updated.

Can you help with this problem?

Provide an answer of your own, or ask Liam Flood for more information if necessary.

To post a message you must log in.