diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2018-12-08 09:05:12 +0100 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2018-12-08 09:05:45 +0100 |
commit | 6ccd72ab96cfba36c217a77641b3b8a91906c512 (patch) | |
tree | 0a96f837e8ef4776af1b87aa7dd43edc6c55be3a /crocoite/controller.py | |
parent | aec7a8c583c8228e9538c923d39ef80862bafdde (diff) | |
download | crocoite-6ccd72ab96cfba36c217a77641b3b8a91906c512.tar.gz crocoite-6ccd72ab96cfba36c217a77641b3b8a91906c512.tar.bz2 crocoite-6ccd72ab96cfba36c217a77641b3b8a91906c512.zip |
tools: Add version info to merged WARCs
In preparation for #9.
I was hoping to reuse one of schema.org’s microdata schema’s, but
neither Action (archival action) nor SoftwareApplication (version
information) seem to be suitable.
Diffstat (limited to 'crocoite/controller.py')
-rw-r--r-- | crocoite/controller.py | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/crocoite/controller.py b/crocoite/controller.py index 22e7e28..1ee1943 100644 --- a/crocoite/controller.py +++ b/crocoite/controller.py @@ -22,7 +22,7 @@ Controller classes, handling actions required for archival """ -import time, platform +import time import tempfile, asyncio, json, os from itertools import islice from datetime import datetime @@ -31,7 +31,7 @@ from operator import attrgetter from . import behavior as cbehavior from .browser import SiteLoader, Item -from .util import getFormattedViewportMetrics, getRequirements, removeFragment +from .util import getFormattedViewportMetrics, getSoftwareInfo, removeFragment from .behavior import ExtractLinksEvent class ControllerSettings: @@ -143,20 +143,13 @@ class SinglePageController: version = await l.tab.Browser.getVersion () payload = { - 'software': { - 'platform': platform.platform (), - 'python': { - 'implementation': platform.python_implementation(), - 'version': platform.python_version (), - 'build': platform.python_build () - }, - 'self': getRequirements (__package__) - }, + 'software': getSoftwareInfo (), 'browser': { 'product': version['product'], 'useragent': version['userAgent'], 'viewport': await getFormattedViewportMetrics (l.tab), }, + 'tool': 'crocoite-single', # not the name of the cli utility 'parameters': { 'url': self.url, 'idleTimeout': self.settings.idleTimeout, |