mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
pep8
This commit is contained in:
parent
95d13dfc3e
commit
d566c493ec
@ -34,27 +34,29 @@ class Ambito(BasicNewsRecipe):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
conversion_options = {
|
conversion_options = {
|
||||||
'comment' : description
|
'comment': description,
|
||||||
, 'tags' : category
|
'tags': category,
|
||||||
, 'publisher' : publisher
|
'publisher': publisher,
|
||||||
, 'language' : language
|
'language': language
|
||||||
}
|
}
|
||||||
|
|
||||||
keep_only_tags = [
|
keep_only_tags = [
|
||||||
dict(name='div', attrs={'class': 'detail-header-wrapper'}),
|
dict(name='div', attrs={'class': 'detail-header-wrapper'}),
|
||||||
dict(attrs={'class': lambda x: x and 'detail-body' in x.split()}),
|
dict(attrs={'class': lambda x: x and 'detail-body' in x.split()}),
|
||||||
]
|
]
|
||||||
remove_tags = [dict(name=['object', 'link', 'embed', 'iframe', 'meta', 'link', 'img'])]
|
remove_tags = [
|
||||||
|
dict(name=['object', 'link', 'embed', 'iframe', 'meta', 'link', 'img'])
|
||||||
|
]
|
||||||
|
|
||||||
feeds = [
|
feeds = [
|
||||||
(u'Portada' , u'https://www.ambito.com/rss/home.xml')
|
(u'Portada', u'https://www.ambito.com/rss/home.xml'),
|
||||||
,(u'Economia' , u'https://www.ambito.com/rss/economia.xml')
|
(u'Economia', u'https://www.ambito.com/rss/economia.xml'),
|
||||||
,(u'Finanzas' , u'https://www.ambito.com/rss/finanzas.xml')
|
(u'Finanzas', u'https://www.ambito.com/rss/finanzas.xml'),
|
||||||
,(u'Politica' , u'https://www.ambito.com/rss/politica.xml')
|
(u'Politica', u'https://www.ambito.com/rss/politica.xml'),
|
||||||
,(u'Opinion' , u'https://www.ambito.com/rss/opinion.xml')
|
(u'Opinion', u'https://www.ambito.com/rss/opinion.xml'),
|
||||||
,(u'Informacion General', u'https://www.ambito.com/rss/informacion-general.xml')
|
(u'Informacion General', u'https://www.ambito.com/rss/informacion-general.xml'),
|
||||||
,(u'Mundo' , u'https://www.ambito.com/rss/mundo.xml')
|
(u'Mundo', u'https://www.ambito.com/rss/mundo.xml'),
|
||||||
,(u'Deportes' , u'https://www.ambito.com/rss/deportes.xml')
|
(u'Deportes', u'https://www.ambito.com/rss/deportes.xml'),
|
||||||
,(u'Espectaculos' , u'https://www.ambito.com/rss/espectaculos.xml')
|
(u'Espectaculos', u'https://www.ambito.com/rss/espectaculos.xml'),
|
||||||
,(u'Nacional' , u'https://www.ambito.com/rss/nacional.xml')
|
(u'Nacional', u'https://www.ambito.com/rss/nacional.xml')
|
||||||
]
|
]
|
||||||
|
@ -9,14 +9,8 @@ https://www.ambito.com/contenidos/edicion-impresa.html
|
|||||||
'''
|
'''
|
||||||
|
|
||||||
import time
|
import time
|
||||||
try:
|
|
||||||
from urllib.parse import urlencode
|
|
||||||
except ImportError:
|
|
||||||
from urllib import urlencode
|
|
||||||
import re
|
|
||||||
from calibre import strftime
|
from calibre import strftime
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
from calibre.ebooks.BeautifulSoup import BeautifulSoup
|
|
||||||
|
|
||||||
|
|
||||||
class Ambito_Financiero(BasicNewsRecipe):
|
class Ambito_Financiero(BasicNewsRecipe):
|
||||||
|
@ -5,15 +5,17 @@
|
|||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
|
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
import re, copy, weakref
|
import copy
|
||||||
|
import re
|
||||||
|
import weakref
|
||||||
from collections import OrderedDict, namedtuple
|
from collections import OrderedDict, namedtuple
|
||||||
from itertools import groupby
|
from itertools import groupby
|
||||||
from operator import attrgetter, itemgetter
|
from operator import attrgetter, itemgetter
|
||||||
|
|
||||||
from qt.core import (
|
from qt.core import (
|
||||||
Qt, QObject, QSize, QVBoxLayout, QStackedLayout, QWidget, QLineEdit, QListView,
|
QDialog, QDialogButtonBox, QFrame, QGridLayout, QHBoxLayout, QIcon, QLabel,
|
||||||
QToolButton, QIcon, QHBoxLayout, QPushButton, QListWidget, QListWidgetItem,
|
QLineEdit, QListView, QListWidget, QListWidgetItem, QObject, QPushButton, QSize,
|
||||||
QGridLayout, QPlainTextEdit, QLabel, QFrame, QDialog, QDialogButtonBox, QTextCursor)
|
QStackedLayout, Qt, QTextCursor, QToolButton, QVBoxLayout, QWidget
|
||||||
|
)
|
||||||
|
|
||||||
from calibre.constants import ismacos
|
from calibre.constants import ismacos
|
||||||
from calibre.gui2 import error_dialog
|
from calibre.gui2 import error_dialog
|
||||||
@ -23,7 +25,9 @@ from calibre.gui2.tweak_book.widgets import Dialog, PlainTextEdit
|
|||||||
from calibre.utils.config import JSONConfig
|
from calibre.utils.config import JSONConfig
|
||||||
from calibre.utils.icu import string_length as strlen
|
from calibre.utils.icu import string_length as strlen
|
||||||
from calibre.utils.localization import localize_user_manual_link
|
from calibre.utils.localization import localize_user_manual_link
|
||||||
from polyglot.builtins import codepoint_to_chr, iteritems, itervalues, unicode_type, range
|
from polyglot.builtins import (
|
||||||
|
codepoint_to_chr, iteritems, itervalues, range, unicode_type
|
||||||
|
)
|
||||||
|
|
||||||
string_length = lambda x: strlen(unicode_type(x)) # Needed on narrow python builds, as subclasses of unicode dont work
|
string_length = lambda x: strlen(unicode_type(x)) # Needed on narrow python builds, as subclasses of unicode dont work
|
||||||
KEY = Qt.Key.Key_J
|
KEY = Qt.Key.Key_J
|
||||||
|
Loading…
x
Reference in New Issue
Block a user