Skip to content

Commit

Permalink
Download canceling improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
bohdanbobrowski committed Nov 13, 2024
1 parent a5e6da1 commit 0643dbf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions blog2epub/blog2epub_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@


class CliInterface(EmptyInterface):
def print(self, text: str):
print(text)
def print(self, text: str, end: str = "\n"):
print(text, end=end)

def exception(self, e):
print(e)
Expand Down
2 changes: 1 addition & 1 deletion blog2epub/crawlers/article_factory/abstract.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from abc import ABC, abstractmethod
from typing import Optional, Callable
from typing import Callable, Optional

from lxml.html.soupparser import fromstring

Expand Down
2 changes: 1 addition & 1 deletion blog2epub/crawlers/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def crawl(self):
dirs=self.dirs,
language=self.language,
downloader=self.downloader,
download_callback=self._break_the_loop
download_callback=self._break_the_loop,
)
art = art_factory.process()
self.images = self.images + art.images
Expand Down
4 changes: 2 additions & 2 deletions blog2epub/crawlers/zeissikonveb.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_title(self) -> Optional[str]:


class ZeissIkonVEBCrawler(DefaultCrawler):
"""TODO: https://zeissikonveb.de"""
"""https://zeissikonveb.de"""

def __init__(self, **kwargs):
super().__init__(**kwargs)
Expand All @@ -36,7 +36,7 @@ def __init__(self, **kwargs):
Pattern(regex=r"font-size:[\s0-9]+px\;"),
Pattern(regex=r"line-height:[\s0-9]+\;"),
Pattern(regex=r"font-family:Arial, Helvetica, sans-serif"),
Pattern(regex=r"<p\/>"),
Pattern(regex=r'<p (class|style)="[^"]+" (class|style)="[^"]+"><span style="[^"]+"><br><\/span><\/p>'),
]
self.patterns.date = [
Pattern(regex=r"letzte Änderung[\s:]*([0-9]{1,2})[\.\s]*([A-Za-z]+)[\.\s]*([0-9]{4})"),
Expand Down

0 comments on commit 0643dbf

Please sign in to comment.