03-30-2019, 06:58 PM | #1 |
Connoisseur
Posts: 56
Karma: 15570
Join Date: Jul 2017
Device: iPad
|
Can I get notifications from a called script?
I can start a ThreadedJob and receive notifications using this function:
Code:
def sync_threaded(ids, db, log=None, abort=None, notifications=None): ... notifications.put((count/len(ids), _('Synced %d of %d')%(count, len(ids)))) ... Code:
import calibre_plugins.cal.cal2fun as cal2fun def sync_threaded(ids, db, log=None, abort=None, notifications=None): ... cal2fun.main(ids, db) ... Thanks. |
03-31-2019, 04:24 AM | #2 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
If your script is running in a separate process yu will need to set up IPC between them. python has some conveninece classes for this in the multiprocessing module in the stdlib. Look for LIstener and Client.
|
Advert | |
|
04-01-2019, 04:01 PM | #3 |
Connoisseur
Posts: 56
Karma: 15570
Join Date: Jul 2017
Device: iPad
|
Thank you @kovidgoyal, all sorted now.
The initial release of the plugin has been uploaded https://www.mobileread.com/forums/sh...94#post3826694 |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
No Gmail notifications | HarryT | Apple Devices | 5 | 11-16-2017 06:14 AM |
Mail notifications | exaltedwombat | Feedback | 4 | 04-25-2013 05:23 PM |
notifications | Senior | Kobo Tablets | 4 | 03-26-2013 09:45 AM |
Daily notifications? | devilsadvocate | Feedback | 8 | 01-22-2010 12:24 PM |