View Single Post
Old 03-30-2019, 06:58 PM   #1
karl1c
Connoisseur
karl1c has become a pillar of the MobileRead communitykarl1c has become a pillar of the MobileRead communitykarl1c has become a pillar of the MobileRead communitykarl1c has become a pillar of the MobileRead communitykarl1c has become a pillar of the MobileRead communitykarl1c has become a pillar of the MobileRead communitykarl1c has become a pillar of the MobileRead communitykarl1c has become a pillar of the MobileRead communitykarl1c has become a pillar of the MobileRead communitykarl1c has become a pillar of the MobileRead communitykarl1c has become a pillar of the MobileRead community
 
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))))
    ...
In the same function, I can run another script successfully

Code:
import calibre_plugins.cal.cal2fun as cal2fun
def sync_threaded(ids, db, log=None, abort=None, notifications=None):
    ...
    cal2fun.main(ids, db)
    ...
Is it possible to call notifications.put() from within cal2fun.main() and how would I do it?

Thanks.
karl1c is offline   Reply With Quote