diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2018-12-02 10:57:26 +0100 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2018-12-02 11:38:58 +0100 |
commit | 5db26384556be4d7cee3ba93dfc6375c8d80b6ea (patch) | |
tree | f165940d275fa999b48d6bb3d5cdd24152d6e14b | |
parent | 427f5972bb78fcfbe9d90aac6251d0121d2f1942 (diff) | |
download | crocoite-5db26384556be4d7cee3ba93dfc6375c8d80b6ea.tar.gz crocoite-5db26384556be4d7cee3ba93dfc6375c8d80b6ea.tar.bz2 crocoite-5db26384556be4d7cee3ba93dfc6375c8d80b6ea.zip |
controller: Add only enabled behavior scripts to warcinfo
-rw-r--r-- | crocoite/controller.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crocoite/controller.py b/crocoite/controller.py index 8b25d1f..22e7e28 100644 --- a/crocoite/controller.py +++ b/crocoite/controller.py @@ -137,6 +137,10 @@ class SinglePageController: start = time.time () + # not all behavior scripts are allowed for every URL, filter them + enabledBehavior = list (filter (lambda x: self.url in x, + map (lambda x: x (l, logger), self.behavior))) + version = await l.tab.Browser.getVersion () payload = { 'software': { @@ -157,15 +161,11 @@ class SinglePageController: 'url': self.url, 'idleTimeout': self.settings.idleTimeout, 'timeout': self.settings.timeout, - 'behavior': list (map (attrgetter('name'), self.behavior)), + 'behavior': list (map (attrgetter('name'), enabledBehavior)), }, } self.processItem (ControllerStart (payload)) - # not all behavior scripts are allowed for every URL, filter them - enabledBehavior = list (filter (lambda x: self.url in x, - map (lambda x: x (l, logger), self.behavior))) - await l.start () for b in enabledBehavior: async for item in b.onload (): |