mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge from trunk
This commit is contained in:
commit
47a8926c6f
@ -19,6 +19,68 @@
|
||||
# new recipes:
|
||||
# - title:
|
||||
|
||||
- version: 0.8.19
|
||||
date: 2011-09-16
|
||||
|
||||
new features:
|
||||
- title: "Driver for Sony Ericsson Xperia Arc"
|
||||
|
||||
- title: "MOBI Output: Add option in Preferences->Output Options->MOBI Output to enable the share via Facebook feature for calibre produced MOBI files. Note that enabling this disables the sync last read position across multiple devices feature. Don't ask me why, ask Amazon."
|
||||
|
||||
- title: "Content server: Update metadata when sending MOBI as well as EPUB files"
|
||||
|
||||
- title: "News download: Add an auto_cleanup_keep variable that allows recipe writers to tell the auto cleanup to never remove a specified element"
|
||||
|
||||
- title: "Conversion: Remove paragraph spacing: If you set the indent size negative, calibre will now leave the indents specified in the input document"
|
||||
|
||||
bug fixes:
|
||||
- title: "Fix regression in 0.8.18 that broke PDF Output"
|
||||
|
||||
- title: "MOBI Output: Revert change in 0.8.18 that marked news downloads with a single section as blogs, as the Kindle does not auto archive them"
|
||||
|
||||
- title: "PDF output on OSX now generates proper non image based documents"
|
||||
|
||||
- title: "RTF Input: Fix handling of internal links and underlined text"
|
||||
tickets: [845328]
|
||||
|
||||
- title: "Fix language sometimes not getting set when downloading metadata in the edit metadata dialog"
|
||||
|
||||
- title: "Fix regression that broke killing of multiple jobs"
|
||||
tickets: [850764]
|
||||
|
||||
- title: "Fix bug processing author names with initials when downloading metadata from ozon.ru."
|
||||
tickets: [845420]
|
||||
|
||||
- title: "Fix a memory leak in the Copy to library operation which also fixes the metadata.db being held open in the destination library"
|
||||
tickets: [849469]
|
||||
|
||||
- title: "Keyboard shortcuts: Allow use of symbol keys like >,*,etc."
|
||||
tickets: [847378]
|
||||
|
||||
- title: "EPUB Output: When splitting be a little cleverer about discarding 'empty' pages"
|
||||
|
||||
|
||||
improved recipes:
|
||||
- Twitch Films
|
||||
- Japan Times
|
||||
- People/US Magazine mashup
|
||||
- Business World India
|
||||
- Inquirer.net
|
||||
- Guardian/Observer
|
||||
|
||||
new recipes:
|
||||
- title: RT
|
||||
author: Darko Miletic
|
||||
|
||||
- title: CIO Magazine
|
||||
author: Julio Map
|
||||
|
||||
- title: India Today and Hindustan Times
|
||||
author: Krittika Goyal
|
||||
|
||||
- title: Pagina 12 Print Edition
|
||||
author: Pablo Marfil
|
||||
|
||||
- version: 0.8.18
|
||||
date: 2011-09-09
|
||||
|
||||
@ -39,6 +101,7 @@
|
||||
- title: "TXT Output: Preserve as much formatting as possible when generating Markdown output including various CSS styles"
|
||||
|
||||
bug fixes:
|
||||
|
||||
- title: "Fix pubdate incorrect when used in save to disk template in timezones ahead of GMT."
|
||||
tickets: [844445]
|
||||
|
||||
|
@ -46,7 +46,9 @@ class LATimes(BasicNewsRecipe):
|
||||
remove_tags_after=dict(name='p', attrs={'class':'copyright'})
|
||||
remove_tags = [
|
||||
dict(name=['meta','link','iframe','object','embed'])
|
||||
,dict(attrs={'class':['toolSet','articlerail','googleAd','entry-footer-left','entry-footer-right','entry-footer-social','google-ad-story-bottom','sphereTools']})
|
||||
,dict(attrs={'class':['toolSet','articlerail','googleAd','entry-footer-left',
|
||||
'entry-footer-right','entry-footer-social','google-ad-story-bottom',
|
||||
'sphereTools', 'nextgen-share-tools']})
|
||||
,dict(attrs={'id':['article-promo','googleads','moduleArticleToolsContainer','gallery-subcontent']})
|
||||
]
|
||||
remove_attributes=['lang','xmlns:fb','xmlns:og','border','xtags','i','article_body']
|
||||
|
@ -2,7 +2,6 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class AdvancedUserRecipe1306097511(BasicNewsRecipe):
|
||||
title = u'Metro Nieuws NL'
|
||||
description = u'Metro Nieuws - NL'
|
||||
# Version 1.2, updated cover image to match the changed website.
|
||||
# added info date on title
|
||||
oldest_article = 2
|
||||
@ -11,14 +10,14 @@ class AdvancedUserRecipe1306097511(BasicNewsRecipe):
|
||||
description = u'Metro Nederland'
|
||||
language = u'nl'
|
||||
simultaneous_downloads = 5
|
||||
delay = 1
|
||||
# timefmt = ' [%A, %d %B, %Y]'
|
||||
#delay = 1
|
||||
auto_cleanup = True
|
||||
auto_cleanup_keep = '//div[@class="article-image-caption-2column"]|//div[@id="date"]'
|
||||
timefmt = ' [%A, %d %b %Y]'
|
||||
no_stylesheets = True
|
||||
remove_javascript = True
|
||||
remove_empty_feeds = True
|
||||
cover_url = 'http://www.oldreadmetro.com/img/en/metroholland/last/1/small.jpg'
|
||||
remove_empty_feeds = True
|
||||
publication_type = 'newspaper'
|
||||
remove_tags_before = dict(name='div', attrs={'id':'date'})
|
||||
remove_tags_after = dict(name='div', attrs={'id':'column-1-3'})
|
||||
|
@ -18,23 +18,23 @@ msgstr ""
|
||||
"Report-Msgid-Bugs-To: Debian iso-codes team <pkg-isocodes-"
|
||||
"devel@lists.alioth.debian.org>\n"
|
||||
"POT-Creation-Date: 2011-09-02 16:21+0000\n"
|
||||
"PO-Revision-Date: 2011-08-27 06:01+0000\n"
|
||||
"Last-Translator: Wolfgang Rohdewald <wolfgang@rohdewald.de>\n"
|
||||
"PO-Revision-Date: 2011-09-13 16:28+0000\n"
|
||||
"Last-Translator: frenkx <Unknown>\n"
|
||||
"Language-Team: German <debian-l10n-german@lists.debian.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2011-09-03 05:03+0000\n"
|
||||
"X-Generator: Launchpad (build 13830)\n"
|
||||
"X-Launchpad-Export-Date: 2011-09-14 04:40+0000\n"
|
||||
"X-Generator: Launchpad (build 13921)\n"
|
||||
"Language: de\n"
|
||||
|
||||
#. name for aaa
|
||||
msgid "Ghotuo"
|
||||
msgstr ""
|
||||
msgstr "Ghotuo"
|
||||
|
||||
#. name for aab
|
||||
msgid "Alumu-Tesu"
|
||||
msgstr ""
|
||||
msgstr "Alumu-Tesu"
|
||||
|
||||
#. name for aac
|
||||
msgid "Ari"
|
||||
@ -120,9 +120,10 @@ msgstr ""
|
||||
msgid "Amarasi"
|
||||
msgstr ""
|
||||
|
||||
# auch: Abbé, Abbey oder Abi
|
||||
#. name for aba
|
||||
msgid "Abé"
|
||||
msgstr ""
|
||||
msgstr "Abé"
|
||||
|
||||
#. name for abb
|
||||
msgid "Bankon"
|
||||
@ -150,7 +151,7 @@ msgstr ""
|
||||
|
||||
#. name for abh
|
||||
msgid "Arabic, Tajiki"
|
||||
msgstr ""
|
||||
msgstr "Arabisch, Tadschikisch"
|
||||
|
||||
#. name for abi
|
||||
msgid "Abidji"
|
||||
@ -190,7 +191,7 @@ msgstr ""
|
||||
|
||||
#. name for abr
|
||||
msgid "Abron"
|
||||
msgstr ""
|
||||
msgstr "Abron"
|
||||
|
||||
#. name for abs
|
||||
msgid "Malay, Ambonese"
|
||||
@ -374,7 +375,7 @@ msgstr ""
|
||||
|
||||
#. name for ads
|
||||
msgid "Adamorobe Sign Language"
|
||||
msgstr ""
|
||||
msgstr "Adamorobe-Gebärdensprache"
|
||||
|
||||
#. name for adt
|
||||
msgid "Adnyamathanha"
|
||||
@ -626,7 +627,7 @@ msgstr ""
|
||||
|
||||
#. name for aha
|
||||
msgid "Ahanta"
|
||||
msgstr ""
|
||||
msgstr "Ahanta"
|
||||
|
||||
#. name for ahb
|
||||
msgid "Axamb"
|
||||
@ -1192,9 +1193,10 @@ msgstr ""
|
||||
msgid "Andra-Hus"
|
||||
msgstr ""
|
||||
|
||||
# auch: Anyi, Agni
|
||||
#. name for any
|
||||
msgid "Anyin"
|
||||
msgstr ""
|
||||
msgstr "Anyin"
|
||||
|
||||
#. name for anz
|
||||
msgid "Anem"
|
||||
@ -1418,7 +1420,7 @@ msgstr ""
|
||||
|
||||
#. name for arc
|
||||
msgid "Aramaic, Official (700-300 BCE)"
|
||||
msgstr ""
|
||||
msgstr "Aramäisch"
|
||||
|
||||
#. name for ard
|
||||
msgid "Arabana"
|
||||
@ -2114,7 +2116,7 @@ msgstr ""
|
||||
|
||||
#. name for bar
|
||||
msgid "Bavarian"
|
||||
msgstr ""
|
||||
msgstr "Bairisch"
|
||||
|
||||
#. name for bas
|
||||
msgid "Basa (Cameroon)"
|
||||
@ -2526,7 +2528,7 @@ msgstr ""
|
||||
|
||||
#. name for bet
|
||||
msgid "Béte, Guiberoua"
|
||||
msgstr ""
|
||||
msgstr "Guiberouabété"
|
||||
|
||||
#. name for beu
|
||||
msgid "Blagar"
|
||||
@ -2534,7 +2536,7 @@ msgstr ""
|
||||
|
||||
#. name for bev
|
||||
msgid "Bété, Daloa"
|
||||
msgstr ""
|
||||
msgstr "Daloabété"
|
||||
|
||||
#. name for bew
|
||||
msgid "Betawi"
|
||||
@ -3954,7 +3956,7 @@ msgstr ""
|
||||
|
||||
#. name for btg
|
||||
msgid "Bété, Gagnoa"
|
||||
msgstr ""
|
||||
msgstr "Gagnoabété"
|
||||
|
||||
#. name for bth
|
||||
msgid "Bidayuh, Biatah"
|
||||
@ -4884,9 +4886,10 @@ msgstr ""
|
||||
msgid "Chaudangsi"
|
||||
msgstr ""
|
||||
|
||||
# auch: Östlicher Min-Dialekt
|
||||
#. name for cdo
|
||||
msgid "Chinese, Min Dong"
|
||||
msgstr ""
|
||||
msgstr "Min Dong, Chinesisch"
|
||||
|
||||
#. name for cdr
|
||||
msgid "Cinda-Regi-Tiyal"
|
||||
@ -5034,7 +5037,7 @@ msgstr ""
|
||||
|
||||
#. name for chu
|
||||
msgid "Slavonic, Old"
|
||||
msgstr ""
|
||||
msgstr "Altkirchenslawisch"
|
||||
|
||||
#. name for chv
|
||||
msgid "Chuvash"
|
||||
@ -5162,7 +5165,7 @@ msgstr ""
|
||||
|
||||
#. name for ckb
|
||||
msgid "Kurdish, Central"
|
||||
msgstr ""
|
||||
msgstr "Zentralkurdisch"
|
||||
|
||||
#. name for ckh
|
||||
msgid "Chak"
|
||||
@ -5172,9 +5175,10 @@ msgstr ""
|
||||
msgid "Cibak"
|
||||
msgstr ""
|
||||
|
||||
# auch: Chokosi, Chakosi, Kyokosi, Tchokossi, Tiokossi
|
||||
#. name for cko
|
||||
msgid "Anufo"
|
||||
msgstr ""
|
||||
msgstr "Anufo"
|
||||
|
||||
#. name for ckq
|
||||
msgid "Kajakse"
|
||||
@ -5288,9 +5292,10 @@ msgstr ""
|
||||
msgid "Michigamea"
|
||||
msgstr ""
|
||||
|
||||
# auch: Mandarin
|
||||
#. name for cmn
|
||||
msgid "Chinese, Mandarin"
|
||||
msgstr ""
|
||||
msgstr "Hochchinesisch"
|
||||
|
||||
#. name for cmo
|
||||
msgid "Mnong, Central"
|
||||
@ -6294,7 +6299,7 @@ msgstr ""
|
||||
|
||||
#. name for dic
|
||||
msgid "Dida, Lakota"
|
||||
msgstr ""
|
||||
msgstr "Lakota Dida"
|
||||
|
||||
#. name for did
|
||||
msgid "Didinga"
|
||||
@ -6964,9 +6969,10 @@ msgstr ""
|
||||
msgid "Jola-Fonyi"
|
||||
msgstr ""
|
||||
|
||||
# auch: Dyula, Jula
|
||||
#. name for dyu
|
||||
msgid "Dyula"
|
||||
msgstr "Dyula"
|
||||
msgstr "Dioula"
|
||||
|
||||
#. name for dyy
|
||||
msgid "Dyaabugay"
|
||||
@ -7532,9 +7538,10 @@ msgstr ""
|
||||
msgid "Persian"
|
||||
msgstr "Persisch"
|
||||
|
||||
# auch: Fanti, Fannti, Odschi, Fante-Twi
|
||||
#. name for fat
|
||||
msgid "Fanti"
|
||||
msgstr "Fanti"
|
||||
msgstr "Fante"
|
||||
|
||||
#. name for fau
|
||||
msgid "Fayu"
|
||||
@ -8058,7 +8065,7 @@ msgstr ""
|
||||
|
||||
#. name for gct
|
||||
msgid "German, Colonia Tovar"
|
||||
msgstr ""
|
||||
msgstr "Alemán Coloniero Tovar"
|
||||
|
||||
#. name for gda
|
||||
msgid "Lohar, Gade"
|
||||
@ -8406,7 +8413,7 @@ msgstr ""
|
||||
|
||||
#. name for gkp
|
||||
msgid "Kpelle, Guinea"
|
||||
msgstr ""
|
||||
msgstr "Kpelle, Guinea"
|
||||
|
||||
#. name for gla
|
||||
msgid "Gaelic, Scottish"
|
||||
@ -8482,11 +8489,11 @@ msgstr ""
|
||||
|
||||
#. name for gmh
|
||||
msgid "German, Middle High (ca. 1050-1500)"
|
||||
msgstr ""
|
||||
msgstr "Mittelhochdeutsch (ca. 1050-1500)"
|
||||
|
||||
#. name for gml
|
||||
msgid "German, Middle Low"
|
||||
msgstr ""
|
||||
msgstr "Mittelniederdeutsch"
|
||||
|
||||
#. name for gmm
|
||||
msgid "Gbaya-Mbodomo"
|
||||
@ -8602,7 +8609,7 @@ msgstr ""
|
||||
|
||||
#. name for god
|
||||
msgid "Godié"
|
||||
msgstr ""
|
||||
msgstr "Godié"
|
||||
|
||||
#. name for goe
|
||||
msgid "Gongduk"
|
||||
@ -8618,7 +8625,7 @@ msgstr ""
|
||||
|
||||
#. name for goh
|
||||
msgid "German, Old High (ca. 750-1050)"
|
||||
msgstr ""
|
||||
msgstr "Althochdeutsch (ca. 750-1050)"
|
||||
|
||||
#. name for goi
|
||||
msgid "Gobasi"
|
||||
@ -8802,7 +8809,7 @@ msgstr ""
|
||||
|
||||
#. name for gsg
|
||||
msgid "German Sign Language"
|
||||
msgstr ""
|
||||
msgstr "Deutsche Gebärdensprache"
|
||||
|
||||
#. name for gsl
|
||||
msgid "Gusilay"
|
||||
@ -8830,7 +8837,7 @@ msgstr ""
|
||||
|
||||
#. name for gsw
|
||||
msgid "German, Swiss"
|
||||
msgstr ""
|
||||
msgstr "Schweizerdeutsch"
|
||||
|
||||
#. name for gta
|
||||
msgid "Guató"
|
||||
@ -8854,7 +8861,7 @@ msgstr ""
|
||||
|
||||
#. name for gud
|
||||
msgid "Dida, Yocoboué"
|
||||
msgstr ""
|
||||
msgstr "Yocoboué Dida"
|
||||
|
||||
#. name for gue
|
||||
msgid "Gurinji"
|
||||
@ -9158,7 +9165,7 @@ msgstr ""
|
||||
|
||||
#. name for hak
|
||||
msgid "Chinese, Hakka"
|
||||
msgstr ""
|
||||
msgstr "Hakka, Chinesisch"
|
||||
|
||||
#. name for hal
|
||||
msgid "Halang"
|
||||
@ -9694,7 +9701,7 @@ msgstr ""
|
||||
|
||||
#. name for hsb
|
||||
msgid "Sorbian, Upper"
|
||||
msgstr ""
|
||||
msgstr "Obersorbisch"
|
||||
|
||||
#. name for hsh
|
||||
msgid "Hungarian Sign Language"
|
||||
@ -11020,9 +11027,10 @@ msgstr ""
|
||||
msgid "Javanese, Caribbean"
|
||||
msgstr ""
|
||||
|
||||
# auch: Pepesa-Jwira
|
||||
#. name for jwi
|
||||
msgid "Jwira-Pepesa"
|
||||
msgstr ""
|
||||
msgstr "Jwira-Pepesa"
|
||||
|
||||
#. name for jya
|
||||
msgid "Jiarong"
|
||||
@ -12318,11 +12326,11 @@ msgstr ""
|
||||
|
||||
#. name for kmq
|
||||
msgid "Kwama"
|
||||
msgstr ""
|
||||
msgstr "Kwama"
|
||||
|
||||
#. name for kmr
|
||||
msgid "Kurdish, Northern"
|
||||
msgstr ""
|
||||
msgstr "Nordkurdisch"
|
||||
|
||||
#. name for kms
|
||||
msgid "Kamasau"
|
||||
@ -12886,7 +12894,7 @@ msgstr ""
|
||||
|
||||
#. name for ksh
|
||||
msgid "Kölsch"
|
||||
msgstr ""
|
||||
msgstr "Kölsch"
|
||||
|
||||
#. name for ksi
|
||||
msgid "Krisa"
|
||||
@ -13498,7 +13506,7 @@ msgstr ""
|
||||
|
||||
#. name for kyf
|
||||
msgid "Kouya"
|
||||
msgstr ""
|
||||
msgstr "Kouya"
|
||||
|
||||
#. name for kyg
|
||||
msgid "Keyagana"
|
||||
@ -14826,7 +14834,7 @@ msgstr ""
|
||||
|
||||
#. name for ltg
|
||||
msgid "Latgalian"
|
||||
msgstr ""
|
||||
msgstr "Lettgallisch"
|
||||
|
||||
#. name for lti
|
||||
msgid "Leti (Indonesia)"
|
||||
@ -16382,9 +16390,10 @@ msgstr ""
|
||||
msgid "Mnong, Southern"
|
||||
msgstr ""
|
||||
|
||||
# auch: nördliches Min
|
||||
#. name for mnp
|
||||
msgid "Chinese, Min Bei"
|
||||
msgstr ""
|
||||
msgstr "Min Bei, Chinesisch"
|
||||
|
||||
#. name for mnq
|
||||
msgid "Minriq"
|
||||
@ -17662,9 +17671,10 @@ msgstr ""
|
||||
msgid "Nangikurrunggurr"
|
||||
msgstr ""
|
||||
|
||||
# auch: Südliche Min-Sprache
|
||||
#. name for nan
|
||||
msgid "Chinese, Min Nan"
|
||||
msgstr ""
|
||||
msgstr "Min Nan, Chinesisch"
|
||||
|
||||
#. name for nao
|
||||
msgid "Naaba"
|
||||
@ -19306,9 +19316,10 @@ msgstr ""
|
||||
msgid "Nawathinehena"
|
||||
msgstr ""
|
||||
|
||||
# auch: Nyaboa
|
||||
#. name for nwb
|
||||
msgid "Nyabwa"
|
||||
msgstr ""
|
||||
msgstr "Nyabwa"
|
||||
|
||||
#. name for nwc
|
||||
msgid "Newari, Old"
|
||||
@ -19494,9 +19505,10 @@ msgstr ""
|
||||
msgid "Njebi"
|
||||
msgstr ""
|
||||
|
||||
# auch: Nzima, Appolo
|
||||
#. name for nzi
|
||||
msgid "Nzima"
|
||||
msgstr "Nzima"
|
||||
msgstr "Nzema"
|
||||
|
||||
#. name for nzk
|
||||
msgid "Nzakara"
|
||||
@ -22702,7 +22714,7 @@ msgstr ""
|
||||
|
||||
#. name for sdh
|
||||
msgid "Kurdish, Southern"
|
||||
msgstr ""
|
||||
msgstr "Südkurdisch"
|
||||
|
||||
#. name for sdj
|
||||
msgid "Suundi"
|
||||
@ -22864,9 +22876,10 @@ msgstr ""
|
||||
msgid "South African Sign Language"
|
||||
msgstr ""
|
||||
|
||||
# auch: Sefwi, Asahyue
|
||||
#. name for sfw
|
||||
msgid "Sehwi"
|
||||
msgstr ""
|
||||
msgstr "Sehwi"
|
||||
|
||||
#. name for sga
|
||||
msgid "Irish, Old (to 900)"
|
||||
@ -23414,7 +23427,7 @@ msgstr ""
|
||||
|
||||
#. name for sme
|
||||
msgid "Sami, Northern"
|
||||
msgstr ""
|
||||
msgstr "Nordsamisch"
|
||||
|
||||
#. name for smf
|
||||
msgid "Auwe"
|
||||
@ -24228,7 +24241,7 @@ msgstr ""
|
||||
|
||||
#. name for swg
|
||||
msgid "Swabian"
|
||||
msgstr ""
|
||||
msgstr "Schwäbisch"
|
||||
|
||||
#. name for swh
|
||||
msgid "Swahili (individual language)"
|
||||
@ -24648,9 +24661,10 @@ msgstr ""
|
||||
msgid "Tabaru"
|
||||
msgstr ""
|
||||
|
||||
# auch: Ditamari, Tamari, Somba, Soma, Some, Tamberma
|
||||
#. name for tbz
|
||||
msgid "Ditammari"
|
||||
msgstr ""
|
||||
msgstr "Ditammari"
|
||||
|
||||
#. name for tca
|
||||
msgid "Ticuna"
|
||||
@ -25356,7 +25370,7 @@ msgstr ""
|
||||
|
||||
#. name for tlh
|
||||
msgid "Klingon"
|
||||
msgstr ""
|
||||
msgstr "Klingonisch"
|
||||
|
||||
#. name for tli
|
||||
msgid "Tlingit"
|
||||
@ -26596,7 +26610,7 @@ msgstr "Udmurt"
|
||||
|
||||
#. name for udu
|
||||
msgid "Uduk"
|
||||
msgstr ""
|
||||
msgstr "Uduk"
|
||||
|
||||
#. name for ues
|
||||
msgid "Kioko"
|
||||
@ -27412,7 +27426,7 @@ msgstr ""
|
||||
|
||||
#. name for wae
|
||||
msgid "Walser"
|
||||
msgstr ""
|
||||
msgstr "Walser"
|
||||
|
||||
#. name for waf
|
||||
msgid "Wakoná"
|
||||
@ -28180,7 +28194,7 @@ msgstr ""
|
||||
|
||||
#. name for wuu
|
||||
msgid "Chinese, Wu"
|
||||
msgstr ""
|
||||
msgstr "Wu, Chinesisch"
|
||||
|
||||
#. name for wuv
|
||||
msgid "Wuvulu-Aua"
|
||||
@ -28868,7 +28882,7 @@ msgstr ""
|
||||
|
||||
#. name for xom
|
||||
msgid "Komo (Sudan)"
|
||||
msgstr ""
|
||||
msgstr "Komo (Sudan)"
|
||||
|
||||
#. name for xon
|
||||
msgid "Konkomba"
|
||||
@ -28896,7 +28910,7 @@ msgstr ""
|
||||
|
||||
#. name for xpe
|
||||
msgid "Kpelle, Liberia"
|
||||
msgstr ""
|
||||
msgstr "Kpelle, Liberia"
|
||||
|
||||
#. name for xpg
|
||||
msgid "Phrygian"
|
||||
|
@ -8,13 +8,13 @@ msgstr ""
|
||||
"Project-Id-Version: calibre\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2011-09-02 16:21+0000\n"
|
||||
"PO-Revision-Date: 2011-09-08 10:13+0000\n"
|
||||
"PO-Revision-Date: 2011-09-09 13:18+0000\n"
|
||||
"Last-Translator: Jellby <Unknown>\n"
|
||||
"Language-Team: Spanish <es@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2011-09-09 04:37+0000\n"
|
||||
"X-Launchpad-Export-Date: 2011-09-10 05:01+0000\n"
|
||||
"X-Generator: Launchpad (build 13900)\n"
|
||||
|
||||
#. name for aaa
|
||||
@ -1615,7 +1615,7 @@ msgstr "Atemble"
|
||||
|
||||
#. name for atg
|
||||
msgid "Ivbie North-Okpela-Arhe"
|
||||
msgstr ""
|
||||
msgstr "Ivbie norte-okpela-arhe"
|
||||
|
||||
#. name for ati
|
||||
msgid "Attié"
|
||||
@ -2803,7 +2803,7 @@ msgstr "Bima"
|
||||
|
||||
#. name for bhq
|
||||
msgid "Tukang Besi South"
|
||||
msgstr ""
|
||||
msgstr "Tukang besi sur"
|
||||
|
||||
#. name for bhr
|
||||
msgid "Malagasy, Bara"
|
||||
@ -4375,19 +4375,19 @@ msgstr "Barikanchi"
|
||||
|
||||
#. name for bxp
|
||||
msgid "Bebil"
|
||||
msgstr ""
|
||||
msgstr "Bebil"
|
||||
|
||||
#. name for bxq
|
||||
msgid "Beele"
|
||||
msgstr ""
|
||||
msgstr "Beele"
|
||||
|
||||
#. name for bxr
|
||||
msgid "Buriat, Russia"
|
||||
msgstr ""
|
||||
msgstr "Buriat de Rusia"
|
||||
|
||||
#. name for bxs
|
||||
msgid "Busam"
|
||||
msgstr ""
|
||||
msgstr "Busam"
|
||||
|
||||
#. name for bxu
|
||||
msgid "Buriat, China"
|
||||
@ -4463,11 +4463,11 @@ msgstr "Bidyara"
|
||||
|
||||
#. name for byn
|
||||
msgid "Bilin"
|
||||
msgstr ""
|
||||
msgstr "Bilin"
|
||||
|
||||
#. name for byo
|
||||
msgid "Biyo"
|
||||
msgstr ""
|
||||
msgstr "Biyo"
|
||||
|
||||
#. name for byp
|
||||
msgid "Bumaji"
|
||||
@ -4659,19 +4659,19 @@ msgstr "Carolinio"
|
||||
|
||||
#. name for cam
|
||||
msgid "Cemuhî"
|
||||
msgstr ""
|
||||
msgstr "Cemuhî"
|
||||
|
||||
#. name for can
|
||||
msgid "Chambri"
|
||||
msgstr ""
|
||||
msgstr "Chambri"
|
||||
|
||||
#. name for cao
|
||||
msgid "Chácobo"
|
||||
msgstr ""
|
||||
msgstr "Chácobo"
|
||||
|
||||
#. name for cap
|
||||
msgid "Chipaya"
|
||||
msgstr ""
|
||||
msgstr "Chipaya"
|
||||
|
||||
#. name for caq
|
||||
msgid "Nicobarese, Car"
|
||||
@ -4679,11 +4679,11 @@ msgstr "Nicobarés de Car"
|
||||
|
||||
#. name for car
|
||||
msgid "Carib, Galibi"
|
||||
msgstr ""
|
||||
msgstr "Caribe galibí"
|
||||
|
||||
#. name for cas
|
||||
msgid "Tsimané"
|
||||
msgstr ""
|
||||
msgstr "Tsimané"
|
||||
|
||||
#. name for cat
|
||||
msgid "Catalan"
|
||||
@ -4691,175 +4691,175 @@ msgstr "Catalán"
|
||||
|
||||
#. name for cav
|
||||
msgid "Cavineña"
|
||||
msgstr ""
|
||||
msgstr "Cavineña"
|
||||
|
||||
#. name for caw
|
||||
msgid "Callawalla"
|
||||
msgstr ""
|
||||
msgstr "Callawalla"
|
||||
|
||||
#. name for cax
|
||||
msgid "Chiquitano"
|
||||
msgstr ""
|
||||
msgstr "Chiquitano"
|
||||
|
||||
#. name for cay
|
||||
msgid "Cayuga"
|
||||
msgstr ""
|
||||
msgstr "Cayuga"
|
||||
|
||||
#. name for caz
|
||||
msgid "Canichana"
|
||||
msgstr ""
|
||||
msgstr "Canichana"
|
||||
|
||||
#. name for cbb
|
||||
msgid "Cabiyarí"
|
||||
msgstr ""
|
||||
msgstr "Cabiyarí"
|
||||
|
||||
#. name for cbc
|
||||
msgid "Carapana"
|
||||
msgstr ""
|
||||
msgstr "Carapana"
|
||||
|
||||
#. name for cbd
|
||||
msgid "Carijona"
|
||||
msgstr ""
|
||||
msgstr "Carijona"
|
||||
|
||||
#. name for cbe
|
||||
msgid "Chipiajes"
|
||||
msgstr ""
|
||||
msgstr "Chipiajes"
|
||||
|
||||
#. name for cbg
|
||||
msgid "Chimila"
|
||||
msgstr ""
|
||||
msgstr "Chimila"
|
||||
|
||||
#. name for cbh
|
||||
msgid "Cagua"
|
||||
msgstr ""
|
||||
msgstr "Cagua"
|
||||
|
||||
#. name for cbi
|
||||
msgid "Chachi"
|
||||
msgstr ""
|
||||
msgstr "Chachi"
|
||||
|
||||
#. name for cbj
|
||||
msgid "Ede Cabe"
|
||||
msgstr ""
|
||||
msgstr "Ede cabe"
|
||||
|
||||
#. name for cbk
|
||||
msgid "Chavacano"
|
||||
msgstr ""
|
||||
msgstr "Chabacano"
|
||||
|
||||
#. name for cbl
|
||||
msgid "Chin, Bualkhaw"
|
||||
msgstr ""
|
||||
msgstr "Chin bualkhaw"
|
||||
|
||||
#. name for cbn
|
||||
msgid "Nyahkur"
|
||||
msgstr ""
|
||||
msgstr "Nyahkur"
|
||||
|
||||
#. name for cbo
|
||||
msgid "Izora"
|
||||
msgstr ""
|
||||
msgstr "Izora"
|
||||
|
||||
#. name for cbr
|
||||
msgid "Cashibo-Cacataibo"
|
||||
msgstr ""
|
||||
msgstr "Cashibo-cacataibo"
|
||||
|
||||
#. name for cbs
|
||||
msgid "Cashinahua"
|
||||
msgstr ""
|
||||
msgstr "Cashinahua"
|
||||
|
||||
#. name for cbt
|
||||
msgid "Chayahuita"
|
||||
msgstr ""
|
||||
msgstr "Chayahuita"
|
||||
|
||||
#. name for cbu
|
||||
msgid "Candoshi-Shapra"
|
||||
msgstr ""
|
||||
msgstr "Candoshi-Shapra"
|
||||
|
||||
#. name for cbv
|
||||
msgid "Cacua"
|
||||
msgstr ""
|
||||
msgstr "Cacua"
|
||||
|
||||
#. name for cbw
|
||||
msgid "Kinabalian"
|
||||
msgstr ""
|
||||
msgstr "Kinabalian"
|
||||
|
||||
#. name for cby
|
||||
msgid "Carabayo"
|
||||
msgstr ""
|
||||
msgstr "Carabayo"
|
||||
|
||||
#. name for cca
|
||||
msgid "Cauca"
|
||||
msgstr ""
|
||||
msgstr "Cauca"
|
||||
|
||||
#. name for ccc
|
||||
msgid "Chamicuro"
|
||||
msgstr ""
|
||||
msgstr "Chamicuro"
|
||||
|
||||
#. name for ccd
|
||||
msgid "Creole, Cafundo"
|
||||
msgstr ""
|
||||
msgstr "Criollo de Cafundo"
|
||||
|
||||
#. name for cce
|
||||
msgid "Chopi"
|
||||
msgstr ""
|
||||
msgstr "Chopi"
|
||||
|
||||
#. name for ccg
|
||||
msgid "Daka, Samba"
|
||||
msgstr ""
|
||||
msgstr "Samba daka"
|
||||
|
||||
#. name for cch
|
||||
msgid "Atsam"
|
||||
msgstr ""
|
||||
msgstr "Atsam"
|
||||
|
||||
#. name for ccj
|
||||
msgid "Kasanga"
|
||||
msgstr ""
|
||||
msgstr "Kasanga"
|
||||
|
||||
#. name for ccl
|
||||
msgid "Cutchi-Swahili"
|
||||
msgstr ""
|
||||
msgstr "Cutchi-suajili"
|
||||
|
||||
#. name for ccm
|
||||
msgid "Creole Malay, Malaccan"
|
||||
msgstr ""
|
||||
msgstr "Malayo criollo de Malaca"
|
||||
|
||||
#. name for cco
|
||||
msgid "Chinantec, Comaltepec"
|
||||
msgstr ""
|
||||
msgstr "Chinanteco de Comaltepec"
|
||||
|
||||
#. name for ccp
|
||||
msgid "Chakma"
|
||||
msgstr ""
|
||||
msgstr "Chakma"
|
||||
|
||||
#. name for ccq
|
||||
msgid "Chaungtha"
|
||||
msgstr ""
|
||||
msgstr "Chaungtha"
|
||||
|
||||
#. name for ccr
|
||||
msgid "Cacaopera"
|
||||
msgstr ""
|
||||
msgstr "Cacaopera"
|
||||
|
||||
#. name for cda
|
||||
msgid "Choni"
|
||||
msgstr ""
|
||||
msgstr "Choni"
|
||||
|
||||
#. name for cde
|
||||
msgid "Chenchu"
|
||||
msgstr ""
|
||||
msgstr "Chenchu"
|
||||
|
||||
#. name for cdf
|
||||
msgid "Chiru"
|
||||
msgstr ""
|
||||
msgstr "Chiru"
|
||||
|
||||
#. name for cdg
|
||||
msgid "Chamari"
|
||||
msgstr ""
|
||||
msgstr "Chamari"
|
||||
|
||||
#. name for cdh
|
||||
msgid "Chambeali"
|
||||
msgstr ""
|
||||
msgstr "Chambeali"
|
||||
|
||||
#. name for cdi
|
||||
msgid "Chodri"
|
||||
msgstr ""
|
||||
msgstr "Chodri"
|
||||
|
||||
#. name for cdj
|
||||
msgid "Churahi"
|
||||
@ -4867,7 +4867,7 @@ msgstr ""
|
||||
|
||||
#. name for cdm
|
||||
msgid "Chepang"
|
||||
msgstr ""
|
||||
msgstr "Chepang"
|
||||
|
||||
#. name for cdn
|
||||
msgid "Chaudangsi"
|
||||
@ -11743,7 +11743,7 @@ msgstr ""
|
||||
|
||||
#. name for khc
|
||||
msgid "Tukang Besi North"
|
||||
msgstr ""
|
||||
msgstr "Tukang besi norte"
|
||||
|
||||
#. name for khd
|
||||
msgid "Kanum, Bädi"
|
||||
@ -24187,11 +24187,11 @@ msgstr "Suajili (macrolengua)"
|
||||
|
||||
#. name for swb
|
||||
msgid "Comorian, Maore"
|
||||
msgstr ""
|
||||
msgstr "Comorense de Mayotte"
|
||||
|
||||
#. name for swc
|
||||
msgid "Swahili, Congo"
|
||||
msgstr ""
|
||||
msgstr "Suajili del Congo"
|
||||
|
||||
#. name for swe
|
||||
msgid "Swedish"
|
||||
@ -27759,7 +27759,7 @@ msgstr ""
|
||||
|
||||
#. name for wlc
|
||||
msgid "Comorian, Mwali"
|
||||
msgstr ""
|
||||
msgstr "Comorense de Mohéli"
|
||||
|
||||
#. name for wle
|
||||
msgid "Wolane"
|
||||
@ -27899,7 +27899,7 @@ msgstr ""
|
||||
|
||||
#. name for wni
|
||||
msgid "Comorian, Ndzwani"
|
||||
msgstr ""
|
||||
msgstr "Comorense de Anjouan"
|
||||
|
||||
#. name for wnk
|
||||
msgid "Wanukaka"
|
||||
@ -30263,7 +30263,7 @@ msgstr ""
|
||||
|
||||
#. name for zdj
|
||||
msgid "Comorian, Ngazidja"
|
||||
msgstr ""
|
||||
msgstr "Comorense de Gran Comora"
|
||||
|
||||
#. name for zea
|
||||
msgid "Zeeuws"
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -320,6 +320,28 @@ def get_parsed_proxy(typ='http', debug=True):
|
||||
prints('Using http proxy', str(ans))
|
||||
return ans
|
||||
|
||||
def get_proxy_info(proxy_scheme, proxy_string):
|
||||
'''
|
||||
Parse all proxy information from a proxy string (as returned by
|
||||
get_proxies). The returned dict will have members set to None when the info
|
||||
is not available in the string. If an exception occurs parsing the string
|
||||
this method returns None.
|
||||
'''
|
||||
import urlparse
|
||||
try:
|
||||
proxy_url = u'%s://%s'%(proxy_scheme, proxy_string)
|
||||
urlinfo = urlparse.urlparse(proxy_url)
|
||||
ans = {
|
||||
u'scheme': urlinfo.scheme,
|
||||
u'hostname': urlinfo.hostname,
|
||||
u'port': urlinfo.port,
|
||||
u'username': urlinfo.username,
|
||||
u'password': urlinfo.password,
|
||||
}
|
||||
except:
|
||||
return None
|
||||
return ans
|
||||
|
||||
USER_AGENT = 'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101210 Gentoo Firefox/3.6.13'
|
||||
USER_AGENT_MOBILE = 'Mozilla/5.0 (Windows; U; Windows CE 5.1; rv:1.8.1a3) Gecko/20060610 Minimo/0.016'
|
||||
|
||||
|
@ -4,7 +4,7 @@ __license__ = 'GPL v3'
|
||||
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
__appname__ = u'calibre'
|
||||
numeric_version = (0, 8, 18)
|
||||
numeric_version = (0, 8, 19)
|
||||
__version__ = u'.'.join(map(unicode, numeric_version))
|
||||
__author__ = u"Kovid Goyal <kovid@kovidgoyal.net>"
|
||||
|
||||
@ -33,6 +33,7 @@ islinux = not(iswindows or isosx or isbsd)
|
||||
isfrozen = hasattr(sys, 'frozen')
|
||||
isunix = isosx or islinux
|
||||
isportable = os.environ.get('CALIBRE_PORTABLE_BUILD', None) is not None
|
||||
ispy3 = sys.version_info.major > 2
|
||||
|
||||
try:
|
||||
preferred_encoding = locale.getpreferredencoding()
|
||||
|
@ -11,7 +11,7 @@ __docformat__ = 'restructuredtext en'
|
||||
Input plugin for HTML or OPF ebooks.
|
||||
'''
|
||||
|
||||
import os, re, sys, uuid, tempfile
|
||||
import os, re, sys, uuid, tempfile, errno as gerrno
|
||||
from urlparse import urlparse, urlunparse
|
||||
from urllib import unquote
|
||||
from functools import partial
|
||||
@ -75,7 +75,7 @@ class IgnoreFile(Exception):
|
||||
|
||||
def __init__(self, msg, errno):
|
||||
Exception.__init__(self, msg)
|
||||
self.doesnt_exist = errno == errno.ENOENT
|
||||
self.doesnt_exist = errno == gerrno.ENOENT
|
||||
self.errno = errno
|
||||
|
||||
class HTMLFile(object):
|
||||
|
@ -753,15 +753,24 @@ def open_local_file(path):
|
||||
url = QUrl.fromLocalFile(path)
|
||||
open_url(url)
|
||||
|
||||
def is_ok_to_use_qt():
|
||||
def must_use_qt():
|
||||
global gui_thread, _store_app
|
||||
if (islinux or isbsd) and ':' not in os.environ.get('DISPLAY', ''):
|
||||
return False
|
||||
raise RuntimeError('X server required. If you are running on a'
|
||||
' headless machine, use xvfb')
|
||||
if _store_app is None and QApplication.instance() is None:
|
||||
_store_app = QApplication([])
|
||||
if gui_thread is None:
|
||||
gui_thread = QThread.currentThread()
|
||||
return gui_thread is QThread.currentThread()
|
||||
if gui_thread is not QThread.currentThread():
|
||||
raise RuntimeError('Cannot use Qt in non GUI thread')
|
||||
|
||||
def is_ok_to_use_qt():
|
||||
try:
|
||||
must_use_qt()
|
||||
except RuntimeError:
|
||||
return False
|
||||
return True
|
||||
|
||||
def is_gui_thread():
|
||||
global gui_thread
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
10
src/calibre/web/jsbrowser/__init__.py
Normal file
10
src/calibre/web/jsbrowser/__init__.py
Normal file
@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env python
|
||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
||||
from __future__ import (unicode_literals, division, absolute_import,
|
||||
print_function)
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
|
221
src/calibre/web/jsbrowser/browser.py
Normal file
221
src/calibre/web/jsbrowser/browser.py
Normal file
@ -0,0 +1,221 @@
|
||||
#!/usr/bin/env python
|
||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
||||
from __future__ import (unicode_literals, division, absolute_import,
|
||||
print_function)
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
import os, pprint
|
||||
|
||||
from PyQt4.Qt import (QObject, QNetworkAccessManager, QNetworkDiskCache,
|
||||
QNetworkProxy, QNetworkProxyFactory)
|
||||
from PyQt4.QtWebKit import QWebPage
|
||||
|
||||
from calibre import USER_AGENT, prints, get_proxies, get_proxy_info
|
||||
from calibre.constants import ispy3, config_dir
|
||||
from calibre.utils.logging import ThreadSafeLog
|
||||
from calibre.gui2 import must_use_qt
|
||||
|
||||
class WebPage(QWebPage): # {{{
|
||||
|
||||
def __init__(self, log,
|
||||
confirm_callback=None,
|
||||
prompt_callback=None,
|
||||
user_agent=USER_AGENT,
|
||||
parent=None):
|
||||
QWebPage.__init__(self, parent)
|
||||
|
||||
self.log = log
|
||||
self.user_agent = user_agent if user_agent else USER_AGENT
|
||||
self.confirm_callback = confirm_callback
|
||||
self.prompt_callback = prompt_callback
|
||||
self.setForwardUnsupportedContent(True)
|
||||
self.unsupportedContent.connect(self.on_unsupported_content)
|
||||
|
||||
def userAgentForUrl(self, url):
|
||||
return self.user_agent
|
||||
|
||||
def javaScriptAlert(self, frame, msg):
|
||||
if self.view() is not None:
|
||||
return QWebPage.javaScriptAlert(self, frame, msg)
|
||||
prints('JSBrowser alert():', unicode(msg))
|
||||
|
||||
def javaScriptConfirm(self, frame, msg):
|
||||
if self.view() is not None:
|
||||
return QWebPage.javaScriptConfirm(self, frame, msg)
|
||||
if self.confirm_callback is not None:
|
||||
return self.confirm_callback(unicode(msg))
|
||||
return True
|
||||
|
||||
def javaScriptConsoleMessage(self, msg, lineno, source_id):
|
||||
prints('JSBrowser msg():%s:%s:'%(unicode(source_id), lineno), unicode(msg))
|
||||
|
||||
def javaScriptPrompt(self, frame, msg, default_value, *args):
|
||||
if self.view() is not None:
|
||||
return QWebPage.javaScriptPrompt(self, frame, msg, default_value,
|
||||
*args)
|
||||
if self.prompt_callback is None:
|
||||
return (False, default_value) if ispy3 else False
|
||||
value = self.prompt_callback(unicode(msg), unicode(default_value))
|
||||
ok = value is not None
|
||||
if ispy3:
|
||||
return ok, value
|
||||
if ok:
|
||||
result = args[0]
|
||||
result.clear()
|
||||
result.append(value)
|
||||
return ok
|
||||
|
||||
def shouldInterruptJavaScript(self):
|
||||
if self.view() is not None:
|
||||
return QWebPage.shouldInterruptJavaScript(self)
|
||||
return True
|
||||
|
||||
def on_unsupported_content(self, reply):
|
||||
self.log.warn('Unsupported content, ignoring: %s'%reply.url())
|
||||
|
||||
# }}}
|
||||
|
||||
class ProxyFactory(QNetworkProxyFactory): # {{{
|
||||
|
||||
def __init__(self, log):
|
||||
QNetworkProxyFactory.__init__(self)
|
||||
proxies = get_proxies()
|
||||
self.proxies = {}
|
||||
for scheme, proxy_string in proxies.iteritems():
|
||||
scheme = scheme.lower()
|
||||
info = get_proxy_info(scheme, proxy_string)
|
||||
if info is None: continue
|
||||
hn, port = info['hostname'], info['port']
|
||||
if not hn or not port: continue
|
||||
log.debug('JSBrowser using proxy:', pprint.pformat(info))
|
||||
pt = {'socks5':QNetworkProxy.Socks5Proxy}.get(scheme,
|
||||
QNetworkProxy.HttpProxy)
|
||||
proxy = QNetworkProxy(pt, hn, port)
|
||||
un, pw = info['username'], info['password']
|
||||
if un:
|
||||
proxy.setUser(un)
|
||||
if pw:
|
||||
proxy.setPassword(pw)
|
||||
self.proxies[scheme] = proxy
|
||||
|
||||
self.default_proxy = QNetworkProxy(QNetworkProxy.DefaultProxy)
|
||||
|
||||
def queryProxy(self, query):
|
||||
scheme = unicode(query.protocolTag()).lower()
|
||||
return [self.proxies.get(scheme, self.default_proxy)]
|
||||
# }}}
|
||||
|
||||
class NetworkAccessManager(QNetworkAccessManager): # {{{
|
||||
|
||||
OPERATION_NAMES = { getattr(QNetworkAccessManager, '%sOperation'%x) :
|
||||
x.upper() for x in ('Head', 'Get', 'Put', 'Post', 'Delete',
|
||||
'Custom')
|
||||
}
|
||||
|
||||
def __init__(self, log, use_disk_cache=True, parent=None):
|
||||
QNetworkAccessManager.__init__(self, parent)
|
||||
self.log = log
|
||||
if use_disk_cache:
|
||||
self.cache = QNetworkDiskCache(self)
|
||||
self.cache.setCacheDirectory(os.path.join(config_dir, 'caches',
|
||||
'jsbrowser'))
|
||||
self.setCache(self.cache)
|
||||
self.sslErrors.connect(self.on_ssl_errors)
|
||||
self.pf = ProxyFactory(log)
|
||||
self.setProxyFactory(self.pf)
|
||||
self.finished.connect(self.on_finished)
|
||||
|
||||
def on_ssl_errors(self, reply, errors):
|
||||
reply.ignoreSslErrors()
|
||||
|
||||
def createRequest(self, operation, request, data):
|
||||
url = unicode(request.url().toString())
|
||||
operation_name = self.OPERATION_NAMES[operation]
|
||||
debug = []
|
||||
debug.append(('Request: %s %s' % (operation_name, url)))
|
||||
for h in request.rawHeaderList():
|
||||
try:
|
||||
d = ' %s: %s' % (h, request.rawHeader(h))
|
||||
except:
|
||||
d = ' %r: %r' % (h, request.rawHeader(h))
|
||||
debug.append(d)
|
||||
|
||||
if data is not None:
|
||||
raw = data.peek(1024)
|
||||
try:
|
||||
raw = raw.decode('utf-8')
|
||||
except:
|
||||
raw = repr(raw)
|
||||
debug.append(' Request data: %s'%raw)
|
||||
|
||||
self.log.debug('\n'.join(debug))
|
||||
return QNetworkAccessManager.createRequest(self, operation, request,
|
||||
data)
|
||||
|
||||
def on_finished(self, reply):
|
||||
reply_url = unicode(reply.url().toString())
|
||||
|
||||
if reply.error():
|
||||
self.log.warn("Reply error: %s - %d (%s)" %
|
||||
(reply_url, reply.error(), reply.errorString()))
|
||||
else:
|
||||
debug = []
|
||||
debug.append("Reply successful: %s" % reply_url)
|
||||
for h in reply.rawHeaderList():
|
||||
try:
|
||||
d = ' %s: %s' % (h, reply.rawHeader(h))
|
||||
except:
|
||||
d = ' %r: %r' % (h, reply.rawHeader(h))
|
||||
debug.append(d)
|
||||
self.log.debug('\n'.join(debug))
|
||||
# }}}
|
||||
|
||||
class Browser(QObject):
|
||||
|
||||
def __init__(self,
|
||||
# Logging. If None, uses a default log, which does not output
|
||||
# debugging info
|
||||
log = None,
|
||||
# Receives a string and returns True/False. By default, returns
|
||||
# True for all strings
|
||||
confirm_callback=None,
|
||||
|
||||
# Prompt callback. Receives a msg string and a default value
|
||||
# string. Should return the user input value or None if the user
|
||||
# canceled the prompt. By default returns None.
|
||||
prompt_callback=None,
|
||||
|
||||
# User agent to be used
|
||||
user_agent=USER_AGENT,
|
||||
|
||||
# If True a disk cache is used
|
||||
use_disk_cache=True,
|
||||
|
||||
# Verbosity
|
||||
verbosity = 0
|
||||
):
|
||||
must_use_qt()
|
||||
QObject.__init__(self)
|
||||
|
||||
if log is None:
|
||||
log = ThreadSafeLog()
|
||||
if verbosity:
|
||||
log.filter_level = log.DEBUG
|
||||
|
||||
self.jquery_lib = P('content_server/jquery.js', data=True,
|
||||
allow_user_override=False).decode('utf-8')
|
||||
self.simulate_lib = P('jquery.simulate.js', data=True,
|
||||
allow_user_override=False).decode('utf-8')
|
||||
|
||||
self.page = WebPage(log, confirm_callback=confirm_callback,
|
||||
prompt_callback=prompt_callback, user_agent=user_agent,
|
||||
parent=self)
|
||||
self.nam = NetworkAccessManager(log, use_disk_cache=use_disk_cache, parent=self)
|
||||
self.page.setNetworkAccessManager(self.nam)
|
||||
|
||||
def visit(self, url):
|
||||
pass
|
||||
|
Loading…
x
Reference in New Issue
Block a user