Add/Update some comments to rikkitp's changes.

This commit is contained in:
Jim Miller 2018-04-16 11:31:18 -05:00
parent 535451cfa0
commit a6c551ee1b
4 changed files with 8 additions and 2 deletions

View file

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017 FanFicFare team
# Copyright 2018 FanFicFare team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2014 Fanficdownloader team, 2017 FanFicFare team
# Copyright 2014 Fanficdownloader team, 2018 FanFicFare team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View file

@ -2,6 +2,8 @@ from datetime import datetime, timedelta
UNIX_EPOCHE = datetime.fromtimestamp(0)
## Currently used by adapter_webnovelcom & adapter_wwwnovelallcom
def parse_relative_date_string(string_):
# Keep this explicit instead of replacing parentheses in case we discover a format that is not so easily
# translated as a keyword-argument to timedelta. In practice I have only observed hours, weeks and days

View file

@ -119,6 +119,10 @@ def removeEntities(text):
# < < and & are the only html entities allowed in xhtml, put those back.
return text.replace('&', '&').replace('&lt', '<').replace('&gt', '>')
## Currently used(optionally) by adapter_lightnovelgatecom and
## adapter_wwwnovelallcom only. I hesitate to put the option in
## base_adapter.make_soup for all adapters due to concerns about it
## maybe breaking metadata parsing as it changes tags.
def fix_excess_space(text):
# For easier extra space removing (when combining p an br)
text = removeEntities(text)