diff --git a/resources/images/news/novaya_gazeta.png b/resources/images/news/novaya_gazeta.png new file mode 100644 index 0000000000..41886a64b9 Binary files /dev/null and b/resources/images/news/novaya_gazeta.png differ diff --git a/resources/images/news/vedomosti.png b/resources/images/news/vedomosti.png new file mode 100644 index 0000000000..3187308f4e Binary files /dev/null and b/resources/images/news/vedomosti.png differ diff --git a/resources/mime.types b/resources/mime.types new file mode 100644 index 0000000000..ab98b3bf4a --- /dev/null +++ b/resources/mime.types @@ -0,0 +1,1381 @@ +## Mimetypes from my linux system + +application/activemessage +application/andrew-inset ez +application/applefile +application/applixware aw +application/atom+xml atom +application/atomcat+xml atomcat +application/atomicmail +application/atomsvc+xml atomsvc +application/auth-policy+xml +application/batch-smtp +application/beep+xml +application/cals-1840 +application/ccxml+xml ccxml +application/cea-2018+xml +application/cellml+xml +application/cnrp+xml +application/commonground +application/conference-info+xml +application/cpl+xml +application/csta+xml +application/cstadata+xml +application/cu-seeme cu +application/cybercash +application/davmount+xml davmount +application/dca-rft +application/dec-dx +application/dialog-info+xml +application/dicom +application/dns +application/dsptype tsp +application/dvcs +application/ecmascript ecma +application/edi-consent +application/edi-x12 +application/edifact +application/emma+xml emma +application/epp+xml +application/epub+zip epub +application/eshop +application/example +application/fastinfoset +application/fastsoap +application/fits +application/font-tdpfr pfr +application/futuresplash spl +application/h224 +application/hta hta +application/http +application/hyperstudio stk +application/ibe-key-request+xml +application/ibe-pkg-reply+xml +application/ibe-pp-data +application/iges +application/im-iscomposing+xml +application/index +application/index.cmd +application/index.obj +application/index.response +application/index.vnd +application/iotp +application/ipp +application/isup +application/java-archive jar +application/java-serialized-object ser +application/java-vm class +application/javascript js +application/json json +application/kpml-request+xml +application/kpml-response+xml +application/lost+xml lostxml +application/mac-binhex40 hqx +application/mac-compactpro cpt +application/macwriteii +application/marc mrc +application/mathematica ma mb nb +application/mathml+xml mathml +application/mbms-associated-procedure-description+xml +application/mbms-deregister+xml +application/mbms-envelope+xml +application/mbms-msk+xml +application/mbms-msk-response+xml +application/mbms-protection-description+xml +application/mbms-reception-report+xml +application/mbms-register+xml +application/mbms-register-response+xml +application/mbms-user-service-description+xml +application/mbox mbox +application/media_control+xml +application/mediaservercontrol+xml mscml +application/mikey +application/moss-keys +application/moss-signature +application/mosskey-data +application/mosskey-request +application/mp4 mp4s +application/mpeg4-generic +application/mpeg4-iod +application/mpeg4-iod-xmt +application/msaccess mdb +application/msword doc dot +application/mxf mxf +application/nasdata +application/news-checkgroups +application/news-groupinfo +application/news-transmission +application/nss +application/ocsp-request +application/ocsp-response +application/octet-stream bin bpk deploy dist distz dmg dms dump elc iso lha lrf lzh pkg so +application/oda oda +application/oebps-package+xml opf +application/ogg ogg ogx +application/onenote onepkg onetmp onetoc onetoc2 +application/parityfec +application/patch-ops-error+xml xer +application/pdf pdf +application/pgp-encrypted pgp +application/pgp-keys key +application/pgp-signature asc pgp sig +application/pics-rules prf +application/pidf+xml +application/pidf-diff+xml +application/pkcs10 p10 +application/pkcs7-mime p7c p7m +application/pkcs7-signature p7s +application/pkix-cert cer +application/pkix-crl crl +application/pkix-pkipath pkipath +application/pkixcmp pki +application/pls+xml pls +application/poc-settings+xml +application/postscript ai eps ps +application/prs.alvestrand.titrax-sheet +application/prs.cww cww +application/prs.nprend +application/prs.plucker +application/qsig +application/rar rar +application/rdf+xml rdf +application/reginfo+xml rif +application/relax-ng-compact-syntax rnc +application/remote-printing +application/resource-lists+xml rl +application/resource-lists-diff+xml rld +application/riscos +application/rlmi+xml +application/rls-services+xml rs +application/rsd+xml rsd +application/rss+xml rss +application/rtf rtf +application/rtx +application/samlassertion+xml +application/samlmetadata+xml +application/sbml+xml sbml +application/scvp-cv-request scq +application/scvp-cv-response scs +application/scvp-vp-request spq +application/scvp-vp-response spp +application/sdp sdp +application/set-payment +application/set-payment-initiation setpay +application/set-registration +application/set-registration-initiation setreg +application/sgml +application/sgml-open-catalog +application/shf+xml shf +application/sieve +application/simple-filter+xml +application/simple-message-summary +application/simplesymbolcontainer +application/slate +application/smil smi smil +application/smil+xml smi smil +application/soap+fastinfoset +application/soap+xml +application/sparql-query rq +application/sparql-results+xml srx +application/spirits-event+xml +application/srgs gram +application/srgs+xml grxml +application/ssml+xml ssml +application/timestamp-query +application/timestamp-reply +application/tve-trigger +application/ulpfec +application/vemmi +application/vividence.scriptfile +application/vnd.3gpp.bsf+xml +application/vnd.3gpp.pic-bw-large plb +application/vnd.3gpp.pic-bw-small psb +application/vnd.3gpp.pic-bw-var pvb +application/vnd.3gpp.sms +application/vnd.3gpp2.bcmcsinfo+xml +application/vnd.3gpp2.sms +application/vnd.3gpp2.tcap tcap +application/vnd.3m.post-it-notes pwn +application/vnd.accpac.simply.aso aso +application/vnd.accpac.simply.imp imp +application/vnd.acucobol acu +application/vnd.acucorp acutc atc +application/vnd.adobe.air-application-installer-package+zip air +application/vnd.adobe.xdp+xml xdp +application/vnd.adobe.xfdf xfdf +application/vnd.aether.imp +application/vnd.airzip.filesecure.azf azf +application/vnd.airzip.filesecure.azs azs +application/vnd.amazon.ebook azw +application/vnd.americandynamics.acc acc +application/vnd.amiga.ami ami +application/vnd.android.package-archive apk +application/vnd.anser-web-certificate-issue-initiation cii +application/vnd.anser-web-funds-transfer-initiation fti +application/vnd.antix.game-component atx +application/vnd.apple.installer+xml mpkg +application/vnd.arastra.swi swi +application/vnd.audiograph aep +application/vnd.autopackage +application/vnd.avistar+xml +application/vnd.blueice.multipass mpm +application/vnd.bluetooth.ep.oob +application/vnd.bmi bmi +application/vnd.businessobjects rep +application/vnd.cab-jscript +application/vnd.canon-cpdl +application/vnd.canon-lips +application/vnd.cendio.thinlinc.clientconf +application/vnd.chemdraw+xml cdxml +application/vnd.chipnuts.karaoke-mmd mmd +application/vnd.cinderella cdy +application/vnd.cirpack.isdn-ext +application/vnd.claymore cla +application/vnd.clonk.c4group c4d c4f c4g c4p c4u +application/vnd.commerce-battelle +application/vnd.commonspace csp +application/vnd.contact.cmsg cdbcmsg +application/vnd.cosmocaller cmc +application/vnd.crick.clicker clkx +application/vnd.crick.clicker.keyboard clkk +application/vnd.crick.clicker.palette clkp +application/vnd.crick.clicker.template clkt +application/vnd.crick.clicker.wordbank clkw +application/vnd.criticaltools.wbs+xml wbs +application/vnd.ctc-posml pml +application/vnd.ctct.ws+xml +application/vnd.cups-pdf +application/vnd.cups-postscript +application/vnd.cups-ppd ppd +application/vnd.cups-raster +application/vnd.cups-raw +application/vnd.curl.car car +application/vnd.curl.pcurl pcurl +application/vnd.cybank +application/vnd.data-vision.rdz rdz +application/vnd.denovo.fcselayout-link fe_launch +application/vnd.dir-bi.plate-dl-nosuffix +application/vnd.dna dna +application/vnd.dolby.mlp mlp +application/vnd.dolby.mobile.1 +application/vnd.dolby.mobile.2 +application/vnd.dpgraph dpg +application/vnd.dreamfactory dfac +application/vnd.dvb.esgcontainer +application/vnd.dvb.ipdcdftnotifaccess +application/vnd.dvb.ipdcesgaccess +application/vnd.dvb.ipdcroaming +application/vnd.dvb.iptv.alfec-base +application/vnd.dvb.iptv.alfec-enhancement +application/vnd.dvb.notif-aggregate-root+xml +application/vnd.dvb.notif-container+xml +application/vnd.dvb.notif-generic+xml +application/vnd.dvb.notif-ia-msglist+xml +application/vnd.dvb.notif-ia-registration-request+xml +application/vnd.dvb.notif-ia-registration-response+xml +application/vnd.dvb.notif-init+xml +application/vnd.dxr +application/vnd.dynageo geo +application/vnd.ecdis-update +application/vnd.ecowin.chart mag +application/vnd.ecowin.filerequest +application/vnd.ecowin.fileupdate +application/vnd.ecowin.series +application/vnd.ecowin.seriesrequest +application/vnd.ecowin.seriesupdate +application/vnd.emclient.accessrequest+xml +application/vnd.enliven nml +application/vnd.epson.esf esf +application/vnd.epson.msf msf +application/vnd.epson.quickanime qam +application/vnd.epson.salt slt +application/vnd.epson.ssf ssf +application/vnd.ericsson.quickcall +application/vnd.eszigno3+xml es3 et3 +application/vnd.etsi.aoc+xml +application/vnd.etsi.cug+xml +application/vnd.etsi.iptvcommand+xml +application/vnd.etsi.iptvdiscovery+xml +application/vnd.etsi.iptvprofile+xml +application/vnd.etsi.iptvsad-bc+xml +application/vnd.etsi.iptvsad-cod+xml +application/vnd.etsi.iptvsad-npvr+xml +application/vnd.etsi.iptvueprofile+xml +application/vnd.etsi.mcid+xml +application/vnd.etsi.sci+xml +application/vnd.etsi.simservs+xml +application/vnd.eudora.data +application/vnd.ezpix-album ez2 +application/vnd.ezpix-package ez3 +application/vnd.f-secure.mobile +application/vnd.fdf fdf +application/vnd.fdsn.mseed mseed +application/vnd.fdsn.seed dataless seed +application/vnd.ffsns +application/vnd.fints +application/vnd.flographit gph +application/vnd.fluxtime.clip ftc +application/vnd.font-fontforge-sfd +application/vnd.framemaker book fm frame maker +application/vnd.frogans.fnc fnc +application/vnd.frogans.ltf ltf +application/vnd.fsc.weblaunch fsc +application/vnd.fujitsu.oasys oas +application/vnd.fujitsu.oasys2 oa2 +application/vnd.fujitsu.oasys3 oa3 +application/vnd.fujitsu.oasysgp fg5 +application/vnd.fujitsu.oasysprs bh2 +application/vnd.fujixerox.art-ex +application/vnd.fujixerox.art4 +application/vnd.fujixerox.ddd ddd +application/vnd.fujixerox.docuworks xdw +application/vnd.fujixerox.docuworks.binder xbd +application/vnd.fujixerox.hbpl +application/vnd.fut-misnet +application/vnd.fuzzysheet fzs +application/vnd.genomatix.tuxedo txd +application/vnd.geogebra.file ggb +application/vnd.geogebra.tool ggt +application/vnd.geometry-explorer gex gre +application/vnd.gmx gmx +application/vnd.google-earth.kml+xml kml +application/vnd.google-earth.kmz kmz +application/vnd.grafeq gqf gqs +application/vnd.gridmp +application/vnd.groove-account gac +application/vnd.groove-help ghf +application/vnd.groove-identity-message gim +application/vnd.groove-injector grv +application/vnd.groove-tool-message gtm +application/vnd.groove-tool-template tpl +application/vnd.groove-vcard vcg +application/vnd.handheld-entertainment+xml zmm +application/vnd.hbci hbci +application/vnd.hcl-bireports +application/vnd.hhe.lesson-player les +application/vnd.hp-hpgl hpgl +application/vnd.hp-hpid hpid +application/vnd.hp-hps hps +application/vnd.hp-jlyt jlt +application/vnd.hp-pcl pcl +application/vnd.hp-pclxl pclxl +application/vnd.httphone +application/vnd.hydrostatix.sof-data sfd-hdstx +application/vnd.hzn-3d-crossword x3d +application/vnd.ibm.afplinedata +application/vnd.ibm.electronic-media +application/vnd.ibm.minipay mpy +application/vnd.ibm.modcap afp list3820 listafp +application/vnd.ibm.rights-management irm +application/vnd.ibm.secure-container sc +application/vnd.iccprofile icc icm +application/vnd.igloader igl +application/vnd.immervision-ivp ivp +application/vnd.immervision-ivu ivu +application/vnd.informedcontrol.rms+xml +application/vnd.informix-visionary +application/vnd.intercon.formnet xpw xpx +application/vnd.intertrust.digibox +application/vnd.intertrust.nncp +application/vnd.intu.qbo qbo +application/vnd.intu.qfx qfx +application/vnd.iptc.g2.conceptitem+xml +application/vnd.iptc.g2.knowledgeitem+xml +application/vnd.iptc.g2.newsitem+xml +application/vnd.iptc.g2.packageitem+xml +application/vnd.ipunplugged.rcprofile rcprofile +application/vnd.irepository.package+xml irp +application/vnd.is-xpr xpr +application/vnd.jam jam +application/vnd.japannet-directory-service +application/vnd.japannet-jpnstore-wakeup +application/vnd.japannet-payment-wakeup +application/vnd.japannet-registration +application/vnd.japannet-registration-wakeup +application/vnd.japannet-setstore-wakeup +application/vnd.japannet-verification +application/vnd.japannet-verification-wakeup +application/vnd.jcp.javame.midlet-rms rms +application/vnd.jisp jisp +application/vnd.joost.joda-archive joda +application/vnd.kahootz ktr ktz +application/vnd.kde.karbon karbon +application/vnd.kde.kchart chrt +application/vnd.kde.kformula kfo +application/vnd.kde.kivio flw +application/vnd.kde.kontour kon +application/vnd.kde.kpresenter kpr kpt +application/vnd.kde.kspread ksp +application/vnd.kde.kword kwd kwt +application/vnd.kenameaapp htke +application/vnd.kidspiration kia +application/vnd.kinar kne knp +application/vnd.koan skd skm skp skt +application/vnd.kodak-descriptor sse +application/vnd.liberty-request+xml +application/vnd.llamagraphics.life-balance.desktop lbd +application/vnd.llamagraphics.life-balance.exchange+xml lbe +application/vnd.lotus-1-2-3 123 +application/vnd.lotus-approach apr +application/vnd.lotus-freelance pre +application/vnd.lotus-notes nsf +application/vnd.lotus-organizer org +application/vnd.lotus-screencam scm +application/vnd.lotus-wordpro lwp +application/vnd.macports.portpkg portpkg +application/vnd.marlin.drm.actiontoken+xml +application/vnd.marlin.drm.conftoken+xml +application/vnd.marlin.drm.license+xml +application/vnd.marlin.drm.mdcf +application/vnd.mcd mcd +application/vnd.medcalcdata mc1 +application/vnd.mediastation.cdkey cdkey +application/vnd.meridian-slingshot +application/vnd.mfer mwf +application/vnd.mfmp mfm +application/vnd.micrografx.flo flo +application/vnd.micrografx.igx igx +application/vnd.mif mif +application/vnd.minisoft-hp3000-save +application/vnd.mitsubishi.misty-guard.trustweb +application/vnd.mobius.daf daf +application/vnd.mobius.dis dis +application/vnd.mobius.mbk mbk +application/vnd.mobius.mqy mqy +application/vnd.mobius.msl msl +application/vnd.mobius.plc plc +application/vnd.mobius.txf txf +application/vnd.mophun.application mpn +application/vnd.mophun.certificate mpc +application/vnd.motorola.flexsuite +application/vnd.motorola.flexsuite.adsi +application/vnd.motorola.flexsuite.fis +application/vnd.motorola.flexsuite.gotap +application/vnd.motorola.flexsuite.kmr +application/vnd.motorola.flexsuite.ttc +application/vnd.motorola.flexsuite.wem +application/vnd.motorola.iprm +application/vnd.mozilla.xul+xml xul +application/vnd.ms-artgalry cil +application/vnd.ms-asf +application/vnd.ms-cab-compressed cab +application/vnd.ms-excel xla xlb xlc xlm xls xlt xlw +application/vnd.ms-excel.addin.macroenabled.12 xlam +application/vnd.ms-excel.sheet.binary.macroenabled.12 xlsb +application/vnd.ms-excel.sheet.macroenabled.12 xlsm +application/vnd.ms-excel.template.macroenabled.12 xltm +application/vnd.ms-fontobject eot +application/vnd.ms-htmlhelp chm +application/vnd.ms-ims ims +application/vnd.ms-lrm lrm +application/vnd.ms-pki.seccat cat +application/vnd.ms-pki.stl stl +application/vnd.ms-playready.initiator+xml +application/vnd.ms-powerpoint pot pps ppt +application/vnd.ms-powerpoint.addin.macroenabled.12 ppam +application/vnd.ms-powerpoint.presentation.macroenabled.12 pptm +application/vnd.ms-powerpoint.slide.macroenabled.12 sldm +application/vnd.ms-powerpoint.slideshow.macroenabled.12 ppsm +application/vnd.ms-powerpoint.template.macroenabled.12 potm +application/vnd.ms-project mpp mpt +application/vnd.ms-tnef +application/vnd.ms-wmdrm.lic-chlg-req +application/vnd.ms-wmdrm.lic-resp +application/vnd.ms-wmdrm.meter-chlg-req +application/vnd.ms-wmdrm.meter-resp +application/vnd.ms-word.document.macroenabled.12 docm +application/vnd.ms-word.template.macroenabled.12 dotm +application/vnd.ms-works wcm wdb wks wps +application/vnd.ms-wpl wpl +application/vnd.ms-xpsdocument xps +application/vnd.mseq mseq +application/vnd.msign +application/vnd.multiad.creator +application/vnd.multiad.creator.cif +application/vnd.music-niff +application/vnd.musician mus +application/vnd.muvee.style msty +application/vnd.ncd.control +application/vnd.ncd.reference +application/vnd.nervana +application/vnd.netfpx +application/vnd.neurolanguage.nlu nlu +application/vnd.noblenet-directory nnd +application/vnd.noblenet-sealer nns +application/vnd.noblenet-web nnw +application/vnd.nokia.catalogs +application/vnd.nokia.conml+wbxml +application/vnd.nokia.conml+xml +application/vnd.nokia.iptv.config+xml +application/vnd.nokia.isds-radio-presets +application/vnd.nokia.landmark+wbxml +application/vnd.nokia.landmark+xml +application/vnd.nokia.landmarkcollection+xml +application/vnd.nokia.n-gage.ac+xml +application/vnd.nokia.n-gage.data ngdat +application/vnd.nokia.n-gage.symbian.install n-gage +application/vnd.nokia.ncd +application/vnd.nokia.pcd+wbxml +application/vnd.nokia.pcd+xml +application/vnd.nokia.radio-preset rpst +application/vnd.nokia.radio-presets rpss +application/vnd.novadigm.edm edm +application/vnd.novadigm.edx edx +application/vnd.novadigm.ext ext +application/vnd.oasis.opendocument.chart odc +application/vnd.oasis.opendocument.chart-template otc +application/vnd.oasis.opendocument.database odb +application/vnd.oasis.opendocument.formula odf +application/vnd.oasis.opendocument.formula-template odft +application/vnd.oasis.opendocument.graphics odg +application/vnd.oasis.opendocument.graphics-template otg +application/vnd.oasis.opendocument.image odi +application/vnd.oasis.opendocument.image-template oti +application/vnd.oasis.opendocument.presentation odp +application/vnd.oasis.opendocument.presentation-template otp +application/vnd.oasis.opendocument.spreadsheet ods +application/vnd.oasis.opendocument.spreadsheet-template ots +application/vnd.oasis.opendocument.text odt +application/vnd.oasis.opendocument.text-master odm otm +application/vnd.oasis.opendocument.text-template ott +application/vnd.oasis.opendocument.text-web oth +application/vnd.obn +application/vnd.olpc-sugar xo +application/vnd.oma-scws-config +application/vnd.oma-scws-http-request +application/vnd.oma-scws-http-response +application/vnd.oma.bcast.associated-procedure-parameter+xml +application/vnd.oma.bcast.drm-trigger+xml +application/vnd.oma.bcast.imd+xml +application/vnd.oma.bcast.ltkm +application/vnd.oma.bcast.notification+xml +application/vnd.oma.bcast.provisioningtrigger +application/vnd.oma.bcast.sgboot +application/vnd.oma.bcast.sgdd+xml +application/vnd.oma.bcast.sgdu +application/vnd.oma.bcast.simple-symbol-container +application/vnd.oma.bcast.smartcard-trigger+xml +application/vnd.oma.bcast.sprov+xml +application/vnd.oma.bcast.stkm +application/vnd.oma.dcd +application/vnd.oma.dcdc +application/vnd.oma.dd2+xml dd2 +application/vnd.oma.drm.risd+xml +application/vnd.oma.group-usage-list+xml +application/vnd.oma.poc.detailed-progress-report+xml +application/vnd.oma.poc.final-report+xml +application/vnd.oma.poc.groups+xml +application/vnd.oma.poc.invocation-descriptor+xml +application/vnd.oma.poc.optimized-progress-report+xml +application/vnd.oma.xcap-directory+xml +application/vnd.omads-email+xml +application/vnd.omads-file+xml +application/vnd.omads-folder+xml +application/vnd.omaloc-supl-init +application/vnd.openofficeorg.extension oxt +application/vnd.openxmlformats-officedocument.presentationml.presentation pptx +application/vnd.openxmlformats-officedocument.presentationml.slide sldx +application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx +application/vnd.openxmlformats-officedocument.presentationml.template potx +application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx +application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx +application/vnd.openxmlformats-officedocument.wordprocessingml.document docx +application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx +application/vnd.osa.netdeploy +application/vnd.osgi.bundle +application/vnd.osgi.dp dp +application/vnd.otps.ct-kip+xml +application/vnd.palm oprc pdb pqa +application/vnd.paos.xml +application/vnd.pg.format str +application/vnd.pg.osasli ei6 +application/vnd.piaccess.application-licence +application/vnd.picsel efif +application/vnd.poc.group-advertisement+xml +application/vnd.pocketlearn plf +application/vnd.powerbuilder6 pbd +application/vnd.powerbuilder6-s +application/vnd.powerbuilder7 +application/vnd.powerbuilder7-s +application/vnd.powerbuilder75 +application/vnd.powerbuilder75-s +application/vnd.preminet +application/vnd.previewsystems.box box +application/vnd.proteus.magazine mgz +application/vnd.publishare-delta-tree qps +application/vnd.pvi.ptid1 ptid +application/vnd.pwg-multiplexed +application/vnd.pwg-xhtml-print+xml +application/vnd.qualcomm.brew-app-res +application/vnd.quark.quarkxpress qwd qwt qxb qxd qxl qxt +application/vnd.rapid +application/vnd.recordare.musicxml mxl +application/vnd.recordare.musicxml+xml musicxml +application/vnd.renlearn.rlprint +application/vnd.rim.cod cod +application/vnd.rn-realmedia rm +application/vnd.route66.link66+xml link66 +application/vnd.ruckus.download +application/vnd.s3sms +application/vnd.sbm.cid +application/vnd.sbm.mid2 +application/vnd.scribus +application/vnd.sealed.3df +application/vnd.sealed.csf +application/vnd.sealed.doc +application/vnd.sealed.eml +application/vnd.sealed.mht +application/vnd.sealed.net +application/vnd.sealed.ppt +application/vnd.sealed.tiff +application/vnd.sealed.xls +application/vnd.sealedmedia.softseal.html +application/vnd.sealedmedia.softseal.pdf +application/vnd.seemail see +application/vnd.sema sema +application/vnd.semd semd +application/vnd.semf semf +application/vnd.shana.informed.formdata ifm +application/vnd.shana.informed.formtemplate itp +application/vnd.shana.informed.interchange iif +application/vnd.shana.informed.package ipk +application/vnd.simtech-mindmapper twd twds +application/vnd.smaf mmf +application/vnd.smart.teacher teacher +application/vnd.software602.filler.form+xml +application/vnd.software602.filler.form-xml-zip +application/vnd.solent.sdkm+xml sdkd sdkm +application/vnd.spotfire.dxp dxp +application/vnd.spotfire.sfs sfs +application/vnd.sss-cod +application/vnd.sss-dtf +application/vnd.sss-ntf +application/vnd.stardivision.calc sdc +application/vnd.stardivision.draw sda +application/vnd.stardivision.impress sdd sdp +application/vnd.stardivision.math sdf smf +application/vnd.stardivision.writer sdw vor +application/vnd.stardivision.writer-global sgl +application/vnd.street-stream +application/vnd.sun.wadl+xml +application/vnd.sun.xml.calc sxc +application/vnd.sun.xml.calc.template stc +application/vnd.sun.xml.draw sxd +application/vnd.sun.xml.draw.template std +application/vnd.sun.xml.impress sxi +application/vnd.sun.xml.impress.template sti +application/vnd.sun.xml.math sxm +application/vnd.sun.xml.writer sxw +application/vnd.sun.xml.writer.global sxg +application/vnd.sun.xml.writer.template stw +application/vnd.sus-calendar sus susp +application/vnd.svd svd +application/vnd.swiftview-ics +application/vnd.symbian.install sis sisx +application/vnd.syncml+xml xsm +application/vnd.syncml.dm+wbxml bdm +application/vnd.syncml.dm+xml xdm +application/vnd.syncml.dm.notification +application/vnd.syncml.ds.notification +application/vnd.tao.intent-module-archive tao +application/vnd.tmobile-livetv tmo +application/vnd.trid.tpt tpt +application/vnd.triscape.mxs mxs +application/vnd.trueapp tra +application/vnd.truedoc +application/vnd.ufdl ufd ufdl +application/vnd.uiq.theme utz +application/vnd.umajin umj +application/vnd.unity unityweb +application/vnd.uoml+xml uoml +application/vnd.uplanet.alert +application/vnd.uplanet.alert-wbxml +application/vnd.uplanet.bearer-choice +application/vnd.uplanet.bearer-choice-wbxml +application/vnd.uplanet.cacheop +application/vnd.uplanet.cacheop-wbxml +application/vnd.uplanet.channel +application/vnd.uplanet.channel-wbxml +application/vnd.uplanet.list +application/vnd.uplanet.list-wbxml +application/vnd.uplanet.listcmd +application/vnd.uplanet.listcmd-wbxml +application/vnd.uplanet.signal +application/vnd.vcx vcx +application/vnd.vd-study +application/vnd.vectorworks +application/vnd.vidsoft.vidconference +application/vnd.visio vsd vss vst vsw +application/vnd.visionary vis +application/vnd.vividence.scriptfile +application/vnd.vsf vsf +application/vnd.wap.sic +application/vnd.wap.slc +application/vnd.wap.wbxml wbxml +application/vnd.wap.wmlc wmlc +application/vnd.wap.wmlscriptc wmlsc +application/vnd.webturbo wtb +application/vnd.wfa.wsc +application/vnd.wmc +application/vnd.wmf.bootstrap +application/vnd.wordperfect wpd +application/vnd.wqd wqd +application/vnd.wrq-hp3000-labelled +application/vnd.wt.stf stf +application/vnd.wv.csp+wbxml +application/vnd.wv.csp+xml +application/vnd.wv.ssp+xml +application/vnd.xara xar +application/vnd.xfdl xfdl +application/vnd.xfdl.webform +application/vnd.xmi+xml +application/vnd.xmpie.cpkg +application/vnd.xmpie.dpkg +application/vnd.xmpie.plan +application/vnd.xmpie.ppkg +application/vnd.xmpie.xlim +application/vnd.yamaha.hv-dic hvd +application/vnd.yamaha.hv-script hvs +application/vnd.yamaha.hv-voice hvp +application/vnd.yamaha.openscoreformat osf +application/vnd.yamaha.openscoreformat.osfpvg+xml osfpvg +application/vnd.yamaha.smaf-audio saf +application/vnd.yamaha.smaf-phrase spf +application/vnd.yellowriver-custom-menu cmp +application/vnd.zul zir zirz +application/vnd.zzazz.deck+xml zaz +application/voicexml+xml vxml +application/watcherinfo+xml +application/whoispp-query +application/whoispp-response +application/winhlp hlp +application/wita +application/wordperfect wpd +application/wordperfect5.1 wp5 +application/wsdl+xml wsdl +application/wspolicy+xml wspolicy +application/x-123 wk +application/x-abiword abw +application/x-ace-compressed ace +application/x-apple-diskimage dmg +application/x-authorware-bin aab u32 vox x32 +application/x-authorware-map aam +application/x-authorware-seg aas +application/x-bcpio bcpio +application/x-bittorrent torrent +application/x-bzip bz +application/x-bzip2 boz bz2 +application/x-cdf cdf +application/x-cdlink vcd +application/x-chat chat +application/x-chess-pgn pgn +application/x-compress +application/x-cpio cpio +application/x-csh csh +application/x-debian-package deb udeb +application/x-director cct cst cxt dcr dir dxr fgd swa w3d +application/x-dms dms +application/x-doom wad +application/x-dtbncx+xml ncx +application/x-dtbook+xml dtb +application/x-dtbresource+xml res +application/x-dvi dvi +application/x-flac flac +application/x-font gsf pcf pcf.Z pfa pfb +application/x-font-bdf bdf +application/x-font-dos +application/x-font-framemaker +application/x-font-ghostscript gsf +application/x-font-libgrx +application/x-font-linux-psf psf +application/x-font-otf otf +application/x-font-pcf pcf +application/x-font-snf snf +application/x-font-speedo +application/x-font-sunos-news +application/x-font-ttf ttc ttf +application/x-font-type1 afm pfa pfb pfm +application/x-font-vfont +application/x-freemind mm +application/x-futuresplash spl +application/x-gnumeric gnumeric +application/x-go-sgf sgf +application/x-graphing-calculator gcf +application/x-gtar gtar taz tgz +application/x-gzip +application/x-hdf hdf +application/x-ica ica +application/x-internet-signup ins isp +application/x-iphone iii +application/x-iso9660-image iso +application/x-java-jnlp-file jnlp +application/x-javascript js +application/x-jmol jmz +application/x-kchart chrt +application/x-killustrator kil +application/x-koan skd skm skp skt +application/x-kpresenter kpr kpt +application/x-kspread ksp +application/x-kword kwd kwt +application/x-latex latex +application/x-lha lha +application/x-lzh lzh +application/x-lzx lzx +application/x-maker book fb fbdoc fm frame frm maker +application/x-mif mif +application/x-mobipocket-ebook mobi prc +application/x-ms-application application +application/x-ms-wmd wmd +application/x-ms-wmz wmz +application/x-ms-xbap xbap +application/x-msaccess mdb +application/x-msbinder obd +application/x-mscardfile crd +application/x-msclip clp +application/x-msdos-program bat com dll exe +application/x-msdownload bat com dll exe msi +application/x-msi msi +application/x-msmediaview m13 m14 mvb +application/x-msmetafile wmf +application/x-msmoney mny +application/x-mspublisher pub +application/x-msschedule scd +application/x-msterminal trm +application/x-mswrite wri +application/x-netcdf cdf nc +application/x-ns-proxy-autoconfig pac +application/x-nwc nwc +application/x-object o +application/x-oz-application oza +application/x-pkcs12 p12 pfx +application/x-pkcs7-certificates p7b spc +application/x-pkcs7-certreqresp p7r +application/x-pkcs7-crl crl +application/x-python-code pyc pyo +application/x-quicktimeplayer qtl +application/x-rar-compressed rar +application/x-redhat-package-manager rpm +application/x-sh sh +application/x-shar shar +application/x-shockwave-flash swf swfl +application/x-silverlight-app xap +application/x-stuffit sit sitx +application/x-stuffitx sitx +application/x-sv4cpio sv4cpio +application/x-sv4crc sv4crc +application/x-tar tar +application/x-tcl tcl +application/x-tex tex +application/x-tex-gf gf +application/x-tex-pk pk +application/x-tex-tfm tfm +application/x-texinfo texi texinfo +application/x-trash % bak old sik ~ +application/x-troff roff t tr +application/x-troff-man man +application/x-troff-me me +application/x-troff-ms ms +application/x-ustar ustar +application/x-wais-source src +application/x-wingz wz +application/x-x509-ca-cert crt der +application/x-xcf xcf +application/x-xfig fig +application/x-xpinstall xpi +application/x400-bp +application/xcap-att+xml +application/xcap-caps+xml +application/xcap-el+xml +application/xcap-error+xml +application/xcap-ns+xml +application/xcon-conference-info+xml +application/xcon-conference-info-diff+xml +application/xenc+xml xenc +application/xhtml+xml xht xhtml +application/xhtml-voice+xml +application/xml xml xsl +application/xml-dtd dtd +application/xml-external-parsed-entity +application/xmpp+xml +application/xop+xml xop +application/xslt+xml xslt +application/xspf+xml xspf +application/xv+xml mxml xhvml xvm xvml +application/zip zip +audio/32kadpcm +audio/3gpp +audio/3gpp2 +audio/ac3 +audio/adpcm adp +audio/amr +audio/amr-wb +audio/amr-wb+ +audio/asc +audio/basic au snd +audio/bv16 +audio/bv32 +audio/clearmode +audio/cn +audio/dat12 +audio/dls +audio/dsr-es201108 +audio/dsr-es202050 +audio/dsr-es202211 +audio/dsr-es202212 +audio/dvi4 +audio/eac3 +audio/evrc +audio/evrc-qcp +audio/evrc0 +audio/evrc1 +audio/evrcb +audio/evrcb0 +audio/evrcb1 +audio/evrcwb +audio/evrcwb0 +audio/evrcwb1 +audio/example +audio/g719 +audio/g722 +audio/g7221 +audio/g723 +audio/g726-16 +audio/g726-24 +audio/g726-32 +audio/g726-40 +audio/g728 +audio/g729 +audio/g7291 +audio/g729d +audio/g729e +audio/gsm +audio/gsm-efr +audio/ilbc +audio/l16 +audio/l20 +audio/l24 +audio/l8 +audio/lpc +audio/midi kar mid midi rmi +audio/mobile-xmf +audio/mp4 mp4a +audio/mp4a-latm +audio/mpa +audio/mpa-robust +audio/mpeg m2a m3a m4a mp2 mp2a mp3 mpega mpga +audio/mpeg4-generic +audio/mpegurl m3u +audio/ogg oga ogg spx +audio/parityfec +audio/pcma +audio/pcma-wb +audio/pcmu +audio/pcmu-wb +audio/prs.sid sid +audio/qcelp +audio/red +audio/rtp-enc-aescm128 +audio/rtp-midi +audio/rtx +audio/smv +audio/smv-qcp +audio/smv0 +audio/sp-midi +audio/t140c +audio/t38 +audio/telephone-event +audio/tone +audio/ulpfec +audio/vdvi +audio/vmr-wb +audio/vnd.3gpp.iufp +audio/vnd.4sb +audio/vnd.audiokoz +audio/vnd.celp +audio/vnd.cisco.nse +audio/vnd.cmles.radio-events +audio/vnd.cns.anp1 +audio/vnd.cns.inf1 +audio/vnd.digital-winds eol +audio/vnd.dlna.adts +audio/vnd.dolby.heaac.1 +audio/vnd.dolby.heaac.2 +audio/vnd.dolby.mlp +audio/vnd.dolby.mps +audio/vnd.dolby.pl2 +audio/vnd.dolby.pl2x +audio/vnd.dolby.pl2z +audio/vnd.dts dts +audio/vnd.dts.hd dtshd +audio/vnd.everad.plj +audio/vnd.hns.audio +audio/vnd.lucent.voice lvp +audio/vnd.ms-playready.media.pya pya +audio/vnd.nokia.mobile-xmf +audio/vnd.nortel.vbk +audio/vnd.nuera.ecelp4800 ecelp4800 +audio/vnd.nuera.ecelp7470 ecelp7470 +audio/vnd.nuera.ecelp9600 ecelp9600 +audio/vnd.octel.sbc +audio/vnd.qcelp +audio/vnd.rhetorex.32kadpcm +audio/vnd.sealedmedia.softseal.mpeg +audio/vnd.vmx.cvsd +audio/vorbis +audio/vorbis-config +audio/x-aac aac +audio/x-aiff aif aifc aiff +audio/x-gsm gsm +audio/x-mpegurl m3u +audio/x-ms-wax wax +audio/x-ms-wma wma +audio/x-pn-realaudio ra ram rm +audio/x-pn-realaudio-plugin rmp +audio/x-realaudio ra +audio/x-scpls pls +audio/x-sd2 sd2 +audio/x-wav wav +chemical/x-alchemy alc +chemical/x-cache cac cache +chemical/x-cache-csf csf +chemical/x-cactvs-binary cascii cbin ctab +chemical/x-cdx cdx +chemical/x-cerius cer +chemical/x-chem3d c3d +chemical/x-chemdraw chm +chemical/x-cif cif +chemical/x-cmdf cmdf +chemical/x-cml cml +chemical/x-compass cpa +chemical/x-crossfire bsd +chemical/x-csml csm csml +chemical/x-ctx ctx +chemical/x-cxf cef cxf +chemical/x-embl-dl-nucleotide emb embl +chemical/x-galactic-spc spc +chemical/x-gamess-input gam gamin inp +chemical/x-gaussian-checkpoint fch fchk +chemical/x-gaussian-cube cub +chemical/x-gaussian-input gau gjc gjf +chemical/x-gaussian-log gal +chemical/x-gcg8-sequence gcg +chemical/x-genbank gen +chemical/x-hin hin +chemical/x-isostar ist istr +chemical/x-jcamp-dx dx jdx +chemical/x-kinemage kin +chemical/x-macmolecule mcm +chemical/x-macromodel-input mmd mmod +chemical/x-mdl-molfile mol +chemical/x-mdl-rdfile rd +chemical/x-mdl-rxnfile rxn +chemical/x-mdl-sdfile sd sdf +chemical/x-mdl-tgf tgf +chemical/x-mmcif mcif +chemical/x-mol2 mol2 +chemical/x-molconn-Z b +chemical/x-mopac-graph gpt +chemical/x-mopac-input dat mop mopcrt mpc zmt +chemical/x-mopac-out moo +chemical/x-mopac-vib mvb +chemical/x-ncbi-asn1 asn +chemical/x-ncbi-asn1-ascii ent prt +chemical/x-ncbi-asn1-binary aso val +chemical/x-ncbi-asn1-spec asn +chemical/x-pdb ent pdb +chemical/x-rosdal ros +chemical/x-swissprot sw +chemical/x-vamas-iso14976 vms +chemical/x-vmd vmd +chemical/x-xtel xtel +chemical/x-xyz xyz +image/bmp bmp +image/cgm cgm +image/example +image/fits +image/g3fax g3 +image/gif gif +image/ief ief +image/jp2 +image/jpeg jpe jpeg jpg +image/jpm +image/jpx +image/naplps +image/pcx pcx +image/png png +image/prs.btif btif +image/prs.pti +image/svg+xml svg svgz +image/t38 +image/tiff tif tiff +image/tiff-fx +image/vnd.adobe.photoshop psd +image/vnd.cns.inf2 +image/vnd.djvu djv djvu +image/vnd.dwg dwg +image/vnd.dxf dxf +image/vnd.fastbidsheet fbs +image/vnd.fpx fpx +image/vnd.fst fst +image/vnd.fujixerox.edmics-mmr mmr +image/vnd.fujixerox.edmics-rlc rlc +image/vnd.globalgraphics.pgb +image/vnd.microsoft.icon +image/vnd.mix +image/vnd.ms-modi mdi +image/vnd.net-fpx npx +image/vnd.radiance +image/vnd.sealed.png +image/vnd.sealedmedia.softseal.gif +image/vnd.sealedmedia.softseal.jpg +image/vnd.svf +image/vnd.wap.wbmp wbmp +image/vnd.xiff xif +image/x-cmu-raster ras +image/x-cmx cmx +image/x-coreldraw cdr +image/x-coreldrawpattern pat +image/x-coreldrawtemplate cdt +image/x-corelphotopaint cpt +image/x-freehand fh fh4 fh5 fh7 fhc +image/x-icon ico +image/x-jg art +image/x-jng jng +image/x-ms-bmp bmp +image/x-pcx pcx +image/x-photoshop psd +image/x-pict pct pic +image/x-portable-anymap pnm +image/x-portable-bitmap pbm +image/x-portable-graymap pgm +image/x-portable-pixmap ppm +image/x-rgb rgb +image/x-xbitmap xbm +image/x-xpixmap xpm +image/x-xwindowdump xwd +message/cpim +message/delivery-status +message/disposition-notification +message/example +message/external-body +message/global +message/global-delivery-status +message/global-disposition-notification +message/global-headers +message/http +message/imdn+xml +message/news +message/partial +message/rfc822 eml mime +message/s-http +message/sip +message/sipfrag +message/tracking-status +message/vnd.si.simp +model/example +model/iges iges igs +model/mesh mesh msh silo +model/vnd.dwf dwf +model/vnd.flatland.3dml +model/vnd.gdl gdl +model/vnd.gs-gdl +model/vnd.gs.gdl +model/vnd.gtw gtw +model/vnd.moml+xml +model/vnd.mts mts +model/vnd.parasolid.transmit.binary +model/vnd.parasolid.transmit.text +model/vnd.vtu vtu +model/vrml vrml wrl +multipart/alternative +multipart/appledouble +multipart/byteranges +multipart/digest +multipart/encrypted +multipart/example +multipart/form-data +multipart/header-set +multipart/mixed +multipart/parallel +multipart/related +multipart/report +multipart/signed +multipart/voice-message +text/calendar ics icz ifb +text/comma-separated-values csv +text/css css +text/csv csv +text/directory +text/dns +text/ecmascript +text/enriched +text/example +text/h323 323 +text/html htm html shtml +text/iuls uls +text/javascript +text/mathml mml +text/parityfec +text/plain asc conf def diff in list log pot text txt +text/prs.fallenstein.rst +text/prs.lines.tag dsc +text/red +text/rfc822-headers +text/richtext rtx +text/rtf rtf +text/rtp-enc-aescm128 +text/rtx +text/scriptlet sct wsc +text/sgml sgm sgml +text/t140 +text/tab-separated-values tsv +text/texmacs tm ts +text/troff man me ms roff t tr +text/ulpfec +text/uri-list uri uris urls +text/vnd.abc +text/vnd.curl curl +text/vnd.curl.dcurl dcurl +text/vnd.curl.mcurl mcurl +text/vnd.curl.scurl scurl +text/vnd.dmclientscript +text/vnd.esmertec.theme-descriptor +text/vnd.fly fly +text/vnd.fmi.flexstor flx +text/vnd.graphviz gv +text/vnd.in3d.3dml 3dml +text/vnd.in3d.spot spot +text/vnd.iptc.newsml +text/vnd.iptc.nitf +text/vnd.latex-z +text/vnd.motorola.reflex +text/vnd.ms-mediapackage +text/vnd.net2phone.commcenter.command +text/vnd.si.uricatalogue +text/vnd.sun.j2me.app-descriptor jad +text/vnd.trolltech.linguist +text/vnd.wap.si +text/vnd.wap.sl +text/vnd.wap.wml wml +text/vnd.wap.wmlscript wmls +text/x-asm asm s +text/x-bibtex bib +text/x-c c cc cpp cxx dic h hh +text/x-c++hdr h++ hh hpp hxx +text/x-c++src c++ cc cpp cxx +text/x-chdr h +text/x-csh csh +text/x-csrc c +text/x-fortran f f77 f90 for +text/x-haskell hs +text/x-java java +text/x-java-source java +text/x-literate-haskell lhs +text/x-moc moc +text/x-pascal p pas +text/x-pcs-gcd gcd +text/x-perl pl pm +text/x-psp psp +text/x-python py +text/x-setext etx +text/x-sh sh +text/x-tcl tcl tk +text/x-tex cls ltx sty tex +text/x-uuencode uu +text/x-vcalendar vcs +text/x-vcard vcf +text/xml +text/xml-external-parsed-entity +video/3gpp 3gp +video/3gpp-tt +video/3gpp2 3g2 +video/bmpeg +video/bt656 +video/celb +video/dl dl +video/dv dif dv +video/example +video/fli fli +video/gl gl +video/h261 h261 +video/h263 h263 +video/h263-1998 +video/h263-2000 +video/h264 h264 +video/jpeg jpgv +video/jpeg2000 +video/jpm jpgm jpm +video/mj2 mj2 mjp2 +video/mp1s +video/mp2p +video/mp2t +video/mp4 mp4 mp4v mpg4 +video/mp4v-es +video/mpeg m1v m2v mpe mpeg mpg +video/mpeg4-generic +video/mpv +video/nv +video/ogg ogv +video/parityfec +video/pointer +video/quicktime mov qt +video/raw +video/rtp-enc-aescm128 +video/rtx +video/smpte292m +video/ulpfec +video/vc1 +video/vnd.cctv +video/vnd.dlna.mpeg-tts +video/vnd.fvt fvt +video/vnd.hns.video +video/vnd.iptvforum.1dparityfec-1010 +video/vnd.iptvforum.1dparityfec-2005 +video/vnd.iptvforum.2dparityfec-1010 +video/vnd.iptvforum.2dparityfec-2005 +video/vnd.iptvforum.ttsavc +video/vnd.iptvforum.ttsmpeg2 +video/vnd.motorola.video +video/vnd.motorola.videop +video/vnd.mpegurl m4u mxu +video/vnd.ms-playready.media.pyv pyv +video/vnd.nokia.interleaved-multimedia +video/vnd.nokia.videovoip +video/vnd.objectvideo +video/vnd.sealed.mpeg1 +video/vnd.sealed.mpeg4 +video/vnd.sealed.swf +video/vnd.sealedmedia.softseal.mov +video/vnd.vivo viv +video/x-f4v f4v +video/x-fli fli +video/x-flv flv +video/x-la-asf lsf lsx +video/x-m4v m4v +video/x-mng mng +video/x-ms-asf asf asx +video/x-ms-wm wm +video/x-ms-wmv wmv +video/x-ms-wmx wmx +video/x-ms-wvx wvx +video/x-msvideo avi +video/x-sgi-movie movie +x-conference/x-cooltalk ice +x-world/x-vrml vrm vrml wrl + + + +## calibre specific mime types + +text/fb2+xml fb2 +text/x-sony-bbeb+xml lrs +application/x-sony-bbeb lrf lrx +application/adobe-page-template+xml xpgt +application/x-font-opentype otf +application/x-font-truetype ttf +application/x-mobipocket-ebook mobi prc azw +application/x-cbz cbz +application/x-cbr cbr +application/x-cb7 cb7 +application/x-koboreader-ebook kobo +image/wmf wmf diff --git a/resources/recipes/la_rioja.recipe b/resources/recipes/la_rioja.recipe new file mode 100644 index 0000000000..eea3dd2687 --- /dev/null +++ b/resources/recipes/la_rioja.recipe @@ -0,0 +1,54 @@ +__license__ = 'GPL v3' +__copyright__ = '2010, Darko Miletic ' +''' +www.larioja.com +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class LaRioja(BasicNewsRecipe): + title = 'La Rioja' + __author__ = 'Arturo Martinez Nieves' + description = 'Noticias de La Rioja y el resto del mundo' + publisher = 'La Rioja' + category = 'news, politics, Spain' + oldest_article = 2 + max_articles_per_feed = 200 + no_stylesheets = True + encoding = 'cp1252' + use_embedded_content = False + language = 'es' + remove_empty_feeds = True + masthead_url = 'http://www.larioja.com/includes/manuales/larioja/include-lariojapapeldigital-zonac-fondocabecera01.jpg' + extra_css = ' body{font-family: Arial,Helvetica,sans-serif } img{margin-bottom: 0.4em} .photo-caption{font-size: x-small} ' + + conversion_options = { + 'comment' : description + , 'tags' : category + , 'publisher' : publisher + , 'language' : language + } + + keep_only_tags = [ + dict(attrs={'id':'title'}) + ,dict(attrs={'class':['overhead','headline','subhead','date','text','noticia_cont','desarrollo']}) + ] + remove_tags = [dict(name='ul')] + remove_attributes = ['width','height'] + + + feeds = [ + (u'Ultimas Noticias' , u'http://www.larioja.com/rss/feeds/ultima.xml' ) + ,(u'Portada' , u'http://www.larioja.com/rss/feeds/portada.xml' ) + ,(u'Mundo' , u'http://www.larioja.com/rss/feeds/mundo.xml' ) + ,(u'Espana' , u'http://www.larioja.com/rss/feeds/espana.xml' ) + ,(u'Region' , u'http://www.larioja.com/rss/feeds/region.xml' ) + ,(u'Comarcas' , u'http://www.larioja.com/rss/feeds/comarcas.xml') + ,(u'Deportes' , u'http://www.larioja.com/rss/feeds/deportes.xml' ) + ,(u'Economia' , u'http://www.larioja.com/rss/feeds/economia.xml' ) + ,(u'Cultura' , u'http://www.larioja.com/rss/feeds/cultura.xml' ) + ,(u'Opinion' , u'http://www.larioja.com/rss/feeds/opinion.xml' ) + ,(u'Sociedad' , u'http://www.larioja.com/rss/feeds/sociedad.xml' ) + + ] + diff --git a/resources/recipes/nacionred.recipe b/resources/recipes/nacionred.recipe new file mode 100644 index 0000000000..4108deab88 --- /dev/null +++ b/resources/recipes/nacionred.recipe @@ -0,0 +1,11 @@ +from calibre.web.feeds.news import BasicNewsRecipe + +class AdvancedUserRecipe1291022049(BasicNewsRecipe): + title = u'NacionRed.com' + oldest_article = 7 + max_articles_per_feed = 100 + language = 'es' + __author__ = 'Arturo Martinez Nieves' + + feeds = [(u'NacionRed.com', u'http://feeds.weblogssl.com/nacionred?format=xml')] + diff --git a/setup/commands.py b/setup/commands.py index 06ab7b36f7..12fb5fe0af 100644 --- a/setup/commands.py +++ b/setup/commands.py @@ -18,7 +18,7 @@ __all__ = [ 'pypi_register', 'pypi_upload', 'upload_to_server', 'upload_user_manual', 'upload_to_mobileread', 'upload_demo', 'upload_to_sourceforge', 'upload_to_google_code', - 'linux32', 'linux64', 'linux', 'linux_freeze', 'linux_freeze2', + 'linux32', 'linux64', 'linux', 'linux_freeze', 'osx32_freeze', 'osx', 'rsync', 'push', 'win32_freeze', 'win32', 'win', 'stage1', 'stage2', 'stage3', 'stage4', 'publish' @@ -79,10 +79,8 @@ from setup.installer.linux import Linux, Linux32, Linux64 linux = Linux() linux32 = Linux32() linux64 = Linux64() -from setup.installer.linux.freeze import LinuxFreeze +from setup.installer.linux.freeze2 import LinuxFreeze linux_freeze = LinuxFreeze() -from setup.installer.linux.freeze2 import LinuxFreeze2 -linux_freeze2 = LinuxFreeze2() from setup.installer.osx import OSX osx = OSX() diff --git a/setup/installer/linux/__init__.py b/setup/installer/linux/__init__.py index 68f29362ee..3d759cff9a 100644 --- a/setup/installer/linux/__init__.py +++ b/setup/installer/linux/__init__.py @@ -17,7 +17,7 @@ class Linux32(VMInstaller): INSTALLER_EXT = 'tar.bz2' VM_NAME = 'gentoo32_build' VM = '/vmware/bin/gentoo32_build' - FREEZE_COMMAND = 'linux_freeze2' + FREEZE_COMMAND = 'linux_freeze' FREEZE_TEMPLATE = 'sudo python -OO setup.py {freeze_command}' diff --git a/setup/installer/linux/freeze2.py b/setup/installer/linux/freeze2.py index b30762f4b6..684b33b80d 100644 --- a/setup/installer/linux/freeze2.py +++ b/setup/installer/linux/freeze2.py @@ -16,21 +16,9 @@ SITE_PACKAGES = ['IPython', 'PIL', 'dateutil', 'dns', 'PyQt4', 'mechanize', 'sip.so', 'BeautifulSoup.py', 'cssutils', 'encutils', 'lxml', 'sipconfig.py', 'xdg'] - - -gcc = subprocess.Popen(["gcc-config", "-c"], stdout=subprocess.PIPE).communicate()[0] -chost, _, gcc = gcc.rpartition('-') -stdcpp = '/usr/lib/gcc/%s/%s/libstdc++.so.?'%(chost.strip(), gcc.strip()) -stdcpp = glob.glob(stdcpp)[-1] -is64bit = platform.architecture()[0] == '64bit' -arch = 'x86_64' if is64bit else 'i686' -ffi = '/usr/lib/libffi.so.5' if is64bit else '/usr/lib/gcc/i686-pc-linux-gnu/4.4.1/libffi.so.4' - - QTDIR = '/usr/lib/qt4' QTDLLS = ('QtCore', 'QtGui', 'QtNetwork', 'QtSvg', 'QtXml', 'QtWebKit', 'QtDBus') - binary_includes = [ '/usr/bin/pdftohtml', '/usr/lib/libwmflite-0.2.so.7', @@ -49,8 +37,6 @@ binary_includes = [ '/usr/lib/libjpeg.so.8', '/usr/lib/libxslt.so.1', '/usr/lib/libgthread-2.0.so.0', - stdcpp, - ffi, '/usr/lib/libpng14.so.14', '/usr/lib/libexslt.so.0', '/usr/lib/libMagickWand.so.4', @@ -66,7 +52,11 @@ binary_includes = [ ] binary_includes += [os.path.join(QTDIR, 'lib%s.so.4'%x) for x in QTDLLS] -class LinuxFreeze2(Command): +is64bit = platform.architecture()[0] == '64bit' +arch = 'x86_64' if is64bit else 'i686' + + +class LinuxFreeze(Command): def run(self, opts): self.drop_privileges() @@ -93,7 +83,21 @@ class LinuxFreeze2(Command): self.info('Copying libs...') os.mkdir(self.lib_dir) os.mkdir(self.bin_dir) - for x in binary_includes: + + gcc = subprocess.Popen(["gcc-config", "-c"], stdout=subprocess.PIPE).communicate()[0] + chost, _, gcc = gcc.rpartition('-') + gcc_lib = '/usr/lib/gcc/%s/%s/'%(chost.strip(), gcc.strip()) + stdcpp = gcc_lib+'libstdc++.so.?' + stdcpp = glob.glob(stdcpp)[-1] + ffi = gcc_lib+'libffi.so.?' + ffi = glob.glob(ffi) + if ffi: + ffi = ffi[-1] + else: + ffi = glob.glob('/usr/lib/libffi.so.?')[-1] + + + for x in binary_includes + [stdcpp, ffi]: dest = self.bin_dir if '/bin/' in x else self.lib_dir shutil.copy2(x, dest) shutil.copy2('/usr/lib/libpython%s.so.1.0'%self.py_ver, dest) @@ -268,7 +272,6 @@ class LinuxFreeze2(Command): base=`dirname $path` lib=$base/lib export LD_LIBRARY_PATH=$lib:$LD_LIBRARY_PATH - export QT_PLUGIN_PATH=$lib/qt_plugins export MAGICK_CONFIGURE_PATH=$lib/ImageMagick/config export MAGICK_CODER_MODULE_PATH=$lib/ImageMagick/modules-Q16/coders export MAGICK_CODER_FILTER_PATH=$lib/ImageMagick/modules-Q16/filters @@ -336,12 +339,21 @@ class LinuxFreeze2(Command): def set_helper(): __builtin__.help = _Helper() + def set_qt_plugin_path(): + import uuid + uuid.uuid4() # Workaround for libuuid/PyQt conflict + from PyQt4.Qt import QCoreApplication + paths = list(map(unicode, QCoreApplication.libraryPaths())) + paths.insert(0, sys.frozen_path + '/lib/qt_plugins') + QCoreApplication.setLibraryPaths(paths) + def main(): try: sys.argv[0] = sys.calibre_basename set_default_encoding() set_helper() + set_qt_plugin_path() mod = __import__(sys.calibre_module, fromlist=[1]) func = getattr(mod, sys.calibre_function) return func() diff --git a/src/calibre/__init__.py b/src/calibre/__init__.py index 688d7793a4..a8cbe87e3e 100644 --- a/src/calibre/__init__.py +++ b/src/calibre/__init__.py @@ -3,7 +3,7 @@ __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal ' __docformat__ = 'restructuredtext en' -import uuid, sys, os, re, logging, time, mimetypes, \ +import uuid, sys, os, re, logging, time, \ __builtin__, warnings, multiprocessing from urllib import getproxies __builtin__.__dict__['dynamic_property'] = lambda(func): func(None) @@ -19,43 +19,18 @@ from calibre.constants import iswindows, isosx, islinux, isfreebsd, isfrozen, \ __appname__, __version__, __author__, \ win32event, win32api, winerror, fcntl, \ filesystem_encoding, plugins, config_dir -from calibre.startup import winutil, winutilerror +from calibre.startup import winutil, winutilerror, guess_type -uuid.uuid4() # Imported before PyQt4 to workaround PyQt4 util-linux conflict on gentoo +if islinux and not getattr(sys, 'frozen', False): + # Imported before PyQt4 to workaround PyQt4 util-linux conflict on gentoo + uuid.uuid4() if False: + # Prevent pyflakes from complaining winutil, winutilerror, __appname__, islinux, __version__ fcntl, win32event, isfrozen, __author__, terminal_controller - winerror, win32api, isfreebsd + winerror, win32api, isfreebsd, guess_type -mimetypes.add_type('application/epub+zip', '.epub') -mimetypes.add_type('text/x-sony-bbeb+xml', '.lrs') -mimetypes.add_type('application/xhtml+xml', '.xhtml') -mimetypes.add_type('image/svg+xml', '.svg') -mimetypes.add_type('text/fb2+xml', '.fb2') -mimetypes.add_type('application/x-sony-bbeb', '.lrf') -mimetypes.add_type('application/x-sony-bbeb', '.lrx') -mimetypes.add_type('application/x-dtbncx+xml', '.ncx') -mimetypes.add_type('application/adobe-page-template+xml', '.xpgt') -mimetypes.add_type('application/x-font-opentype', '.otf') -mimetypes.add_type('application/x-font-truetype', '.ttf') -mimetypes.add_type('application/oebps-package+xml', '.opf') -mimetypes.add_type('application/vnd.palm', '.pdb') -mimetypes.add_type('application/x-mobipocket-ebook', '.mobi') -mimetypes.add_type('application/x-mobipocket-ebook', '.prc') -mimetypes.add_type('application/x-mobipocket-ebook', '.azw') -mimetypes.add_type('application/x-cbz', '.cbz') -mimetypes.add_type('application/x-cbr', '.cbr') -mimetypes.add_type('application/x-koboreader-ebook', '.kobo') -mimetypes.add_type('image/wmf', '.wmf') -mimetypes.add_type('image/jpeg', '.jpg') -mimetypes.add_type('image/jpeg', '.jpeg') -mimetypes.add_type('image/png', '.png') -mimetypes.add_type('image/gif', '.gif') -mimetypes.add_type('image/bmp', '.bmp') -mimetypes.add_type('image/svg+xml', '.svg') - -guess_type = mimetypes.guess_type import cssutils cssutils.log.setLevel(logging.WARN) diff --git a/src/calibre/devices/android/driver.py b/src/calibre/devices/android/driver.py index 2d944c8519..811acbe55b 100644 --- a/src/calibre/devices/android/driver.py +++ b/src/calibre/devices/android/driver.py @@ -19,7 +19,7 @@ class ANDROID(USBMS): VENDOR_ID = { # HTC - 0x0bb4 : { 0x0c02 : [0x100, 0x0227], 0x0c01 : [0x100, 0x0227], 0x0ff9 + 0x0bb4 : { 0x0c02 : [0x100, 0x0227, 0x0226], 0x0c01 : [0x100, 0x0227], 0x0ff9 : [0x0100, 0x0227, 0x0226], 0x0c87: [0x0100, 0x0227, 0x0226], 0xc92 : [0x100]}, diff --git a/src/calibre/devices/kobo/driver.py b/src/calibre/devices/kobo/driver.py index 0eddf26549..b76ee4b1c3 100644 --- a/src/calibre/devices/kobo/driver.py +++ b/src/calibre/devices/kobo/driver.py @@ -79,11 +79,11 @@ class KOBO(USBMS): # Determine the firmware version f = open(self.normalize_path(self._main_prefix + '.kobo/version'), 'r') - fwversion = f.readline().split(',')[2] + self.fwversion = f.readline().split(',')[2] f.close() - if fwversion != '1.0' and fwversion != '1.4': + if self.fwversion != '1.0' and self.fwversion != '1.4': self.has_kepubs = True - debug_print('Version of firmware: ', fwversion, 'Has kepubs:', self.has_kepubs) + debug_print('Version of firmware: ', self.fwversion, 'Has kepubs:', self.has_kepubs) self.booklist_class.rebuild_collections = self.rebuild_collections @@ -220,6 +220,7 @@ class KOBO(USBMS): # 2) volume_shorcover # 2) content + debug_print('delete_via_sql: ContentID: ', ContentID, 'ContentType: ', ContentType) connection = sqlite.connect(self.normalize_path(self._main_prefix + '.kobo/KoboReader.sqlite')) cursor = connection.cursor() t = (ContentID,) @@ -400,6 +401,12 @@ class KOBO(USBMS): elif extension == '.pdf' or extension == '.epub': # print "ePub or pdf" ContentType = 16 + elif extension == '.rtf' or extension == '.txt' or extension == '.htm' or extension == '.html': + # print "txt" + if self.fwversion == '1.0' or self.fwversion == '1.4' or self.fwversion == '1.7.4': + ContentType = 999 + else: + ContentType = 901 else: # if extension == '.html' or extension == '.txt': ContentType = 999 # Yet another hack: to get around Kobo changing how ContentID is stored return ContentType diff --git a/src/calibre/ebooks/oeb/stylizer.py b/src/calibre/ebooks/oeb/stylizer.py index d10ea12394..4f8ae68943 100644 --- a/src/calibre/ebooks/oeb/stylizer.py +++ b/src/calibre/ebooks/oeb/stylizer.py @@ -240,18 +240,26 @@ class Stylizer(object): else: for elem in matches: self.style(elem)._update_cssdict(cssdict) - for elem in xpath(tree, '//h:img[@width or @height]'): - base = elem.get('style', '').strip() - if base: - base += ';' - for prop in ('width', 'height'): - val = elem.get(prop, False) - if val: - base += '%s: %s;'%(prop, val) - del elem.attrib[prop] - elem.set('style', base) for elem in xpath(tree, '//h:*[@style]'): self.style(elem)._apply_style_attr() + num_pat = re.compile(r'\d+$') + for elem in xpath(tree, '//h:img[@width or @height]'): + style = self.style(elem) + # Check if either height or width is not default + is_styled = style._style.get('width', 'auto') != 'auto' or \ + style._style.get('height', 'auto') != 'auto' + if not is_styled: + # Update img style dimension using width and height + upd = {} + for prop in ('width', 'height'): + val = elem.get(prop, '').strip() + del elem.attrib[prop] + if val: + if num_pat.match(val) is not None: + val += 'px' + upd[prop] = val + if upd: + style._update_cssdict(upd) def _fetch_css_file(self, path): hrefs = self.oeb.manifest.hrefs diff --git a/src/calibre/ebooks/oeb/transforms/jacket.py b/src/calibre/ebooks/oeb/transforms/jacket.py index 1a4a402a31..84f2dd5d6a 100644 --- a/src/calibre/ebooks/oeb/transforms/jacket.py +++ b/src/calibre/ebooks/oeb/transforms/jacket.py @@ -171,24 +171,18 @@ def render_jacket(mi, output_profile, generated_html = P('jacket/template.xhtml', data=True).decode('utf-8').format(**args) - print generated_html - # Post-process the generated html to strip out empty header items soup = BeautifulSoup(generated_html) if not series: - #series_tag = soup.find('tr', attrs={'class':'cbj_series'}) series_tag = soup.find(attrs={'class':'cbj_series'}) series_tag.extract() if not rating: - #rating_tag = soup.find('tr', attrs={'class':'cbj_rating'}) rating_tag = soup.find(attrs={'class':'cbj_rating'}) rating_tag.extract() if not tags: - #tags_tag = soup.find('tr', attrs={'class':'cbj_tags'}) tags_tag = soup.find(attrs={'class':'cbj_tags'}) tags_tag.extract() if not pubdate: - #pubdate_tag = soup.find('tr', attrs={'class':'cbj_pubdate'}) pubdate_tag = soup.find(attrs={'class':'cbj_pubdate'}) pubdate_tag.extract() if output_profile.short_name != 'kindle': diff --git a/src/calibre/gui2/actions/add.py b/src/calibre/gui2/actions/add.py index 5cc72c3ff0..9b348d8285 100644 --- a/src/calibre/gui2/actions/add.py +++ b/src/calibre/gui2/actions/add.py @@ -18,6 +18,7 @@ from calibre.ebooks import BOOK_EXTENSIONS from calibre.utils.filenames import ascii_filename from calibre.constants import preferred_encoding, filesystem_encoding from calibre.gui2.actions import InterfaceAction +from calibre.gui2 import config class AddAction(InterfaceAction): @@ -101,7 +102,12 @@ class AddAction(InterfaceAction): else: ids.add(db.import_book(mi, [])) self.gui.library_view.model().books_added(len(books)) - self.gui.iactions['Edit Metadata'].do_download_metadata(ids) + orig = config['overwrite_author_title_metadata'] + config['overwrite_author_title_metadata'] = True + try: + self.gui.iactions['Edit Metadata'].do_download_metadata(ids) + finally: + config['overwrite_author_title_metadata'] = orig def files_dropped(self, paths): diff --git a/src/calibre/gui2/actions/catalog.py b/src/calibre/gui2/actions/catalog.py index 77fa4755c1..a253664a1e 100644 --- a/src/calibre/gui2/actions/catalog.py +++ b/src/calibre/gui2/actions/catalog.py @@ -37,7 +37,8 @@ class GenerateCatalogAction(InterfaceAction): dbspec[id] = {'ondevice': db.ondevice(id, index_is_id=True)} # Calling gui2.tools:generate_catalog() - ret = generate_catalog(self.gui, dbspec, ids, self.gui.device_manager) + ret = generate_catalog(self.gui, dbspec, ids, self.gui.device_manager, + db) if ret is None: return diff --git a/src/calibre/gui2/actions/edit_metadata.py b/src/calibre/gui2/actions/edit_metadata.py index 9b3f2c5bb9..8b57b4b455 100644 --- a/src/calibre/gui2/actions/edit_metadata.py +++ b/src/calibre/gui2/actions/edit_metadata.py @@ -162,9 +162,14 @@ class EditMetadataAction(InterfaceAction): return # Prevent the TagView from updating due to signals from the database self.gui.tags_view.blockSignals(True) + changed = False try: - changed = MetadataBulkDialog(self.gui, rows, - self.gui.library_view.model()).changed + while True: + dialog = MetadataBulkDialog(self.gui, rows, self.gui.library_view.model()) + if dialog.changed: + changed = True + if not dialog.do_again: + break finally: self.gui.tags_view.blockSignals(False) if changed: diff --git a/src/calibre/gui2/catalog/catalog_bibtex.py b/src/calibre/gui2/catalog/catalog_bibtex.py index 6bbe85833c..5030cf6ec8 100644 --- a/src/calibre/gui2/catalog/catalog_bibtex.py +++ b/src/calibre/gui2/catalog/catalog_bibtex.py @@ -34,7 +34,7 @@ class PluginWidget(QWidget, Ui_Form): self.all_fields.append(x) QListWidgetItem(x, self.db_fields) - def initialize(self, name): #not working properly to update + def initialize(self, name, db): #not working properly to update self.name = name fields = gprefs.get(name+'_db_fields', self.all_fields) # Restore the activated db_fields from last use diff --git a/src/calibre/gui2/catalog/catalog_csv_xml.py b/src/calibre/gui2/catalog/catalog_csv_xml.py index 7ccb5e017e..077d4cbbca 100644 --- a/src/calibre/gui2/catalog/catalog_csv_xml.py +++ b/src/calibre/gui2/catalog/catalog_csv_xml.py @@ -28,7 +28,7 @@ class PluginWidget(QWidget, Ui_Form): self.all_fields.append(x) QListWidgetItem(x, self.db_fields) - def initialize(self, name): + def initialize(self, name, db): self.name = name fields = gprefs.get(name+'_db_fields', self.all_fields) # Restore the activated fields from last use diff --git a/src/calibre/gui2/catalog/catalog_epub_mobi.py b/src/calibre/gui2/catalog/catalog_epub_mobi.py index 4a330900b1..1ae4efd014 100644 --- a/src/calibre/gui2/catalog/catalog_epub_mobi.py +++ b/src/calibre/gui2/catalog/catalog_epub_mobi.py @@ -7,16 +7,11 @@ __copyright__ = '2009, Kovid Goyal ' __docformat__ = 'restructuredtext en' -import os - from calibre.ebooks.conversion.config import load_defaults from calibre.gui2 import gprefs -from calibre.library.database2 import LibraryDatabase2 -from calibre.utils.config import prefs from catalog_epub_mobi_ui import Ui_Form -from PyQt4 import QtGui -from PyQt4.Qt import QWidget +from PyQt4.Qt import QWidget, QLineEdit class PluginWidget(QWidget,Ui_Form): @@ -45,12 +40,10 @@ class PluginWidget(QWidget,Ui_Form): QWidget.__init__(self, parent) self.setupUi(self) - def initialize(self, name): + def initialize(self, name, db): self.name = name # Populate the 'Read book' source fields - dbpath = os.path.abspath(prefs['library_path']) - db = LibraryDatabase2(dbpath) all_custom_fields = db.custom_field_keys() custom_fields = {} custom_fields['Tag'] = {'field':'tag', 'datatype':u'text'} @@ -91,8 +84,8 @@ class PluginWidget(QWidget,Ui_Form): getattr(self, opt[0]).setText(opt_value) # Init self.read_source_field - cs = str(self.read_source_field_cb.currentText()) - read_source_spec = self.read_source_fields[str(cs)] + cs = unicode(self.read_source_field_cb.currentText()) + read_source_spec = self.read_source_fields[cs] self.read_source_field = read_source_spec['field'] def options(self): @@ -151,9 +144,9 @@ class PluginWidget(QWidget,Ui_Form): # Change pattern input widget to match the source field datatype if read_source_spec['datatype'] in ['bool','composite','datetime','text']: - if type(self.read_pattern) != type(QtGui.QLineEdit()): + if not isinstance(self.read_pattern, QLineEdit): self.read_spec_hl.removeWidget(self.read_pattern) - dw = QtGui.QLineEdit() + dw = QLineEdit(self) dw.setObjectName('read_pattern') dw.setToolTip('Pattern for read book') self.read_pattern = dw diff --git a/src/calibre/gui2/dialogs/catalog.py b/src/calibre/gui2/dialogs/catalog.py index f8e0f83746..7bb288ed20 100644 --- a/src/calibre/gui2/dialogs/catalog.py +++ b/src/calibre/gui2/dialogs/catalog.py @@ -19,7 +19,7 @@ from calibre.customize.ui import catalog_plugins class Catalog(QDialog, Ui_Dialog): ''' Catalog Dialog builder''' - def __init__(self, parent, dbspec, ids): + def __init__(self, parent, dbspec, ids, db): import re, cStringIO from calibre import prints as info from PyQt4.uic import compileUi @@ -51,7 +51,7 @@ class Catalog(QDialog, Ui_Dialog): catalog_widget = __import__('calibre.gui2.catalog.'+name, fromlist=[1]) pw = catalog_widget.PluginWidget() - pw.initialize(name) + pw.initialize(name, db) pw.ICON = I('forward.png') self.widgets.append(pw) [self.fmts.append([file_type.upper(), pw.sync_enabled,pw]) for file_type in plugin.file_types] diff --git a/src/calibre/gui2/dialogs/metadata_bulk.py b/src/calibre/gui2/dialogs/metadata_bulk.py index f8177b7680..4fd34e4c4c 100644 --- a/src/calibre/gui2/dialogs/metadata_bulk.py +++ b/src/calibre/gui2/dialogs/metadata_bulk.py @@ -6,7 +6,7 @@ __copyright__ = '2008, Kovid Goyal ' import re from PyQt4.Qt import Qt, QDialog, QGridLayout, QVBoxLayout, QFont, QLabel, \ - pyqtSignal + pyqtSignal, QDialogButtonBox from PyQt4 import QtGui from calibre.gui2.dialogs.metadata_bulk_ui import Ui_MetadataBulkDialog @@ -232,8 +232,19 @@ class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog): self.create_custom_column_editors() self.prepare_search_and_replace() + + self.button_box.clicked.connect(self.button_clicked) + self.button_box.button(QDialogButtonBox.Apply).setToolTip(_( + 'Immediately make all changes without closing the dialog. ' + 'This operation cannot be canceled or undone')) + self.do_again = False self.exec_() + def button_clicked(self, which): + if which == self.button_box.button(QDialogButtonBox.Apply): + self.do_again = True + self.accept() + def prepare_search_and_replace(self): self.search_for.initialize('bulk_edit_search_for') self.replace_with.initialize('bulk_edit_replace_with') @@ -692,7 +703,6 @@ class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog): self.db.clean() return QDialog.accept(self) - def series_changed(self, *args): self.write_series = True diff --git a/src/calibre/gui2/dialogs/metadata_bulk.ui b/src/calibre/gui2/dialogs/metadata_bulk.ui index 44839bbacd..344bde0fa0 100644 --- a/src/calibre/gui2/dialogs/metadata_bulk.ui +++ b/src/calibre/gui2/dialogs/metadata_bulk.ui @@ -710,7 +710,7 @@ nothing should be put between the original text and the inserted text Qt::Horizontal - QDialogButtonBox::Cancel|QDialogButtonBox::Ok + QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok diff --git a/src/calibre/gui2/dialogs/scheduler.py b/src/calibre/gui2/dialogs/scheduler.py index 071c5778a8..572bbcf1c4 100644 --- a/src/calibre/gui2/dialogs/scheduler.py +++ b/src/calibre/gui2/dialogs/scheduler.py @@ -10,7 +10,8 @@ Scheduler for automated recipe downloads from datetime import timedelta from PyQt4.Qt import QDialog, SIGNAL, Qt, QTime, QObject, QMenu, \ - QAction, QIcon, QMutex, QTimer, pyqtSignal + QAction, QIcon, QMutex, QTimer, pyqtSignal, QWidget, QHBoxLayout, \ + QLabel from calibre.gui2.dialogs.scheduler_ui import Ui_Dialog from calibre.gui2.search_box import SearchBox2 @@ -28,15 +29,21 @@ class SchedulerDialog(QDialog, Ui_Dialog): self.recipe_model = recipe_model self.recipe_model.do_refresh() + self._cont = QWidget(self) + self._cont.l = QHBoxLayout() + self._cont.setLayout(self._cont.l) + self._cont.la = QLabel(_('&Search:')) + self._cont.l.addWidget(self._cont.la, 1) self.search = SearchBox2(self) + self._cont.l.addWidget(self.search, 100) + self._cont.la.setBuddy(self.search) self.search.setMinimumContentsLength(25) self.search.initialize('scheduler_search_history') - self.recipe_box.layout().insertWidget(0, self.search) + self.recipe_box.layout().insertWidget(0, self._cont) self.search.search.connect(self.recipe_model.search) - self.connect(self.recipe_model, SIGNAL('searched(PyQt_PyObject)'), - self.search.search_done) - self.connect(self.recipe_model, SIGNAL('searched(PyQt_PyObject)'), - self.search_done) + self.recipe_model.searched.connect(self.search.search_done, + type=Qt.QueuedConnection) + self.recipe_model.searched.connect(self.search_done) self.search.setFocus(Qt.OtherFocusReason) self.commit_on_change = True diff --git a/src/calibre/gui2/dialogs/tag_categories.py b/src/calibre/gui2/dialogs/tag_categories.py index 679a5c9da9..7a9660a655 100644 --- a/src/calibre/gui2/dialogs/tag_categories.py +++ b/src/calibre/gui2/dialogs/tag_categories.py @@ -51,7 +51,7 @@ class TagCategories(QDialog, Ui_TagCategories): cc_map = self.db.custom_column_label_map for cc in cc_map: - if cc_map[cc]['datatype'] == 'text': + if cc_map[cc]['datatype'] in ['text', 'series']: self.category_labels.append(db.field_metadata.label_to_key(cc)) category_icons.append(cc_icon) category_values.append(lambda col=cc: self.db.all_custom(label=col)) diff --git a/src/calibre/gui2/library/views.py b/src/calibre/gui2/library/views.py index a972acfc13..fadb8314e3 100644 --- a/src/calibre/gui2/library/views.py +++ b/src/calibre/gui2/library/views.py @@ -517,6 +517,8 @@ class BooksView(QTableView): # {{{ md.setUrls([url_for_id(i) for i in selected]) drag = QDrag(self) + col = self.selectionModel().currentIndex().column() + md.column_name = self.column_map[col] drag.setMimeData(md) cover = self.drag_icon(m.cover(self.currentIndex().row()), len(selected) > 1) diff --git a/src/calibre/gui2/lrf_renderer/main.py b/src/calibre/gui2/lrf_renderer/main.py index 8ddda175fa..2acfd3c9a7 100644 --- a/src/calibre/gui2/lrf_renderer/main.py +++ b/src/calibre/gui2/lrf_renderer/main.py @@ -127,7 +127,7 @@ class Main(MainWindow, Ui_MainWindow): self.progress_label.setText('Parsing '+ self.file_name) self.renderer = RenderWorker(self, stream, self.logger, self.opts) QObject.connect(self.renderer, SIGNAL('finished()'), self.parsed, Qt.QueuedConnection) - self.search.clear_to_help() + self.search.clear() self.last_search = None else: self.stack.setCurrentIndex(0) diff --git a/src/calibre/gui2/search_box.py b/src/calibre/gui2/search_box.py index b37d74f51f..4d598a3bbb 100644 --- a/src/calibre/gui2/search_box.py +++ b/src/calibre/gui2/search_box.py @@ -8,9 +8,8 @@ __docformat__ = 'restructuredtext en' import re -from PyQt4.Qt import QComboBox, Qt, QLineEdit, QStringList, pyqtSlot, \ - pyqtSignal, SIGNAL, QObject, QDialog, QCompleter, \ - QAction, QKeySequence, QTimer +from PyQt4.Qt import QComboBox, Qt, QLineEdit, QStringList, pyqtSlot, QDialog, \ + pyqtSignal, QCompleter, QAction, QKeySequence, QTimer from calibre.gui2 import config from calibre.gui2.dialogs.confirm_delete import confirm @@ -20,35 +19,30 @@ from calibre.utils.search_query_parser import saved_searches class SearchLineEdit(QLineEdit): key_pressed = pyqtSignal(object) - mouse_released = pyqtSignal(object) - focus_out = pyqtSignal(object) def keyPressEvent(self, event): self.key_pressed.emit(event) QLineEdit.keyPressEvent(self, event) def mouseReleaseEvent(self, event): - self.mouse_released.emit(event) QLineEdit.mouseReleaseEvent(self, event) + QLineEdit.selectAll(self) - def focusOutEvent(self, event): - self.focus_out.emit(event) - QLineEdit.focusOutEvent(self, event) + def focusInEvent(self, event): + QLineEdit.focusInEvent(self, event) + QLineEdit.selectAll(self) def dropEvent(self, ev): - if self.parent().help_state: - self.parent().normalize_state() + self.parent().normalize_state() return QLineEdit.dropEvent(self, ev) def contextMenuEvent(self, ev): - if self.parent().help_state: - self.parent().normalize_state() + self.parent().normalize_state() return QLineEdit.contextMenuEvent(self, ev) @pyqtSlot() def paste(self, *args): - if self.parent().help_state: - self.parent().normalize_state() + self.parent().normalize_state() return QLineEdit.paste(self) class SearchBox2(QComboBox): @@ -59,14 +53,17 @@ class SearchBox2(QComboBox): * Call initialize() * Connect to the search() and cleared() signals from this widget. * Connect to the cleared() signal to know when the box content changes + * Connect to focus_to_library signal to be told to manually change focus * Call search_done() after every search is complete - * Use clear() to clear back to the help message ''' INTERVAL = 1500 #: Time to wait before emitting search signal MAX_COUNT = 25 - search = pyqtSignal(object) + search = pyqtSignal(object) + cleared = pyqtSignal() + changed = pyqtSignal() + focus_to_library = pyqtSignal() def __init__(self, parent=None): QComboBox.__init__(self, parent) @@ -75,15 +72,10 @@ class SearchBox2(QComboBox): self.setLineEdit(self.line_edit) c = self.line_edit.completer() c.setCompletionMode(c.PopupCompletion) - self.line_edit.key_pressed.connect(self.key_pressed, - type=Qt.DirectConnection) - self.line_edit.mouse_released.connect(self.mouse_released, - type=Qt.DirectConnection) + self.line_edit.key_pressed.connect(self.key_pressed, type=Qt.DirectConnection) self.activated.connect(self.history_selected) self.setEditable(True) - self.help_state = False self.as_you_type = True - self.prev_search = '' self.timer = QTimer() self.timer.setSingleShot(True) self.timer.timeout.connect(self.timer_event, type=Qt.QueuedConnection) @@ -98,97 +90,73 @@ class SearchBox2(QComboBox): self.as_you_type = config['search_as_you_type'] self.opt_name = opt_name self.addItems(QStringList(list(set(config[opt_name])))) - self.help_text = help_text + try: + self.line_edit.setPlaceholderText(help_text) + except: + # Using Qt < 4.7 + pass self.colorize = colorize - self.clear_to_help() + self.clear() def normalize_state(self): self.setToolTip(self.tool_tip_text) - if self.help_state: - self.setEditText('') - self.line_edit.setStyleSheet( - 'QLineEdit { color: black; background-color: %s; }' % - self.normal_background) - self.help_state = False - else: - self.line_edit.setStyleSheet( - 'QLineEdit { color: black; background-color: %s; }' % - self.normal_background) - - def clear_to_help(self): - self.setToolTip(self.tool_tip_text) - if self.help_state: - return - self.help_state = True - self.search.emit('') - self._in_a_search = False - self.setEditText(self.help_text) - self.line_edit.home(False) self.line_edit.setStyleSheet( - 'QLineEdit { color: gray; background-color: %s; }' % - self.normal_background) - self.emit(SIGNAL('cleared()')) + 'QLineEdit{color:black;background-color:%s;}' % self.normal_background) def text(self): return self.currentText() - def clear(self): - self.clear_to_help() + def clear(self, emit_search=True): + self.normalize_state() + self.setEditText('') + if emit_search: + self.search.emit('') + self._in_a_search = False + self.cleared.emit() + + def clear_clicked(self, *args): + self.clear() def search_done(self, ok): if isinstance(ok, basestring): self.setToolTip(ok) ok = False if not unicode(self.currentText()).strip(): - return self.clear_to_help() + self.clear(emit_search=False) + return self._in_a_search = ok col = 'rgba(0,255,0,20%)' if ok else 'rgb(255,0,0,20%)' if not self.colorize: col = self.normal_background - self.line_edit.setStyleSheet('QLineEdit { color: black; background-color: %s; }' % col) + self.line_edit.setStyleSheet('QLineEdit{color:black;background-color:%s;}' % col) def key_pressed(self, event): k = event.key() if k in (Qt.Key_Left, Qt.Key_Right, Qt.Key_Up, Qt.Key_Down, - Qt.Key_Home, Qt.Key_End, Qt.Key_PageUp, Qt.Key_PageDown): + Qt.Key_Home, Qt.Key_End, Qt.Key_PageUp, Qt.Key_PageDown, + Qt.Key_unknown): return self.normalize_state() if self._in_a_search: - self.emit(SIGNAL('changed()')) + self.changed.emit() self._in_a_search = False if event.key() in (Qt.Key_Return, Qt.Key_Enter): self.do_search() - if self.as_you_type: + self.focus_to_library.emit() + elif self.as_you_type and unicode(event.text()): self.timer.start(1500) - def mouse_released(self, event): - self.normalize_state() - # Dont trigger a search since it make - # re-positioning the cursor using the mouse - # impossible - #if self.as_you_type: - # self.timer.start(1500) - def timer_event(self): self.do_search() def history_selected(self, text): - self.emit(SIGNAL('changed()')) + self.changed.emit() self.do_search() - @property - def smart_text(self): - text = unicode(self.currentText()).strip() - if not text or text == self.help_text: - return '' - return text - def do_search(self, *args): text = unicode(self.currentText()).strip() - if not text or text == self.help_text: + if not text: return self.clear() - self.help_state = False - self.prev_search = text self.search.emit(text) idx = self.findText(text, Qt.MatchFixedString) @@ -220,7 +188,7 @@ class SearchBox2(QComboBox): def set_search_string(self, txt): if not txt: - self.clear_to_help() + self.clear() return self.normalize_state() self.setEditText(txt) @@ -243,25 +211,24 @@ class SavedSearchBox(QComboBox): if you care about changes to the list of saved searches. ''' + changed = pyqtSignal() + focus_to_library = pyqtSignal() + def __init__(self, parent=None): QComboBox.__init__(self, parent) self.normal_background = 'rgb(255, 255, 255, 0%)' self.line_edit = SearchLineEdit(self) self.setLineEdit(self.line_edit) - self.line_edit.key_pressed.connect(self.key_pressed, - type=Qt.DirectConnection) - self.line_edit.mouse_released.connect(self.mouse_released, - type=Qt.DirectConnection) - self.line_edit.focus_out.connect(self.focus_out, - type=Qt.DirectConnection) + self.line_edit.key_pressed.connect(self.key_pressed, type=Qt.DirectConnection) self.activated[str].connect(self.saved_search_selected) - completer = QCompleter(self) # turn off auto-completion + # Turn off auto-completion so that it doesn't interfere with typing + # names of new searches. + completer = QCompleter(self) self.setCompleter(completer) + self.setEditable(True) - self.help_state = True - self.prev_search = '' self.setInsertPolicy(self.NoInsert) self.setSizeAdjustPolicy(self.AdjustToMinimumContentsLengthWithIcon) self.setMinimumContentsLength(10) @@ -269,50 +236,40 @@ class SavedSearchBox(QComboBox): def initialize(self, _search_box, colorize=False, help_text=_('Search')): self.search_box = _search_box - self.help_text = help_text + self.line_edit.setPlaceholderText(help_text) self.colorize = colorize - self.clear_to_help() + self.clear() def normalize_state(self): - self.setEditText('') - self.line_edit.setStyleSheet( - 'QLineEdit { color: black; background-color: %s; }' % - self.normal_background) - self.help_state = False + # need this because line_edit will call it in some cases such as paste + pass - def clear_to_help(self): - self.setToolTip(self.tool_tip_text) + def clear(self): + QComboBox.clear(self) self.initialize_saved_search_names() - self.setEditText(self.help_text) + self.setEditText('') self.line_edit.home(False) - self.help_state = True - self.line_edit.setStyleSheet( - 'QLineEdit { color: gray; background-color: %s; }' % - self.normal_background) - - def focus_out(self, event): - if self.currentText() == '': - self.clear_to_help() def key_pressed(self, event): - if self.help_state: - self.normalize_state() - - def mouse_released(self, event): - if self.help_state: - self.normalize_state() + if event.key() in (Qt.Key_Return, Qt.Key_Enter): + self.saved_search_selected(self.currentText()) + self.focus_to_library.emit() def saved_search_selected(self, qname): qname = unicode(qname) if qname is None or not qname.strip(): + self.search_box.clear() + return + if not saved_searches().lookup(qname): + self.search_box.clear() + self.setEditText(qname) return - self.normalize_state() self.search_box.set_search_string(u'search:"%s"' % qname) self.setEditText(qname) self.setToolTip(saved_searches().lookup(qname)) + self.focus_to_library.emit() def initialize_saved_search_names(self): - self.clear() qnames = saved_searches().names() self.addItems(qnames) self.setCurrentIndex(-1) @@ -330,25 +287,24 @@ class SavedSearchBox(QComboBox): if ss is None: return saved_searches().delete(unicode(self.currentText())) - self.clear_to_help() - self.search_box.clear_to_help() - self.emit(SIGNAL('changed()')) + self.clear() + self.search_box.clear() + self.changed.emit() # SIGNALed from the main UI def save_search_button_clicked(self): name = unicode(self.currentText()) - if self.help_state or not name.strip(): + if not name.strip(): name = unicode(self.search_box.text()).replace('"', '') saved_searches().delete(name) saved_searches().add(name, unicode(self.search_box.text())) # now go through an initialization cycle to ensure that the combobox has # the new search in it, that it is selected, and that the search box # references the new search instead of the text in the search. - self.clear_to_help() - self.normalize_state() + self.clear() self.setCurrentIndex(self.findText(name)) self.saved_search_selected (name) - self.emit(SIGNAL('changed()')) + self.changed.emit() # SIGNALed from the main UI def copy_search_button_clicked (self): @@ -362,11 +318,11 @@ class SearchBoxMixin(object): def __init__(self): self.search.initialize('main_search_history', colorize=True, help_text=_('Search (For Advanced Search click the button to the left)')) - self.connect(self.search, SIGNAL('cleared()'), self.search_box_cleared) - self.connect(self.search, SIGNAL('changed()'), self.search_box_changed) - self.connect(self.clear_button, SIGNAL('clicked()'), self.search.clear) - QObject.connect(self.advanced_search_button, SIGNAL('clicked(bool)'), - self.do_advanced_search) + self.search.cleared.connect(self.search_box_cleared) + self.search.changed.connect(self.search_box_changed) + self.search.focus_to_library.connect(self.focus_to_library) + self.clear_button.clicked.connect(self.search.clear_clicked) + self.advanced_search_button.clicked[bool].connect(self.do_advanced_search) self.search.clear() self.search.setMaximumWidth(self.width()-150) @@ -384,11 +340,11 @@ class SearchBoxMixin(object): def search_box_cleared(self): self.tags_view.clear() - self.saved_search.clear_to_help() + self.saved_search.clear() self.set_number_of_books_shown() def search_box_changed(self): - self.saved_search.clear_to_help() + self.saved_search.clear() self.tags_view.clear() def do_advanced_search(self, *args): @@ -396,20 +352,24 @@ class SearchBoxMixin(object): if d.exec_() == QDialog.Accepted: self.search.set_search_string(d.search_string()) + def focus_to_library(self): + self.current_view().setFocus(Qt.OtherFocusReason) + class SavedSearchBoxMixin(object): def __init__(self): - self.connect(self.saved_search, SIGNAL('changed()'), self.saved_searches_changed) + self.saved_search.changed.connect(self.saved_searches_changed) + self.clear_button.clicked.connect(self.saved_search.clear) + self.saved_search.focus_to_library.connect(self.focus_to_library) + self.save_search_button.clicked.connect( + self.saved_search.save_search_button_clicked) + self.delete_search_button.clicked.connect( + self.saved_search.delete_search_button_clicked) + self.copy_search_button.clicked.connect( + self.saved_search.copy_search_button_clicked) self.saved_searches_changed() - self.connect(self.clear_button, SIGNAL('clicked()'), self.saved_search.clear_to_help) self.saved_search.initialize(self.search, colorize=True, help_text=_('Saved Searches')) - self.connect(self.save_search_button, SIGNAL('clicked()'), - self.saved_search.save_search_button_clicked) - self.connect(self.delete_search_button, SIGNAL('clicked()'), - self.saved_search.delete_search_button_clicked) - self.connect(self.copy_search_button, SIGNAL('clicked()'), - self.saved_search.copy_search_button_clicked) self.saved_search.setToolTip( _('Choose saved search or enter name for new saved search')) self.saved_search.setStatusTip(self.saved_search.toolTip()) @@ -420,7 +380,8 @@ class SavedSearchBoxMixin(object): def saved_searches_changed(self): p = sorted(saved_searches().names(), cmp=lambda x,y: cmp(x.lower(), y.lower())) t = unicode(self.search_restriction.currentText()) - self.search_restriction.clear() # rebuild the restrictions combobox using current saved searches + # rebuild the restrictions combobox using current saved searches + self.search_restriction.clear() self.search_restriction.addItem('') self.tags_view.recount() for s in p: @@ -433,6 +394,8 @@ class SavedSearchBoxMixin(object): d.exec_() if d.result() == d.Accepted: self.saved_searches_changed() - self.saved_search.clear_to_help() + self.saved_search.clear() + def focus_to_library(self): + self.current_view().setFocus(Qt.OtherFocusReason) diff --git a/src/calibre/gui2/search_restriction_mixin.py b/src/calibre/gui2/search_restriction_mixin.py index 139d7c551d..6373e452e5 100644 --- a/src/calibre/gui2/search_restriction_mixin.py +++ b/src/calibre/gui2/search_restriction_mixin.py @@ -49,8 +49,8 @@ class SearchRestrictionMixin(object): restriction = '' self.restriction_count_of_books_in_view = \ self.library_view.model().set_search_restriction(restriction) - self.search.clear_to_help() - self.saved_search.clear_to_help() + self.search.clear() + self.saved_search.clear() self.tags_view.set_search_restriction(restriction) self.set_number_of_books_shown() diff --git a/src/calibre/gui2/tag_view.py b/src/calibre/gui2/tag_view.py index 3ded769137..b841706439 100644 --- a/src/calibre/gui2/tag_view.py +++ b/src/calibre/gui2/tag_view.py @@ -67,7 +67,7 @@ class TagsView(QTreeView): # {{{ author_sort_edit = pyqtSignal(object, object) tag_item_renamed = pyqtSignal() search_item_renamed = pyqtSignal() - drag_drop_finished = pyqtSignal(object) + drag_drop_finished = pyqtSignal(object, object) def __init__(self, parent=None): QTreeView.__init__(self, parent=None) @@ -252,6 +252,28 @@ class TagsView(QTreeView): # {{{ self.context_menu.popup(self.mapToGlobal(point)) return True + def dragMoveEvent(self, event): + QTreeView.dragMoveEvent(self, event) + self.setDropIndicatorShown(False) + index = self.indexAt(event.pos()) + if not index.isValid(): + return + item = index.internalPointer() + flags = self._model.flags(index) + if item.type == TagTreeItem.TAG and flags & Qt.ItemIsDropEnabled: + self.setDropIndicatorShown(True) + else: + if item.type == TagTreeItem.CATEGORY: + fm_dest = self.db.metadata_for_field(item.category_key) + if fm_dest['kind'] == 'user': + md = event.mimeData() + fm_src = self.db.metadata_for_field(md.column_name) + if md.column_name in ['authors', 'publisher', 'series'] or \ + (fm_src['is_custom'] and + fm_src['datatype'] in ['series', 'text'] and + not fm_src['is_multiple']): + self.setDropIndicatorShown(True) + def clear(self): if self.model(): self.model().clear_state() @@ -448,8 +470,59 @@ class TagsModel(QAbstractItemModel): # {{{ ids = list(map(int, str(md.data(mime)).split())) self.handle_drop(node, ids) return True + elif node.type == TagTreeItem.CATEGORY: + fm_dest = self.db.metadata_for_field(node.category_key) + if fm_dest['kind'] == 'user': + fm_src = self.db.metadata_for_field(md.column_name) + if md.column_name in ['authors', 'publisher', 'series'] or \ + (fm_src['is_custom'] and + fm_src['datatype'] in ['series', 'text'] and + not fm_src['is_multiple']): + mime = 'application/calibre+from_library' + ids = list(map(int, str(md.data(mime)).split())) + self.handle_user_category_drop(node, ids, md.column_name) + return True return False + def handle_user_category_drop(self, on_node, ids, column): + categories = self.db.prefs.get('user_categories', {}) + category = categories.get(on_node.category_key[:-1], None) + if category is None: + return + fm_src = self.db.metadata_for_field(column) + for id in ids: + vmap = {} + label = fm_src['label'] + if not fm_src['is_custom']: + if label == 'authors': + items = self.db.get_authors_with_ids() + items = [(i[0], i[1].replace('|', ',')) for i in items] + value = self.db.authors(id, index_is_id=True) + value = [v.replace('|', ',') for v in value.split(',')] + elif label == 'publisher': + items = self.db.get_publishers_with_ids() + value = self.db.publisher(id, index_is_id=True) + elif label == 'series': + items = self.db.get_series_with_ids() + value = self.db.series(id, index_is_id=True) + else: + items = self.db.get_custom_items_with_ids(label=label) + value = self.db.get_custom(id, label=label, index_is_id=True) + if value is None: + return + if not isinstance(value, list): + value = [value] + for v in items: + vmap[v[1]] = v[0] + for val in value: + for (v, c, id) in category: + if v == val and c == column: + break + else: + category.append([val, column, vmap[val]]) + categories[on_node.category_key[:-1]] = category + self.db.prefs.set('user_categories', categories) + self.drag_drop_finished.emit(None, True) def handle_drop(self, on_node, ids): #print 'Dropped ids:', ids, on_node.tag @@ -499,7 +572,7 @@ class TagsModel(QAbstractItemModel): # {{{ self.db.set_metadata(id, mi, set_title=False, set_authors=set_authors, commit=False) self.db.commit() - self.drag_drop_finished.emit(ids) + self.drag_drop_finished.emit(ids, False) def set_search_restriction(self, s): self.search_restriction = s @@ -641,6 +714,8 @@ class TagsModel(QAbstractItemModel): # {{{ (fm['is_custom'] and \ fm['datatype'] in ['text', 'rating', 'series']): ans |= Qt.ItemIsDropEnabled + else: + ans |= Qt.ItemIsDropEnabled return ans def supportedDropActions(self): @@ -768,7 +843,7 @@ class TagBrowserMixin(object): # {{{ self.tags_view.set_database(self.library_view.model().db, self.tag_match, self.sort_by) self.tags_view.tags_marked.connect(self.search.search_from_tags) - self.tags_view.tags_marked.connect(self.saved_search.clear_to_help) + self.tags_view.tags_marked.connect(self.saved_search.clear) self.tags_view.tag_list_edit.connect(self.do_tags_list_edit) self.tags_view.user_category_edit.connect(self.do_user_categories_edit) self.tags_view.saved_search_edit.connect(self.do_saved_search_edit) @@ -835,14 +910,14 @@ class TagBrowserMixin(object): # {{{ self.library_view.model().refresh() self.tags_view.set_new_model() self.tags_view.recount() - self.saved_search.clear_to_help() - self.search.clear_to_help() + self.saved_search.clear() + self.search.clear() def do_tag_item_renamed(self): # Clean up library view and search self.library_view.model().refresh() - self.saved_search.clear_to_help() - self.search.clear_to_help() + self.saved_search.clear() + self.search.clear() def do_author_sort_edit(self, parent, id): db = self.library_view.model().db @@ -857,8 +932,11 @@ class TagBrowserMixin(object): # {{{ self.library_view.model().refresh() self.tags_view.recount() - def drag_drop_finished(self, ids): - self.library_view.model().refresh_ids(ids) + def drag_drop_finished(self, ids, is_category): + if is_category: + self.tags_view.recount() + else: + self.library_view.model().refresh_ids(ids) # }}} diff --git a/src/calibre/gui2/tools.py b/src/calibre/gui2/tools.py index 2919493d12..fc84e88d09 100644 --- a/src/calibre/gui2/tools.py +++ b/src/calibre/gui2/tools.py @@ -245,11 +245,11 @@ def fetch_scheduled_recipe(arg): return 'gui_convert', args, _('Fetch news from ')+arg['title'], fmt.upper(), [pt] -def generate_catalog(parent, dbspec, ids, device_manager): +def generate_catalog(parent, dbspec, ids, device_manager, db): from calibre.gui2.dialogs.catalog import Catalog # Build the Catalog dialog in gui2.dialogs.catalog - d = Catalog(parent, dbspec, ids) + d = Catalog(parent, dbspec, ids, db) if d.exec_() != d.Accepted: return None diff --git a/src/calibre/gui2/ui.py b/src/calibre/gui2/ui.py index 00bba2b491..cb25f75d4a 100644 --- a/src/calibre/gui2/ui.py +++ b/src/calibre/gui2/ui.py @@ -383,8 +383,8 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{ self.tags_view.set_database(db, self.tag_match, self.sort_by) self.library_view.model().set_book_on_device_func(self.book_on_device) self.status_bar.clear_message() - self.search.clear_to_help() - self.saved_search.clear_to_help() + self.search.clear() + self.saved_search.clear() self.book_details.reset_info() self.library_view.model().count_changed() prefs['library_path'] = self.library_path diff --git a/src/calibre/gui2/viewer/main.py b/src/calibre/gui2/viewer/main.py index f9a2432099..70fa99b4b6 100644 --- a/src/calibre/gui2/viewer/main.py +++ b/src/calibre/gui2/viewer/main.py @@ -237,9 +237,9 @@ class EbookViewer(MainWindow, Ui_EbookViewer): self.connect(self.action_previous_page, SIGNAL('triggered(bool)'), lambda x:self.view.previous_page()) self.connect(self.action_find_next, SIGNAL('triggered(bool)'), - lambda x:self.find(self.search.smart_text, repeat=True)) + lambda x:self.find(unicode(self.search.text()), repeat=True)) self.connect(self.action_find_previous, SIGNAL('triggered(bool)'), - lambda x:self.find(self.search.smart_text, + lambda x:self.find(unicode(self.search.text()), repeat=True, backwards=True)) self.connect(self.action_full_screen, SIGNAL('triggered(bool)'), diff --git a/src/calibre/library/catalog.py b/src/calibre/library/catalog.py index 631e635937..eed258a6b0 100644 --- a/src/calibre/library/catalog.py +++ b/src/calibre/library/catalog.py @@ -898,8 +898,8 @@ class EPUB_MOBI(CatalogPlugin): self.__plugin = plugin self.__progressInt = 0.0 self.__progressString = '' - self.__read_book_marker = {'field':opts.read_book_marker.split(':')[0], - 'pattern':opts.read_book_marker.split(':')[1]} + f, _, p = opts.read_book_marker.partition(':') + self.__read_book_marker = {'field':f, 'pattern':p} self.__reporter = report_progress self.__stylesheet = stylesheet self.__thumbs = None @@ -1211,7 +1211,7 @@ class EPUB_MOBI(CatalogPlugin): def READING_SYMBOL(self): def fget(self): return '' if self.generateForKindle else \ - '%s' % self.opts.read_tag + '+' return property(fget=fget) @dynamic_property def READ_SYMBOL(self): @@ -1402,7 +1402,6 @@ class EPUB_MOBI(CatalogPlugin): if record['cover']: this_title['cover'] = re.sub('&', '&', record['cover']) - # This may be updated in self.processSpecialTags() this_title['read'] = self.discoverReadStatus(record) if record['tags']: @@ -2684,7 +2683,7 @@ class EPUB_MOBI(CatalogPlugin): pBookTag.insert(ptc,NavigableString(self.MISSING_SYMBOL)) ptc += 1 else: - if book['read']: + if book.get('read', False): # check mark pBookTag.insert(ptc,NavigableString(self.READ_SYMBOL)) pBookTag['class'] = "read_book" @@ -4035,24 +4034,21 @@ class EPUB_MOBI(CatalogPlugin): ''' # Legacy handling of special 'read' tag - if self.__read_book_marker['field'] == 'tag': - return self.__read_book_marker['pattern'] in record['tags'] + field = self.__read_book_marker['field'] + pat = self.__read_book_marker['pattern'] + if field == 'tag' and pat in record['tags']: + return True - # Custom fields - elif self.__read_book_marker['field'].startswith('#'): - field_contents = self.__db.get_field(record['id'], - self.__read_book_marker['field'], - index_is_id=True) - if field_contents == '': - field_contents = None - - if field_contents is not None: - if re.match(self.__read_book_marker['pattern'],str(field_contents), re.IGNORECASE): - return True + field_contents = self.__db.get_field(record['id'], + field, + index_is_id=True) + if field_contents: + if re.search(pat, unicode(field_contents), + re.IGNORECASE) is not None: + return True return False - def filterDbTags(self, tags): # Remove the special marker tags from the database's tag list, # return sorted list of normalized genre tags @@ -4787,7 +4783,7 @@ class EPUB_MOBI(CatalogPlugin): for key in keys: if key in ['catalog_title','authorClip','connected_kindle','descriptionClip', 'exclude_genre','exclude_tags','note_tag','numbers_as_text', - 'output_profile','read_book_marker','read_tag', + 'output_profile','read_book_marker', 'search_text','sort_by','sort_descriptions_by_author','sync', 'wishlist_tag']: build_log.append(" %s: %s" % (key, opts_dict[key])) diff --git a/src/calibre/library/server/browse.py b/src/calibre/library/server/browse.py index 87c55275d7..b6dbde4c77 100644 --- a/src/calibre/library/server/browse.py +++ b/src/calibre/library/server/browse.py @@ -359,16 +359,16 @@ class BrowseServer(object): icon = 'blank.png' cats.append((meta['name'], category, icon)) - cats = [('
  •  ' - '{0}' - '{0}' - '
  • ') + cats = [(u'
  •  ' + u'{0}' + u'{0}' + u'
  • ') .format(xml(x, True), xml(quote(y)), xml(_('Browse books by')), self.opts.url_prefix, src='/browse/icon/'+z) for x, y, z in cats] - main = '

    {0}

      {1}
    '\ - .format(_('Choose a category to browse by:'), '\n\n'.join(cats)) + main = u'

    {0}

      {1}
    '\ + .format(_('Choose a category to browse by:'), u'\n\n'.join(cats)) return self.browse_template('name').format(title='', script='toplevel();', main=main) diff --git a/src/calibre/manual/customize.rst b/src/calibre/manual/customize.rst index 0d6f75b9cf..d7b4e931d9 100644 --- a/src/calibre/manual/customize.rst +++ b/src/calibre/manual/customize.rst @@ -104,6 +104,8 @@ A Hello World GUI plugin Here's a simple Hello World plugin for the |app| GUI. It will cause a box to popup with the message "Hellooo World!" when you press Ctrl+Shift+H +.. note:: Only available in calibre versions ``>= 0.7.32``. + .. code-block:: python from calibre.customize import InterfaceActionBase diff --git a/src/calibre/manual/faq.rst b/src/calibre/manual/faq.rst index f9fe5bd3af..55451206b6 100644 --- a/src/calibre/manual/faq.rst +++ b/src/calibre/manual/faq.rst @@ -247,6 +247,18 @@ Also, :: must return ``CONFIG_SCSI_MULTI_LUN=y``. If you don't see either, you have to recompile your kernel with the correct settings. +My device is getting mounted read-only in linux, so |app| cannot connect to it? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +linux kernels mount devices read-only when their filesystems have errors. You can repair the filesystem with:: + + sudo fsck.vfat -y /dev/sdc + +Replace /dev/sdc with the path to the device node of your device. You can find the device node of your device, which +will always be under /dev by examining the output of:: + + mount + Why does |app| not support collection on the Kindle or shelves on the Nook? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/src/calibre/manual/gui.rst b/src/calibre/manual/gui.rst index a91124b214..28fd0307d3 100644 --- a/src/calibre/manual/gui.rst +++ b/src/calibre/manual/gui.rst @@ -12,6 +12,7 @@ for using |app| is to first add books to the library from your hard disk. to its internal database. Once they are in the database, you can perform a various :ref:`actions` on them that include conversion from one format to another, transfer to the reading device, viewing on your computer, editing metadata, including covers, etc. +Note that |app| creates copies of the files you add to it, your original files are left untouched. The interface is divided into various sections: @@ -27,7 +28,7 @@ Actions .. image:: images/actions.png :alt: The Actions Toolbar -The actions toolbar provides convenient shortcuts to commonly used actions. Most of the action buttons have little arrows next to them. By clicking the arrows, you can perform variations on the default action. +The actions toolbar provides convenient shortcuts to commonly used actions. Most of the action buttons have little arrows next to them. By clicking the arrows, you can perform variations on the default action. Please note that the actions toolbar will look slightly different depending on whether you have an ebook reader attached to your computer. .. contents:: :depth: 1 @@ -39,99 +40,51 @@ Add books ~~~~~~~~~~~~~~~~~~ .. |adbi| image:: images/add_books.png -|adbi| The :guilabel:`Add books` action has three variations, accessed by the arrow next to the button. +|adbi| The :guilabel:`Add books` action has five variations, accessed by the clicking the down arrow on the right side of the button. 1. **Add books from a single directory**: Opens a file chooser dialog and allows you to specify which books in a directory should be added. This action is *context sensitive*, i.e. it depends on which :ref:`catalog ` you have selected. If you have selected the :guilabel:`Library`, books will be added to the library. If you have selected the ebook reader device, the books will be uploaded to the device, and so on. - 2. **Add books recursively (One book per directory)**: Allows you to choose a directory. The directory and all its sub-directories are scanned recursively and any ebooks found are added to the library.The algorithm assumes that each directory contains a single book. All ebook files in a directory are assumedto be the same book in different formats. This action is the inverse of the :ref:`Save to disk ` action, i.e. you can :guilabel:`Save to disk`, delete the books and re-add them with no lost information (except date). + 2. **Add books from directories, including sub-directories (One book per directory, assumes every ebook file is the same book in a different format)**: Allows you to choose a directory. The directory and all its sub-directories are scanned recursively and any ebooks found are added to the library. The algorithm assumes that each directory contains a single book. All ebook files in a directory are assumedto be the same book in different formats. This action is the inverse of the :ref:`Save to disk ` action, i.e. you can :guilabel:`Save to disk`, delete the books and re-add them with no lost information (except date). - 3. **Add books recursively (Multiple books per directory)**: Allows you to choose a directory. The directory and all its sub-directories are scanned recursively and any ebooks found are added to the library.The algorithm assumes that each directory contains many books. All ebook files with the same name in a directory are assumed to be the same book in different formats. This action is the inverse of the :ref:`Save to disk ` action, i.e. you can :guilabel:`Save to disk`, delete the books and re-add them with no lost information (except date). + 3. **Add books directories, including sub-directories (Multiple books per directory, assumes every ebook file is a different book)**: Allows you to choose a directory. The directory and all its sub-directories are scanned recursively and any ebooks found are added to the library. The algorithm assumes that each directory contains many books. All ebook files with the same name in a directory are assumed to be the same book in different formats. Ebooks with different names are added as different books. This action is the inverse of the :ref:`Save to disk ` action, i.e. you can :guilabel:`Save to disk`, delete the books and re-add them with no lost information (except date). + 4. **Add empty book. (Book Entry with blank formats)**: Allows you to create a blank book record. This can be used to then manually fill out the information about a book that you may not have yet in your collection. + + 5. **Add by ISBN**: Allows you to add one or more books by entering just their ISBN into a list or pasting the list of ISBNs from your clipboard. + +The :guilabel:`Add books` action can read metadata from a wide variety of e-book formats. In addition it tries to guess metadata from the filename. +See the :ref:`config_filename_metadata` section, to learn how to configure this. -The :guilabel:`Add books` action can read metadata from the following ebook formats: ``LRF, EPUB, LIT, MOBI, RTF, PDF, PRC, HTML``. In addition it tries to guess metadata from the filename. See the :ref:`config_filename_metadata` section, to learn how to configure this. - -To add a new format to an existing book, use the :ref:`edit_meta_information` action. - -.. _remove_books: - -Remove books -~~~~~~~~~~~~~~~~~~~~~ -.. |rbi| image:: images/remove_books.png - -|rbi| The :guilabel:`Remove books` action deletes books permanently, so use it with care. It is *context sensitive*, i.e. it depends on which :ref:`catalog ` you have selected. If you have selected the :guilabel:`Library`, books will be removed from the library. If you have selected the ebook reader device, the books will be removed from the device. To remove only a particular format for a given book use the :ref:`edit_meta_information` action. +To add an additional format for an existing book, use the :ref:`edit_meta_information` action. .. _edit_meta_information: -Edit meta information +Edit metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. |emii| image:: images/edit_meta_information.png -|emii| The :guilabel:`Edit meta information` action has two variations, accessed by the arrow next to the button. +|emii| The :guilabel:`Edit metadata` action has six variations, which can be accessed by clicking the down arrow on the right side of the button. 1. **Edit metadata individually**: This allows you to edit the metadata of books one-by-one, with the option of fetching metadata, including covers from the internet. It also allows you to add/remove particular ebook formats from a book. For more detail see :ref:`metadata`. - 2. **Edit metadata in bulk**: This allows you to edit common metadata fields for large numbers of books simulataneously. It operates on all the books you have selected in the :ref:`Library view `. + 3. **Download metadata and covers**: Downloads metadata and covers (if available), for the books that are selected in the book list. + 4. **Download only metadata**: Downloads only metadata (if available), for the books that are selected in the book list. + 5. **Download only covers**: Downloads only covers (if available), for the books that are selected in the book list. + 6. **Download only social metadata**: Downloads only social metadata such as tags and reviews (if available), for the books that are selected in the book list. + 7. **Merge Book Records**: Gives you the capability of merging the metadata and formats of two or more book records together. You can choose to either delete or keep the records that were not clicked first. -.. _send_to_device: - -Send to device -~~~~~~~~~~~~~~~~~~~~~~~~ -.. |stdi| image:: images/send_to_device.png - -|stdi| The :guilabel:`Send to device` action has two variations, accessed by the arrow next to the button. - - 1. **Send to main memory**: The selected books are transferred to the main memory of the ebook reader. - 2. **Send to card**: The selected books are transferred to the storage card on the ebook reader. - -You can control the file name and folder structure of files sent to the device by setting up a template in -:guilabel:`Preferences->Import/Export->Sending books to devices`. Also see :ref:`templatelangcalibre`. - -.. _save_to_disk: - -Save to disk -~~~~~~~~~~~~~~~~~~~~~~~~~ -.. |svdi| image:: images/save_to_disk.png - -|svdi| The :guilabel:`Save to disk` action has two variations, accessed by the arrow next to the button. - -.. _save_to_disk_multiple: - - 1. **Save to disk**: This will save the selected books to disk organized in directories. The directory structure looks like:: - - Author - Title - Book Files - -.. _save_to_disk_single: - - 2. **Save to disk in a single directory**: The selected books are saved to disk in a single directory. - -All available formats as well as metadata is stored to disk for each selected book. Metadata is stored in an OPF file. - -Saved books can be re-imported to the library without any loss of information by using the :ref:`Add books ` action. - -You can control the file name and folder structure of files saved to disk by setting up a template in -:guilabel:`Preferences->Import/Export->Saving books to disk`. Also see :ref:`templatelangcalibre`. - - -.. _fetch_news: - -Fetch news -~~~~~~~~~~~~~~~~~ -.. |fni| image:: images/fetch_news.png - -|fni| The :guilabel:`Fetch news` action downloads news from various websites and converts it into an ebook that can be read on your ebook reader. Normally, the newly created ebook is added to your ebook library, but if an ebook reader is connected at the time the download finishes, the news is uploaded to the reader directly. - -The :guilabel:`Fetch news` action uses simple recipes (10-15 lines of code) for each news site. To learn how to create recipes for your own news sources, see :ref:`news`. - + .. _convert_ebooks: Convert e-books ~~~~~~~~~~~~~~~~~~~~~~ .. |cei| image:: images/convert_ebooks.png -|cei| Ebooks can be converted from a number of formats into the LRF format (for the SONY Reader). Note that ebooks you purchase will typically have `Digital Rights Management `_ *(DRM)*. |app| will not convert these ebooks. For many DRM formats, it is easy to remove the DRM, but as this is illegal, you have to find tools to liberate your books yourself and then use |app| to convert them. +|cei| Ebooks can be converted from a number of formats into whatever format your e-book reader prefers. +Note that ebooks you purchase will typically have `Digital Rights Management `_ *(DRM)*. +|app| will not convert these ebooks. For many DRM formats, it is easy to remove the DRM, but as this may be illegal, +you have to find tools to liberate your books yourself and then use |app| to convert them. For most people, conversion should be a simple 1-click affair. But if you want to learn more about the conversion process, see :ref:`conversion`. @@ -141,29 +94,180 @@ The :guilabel:`Convert E-books` action has three variations, accessed by the arr 2. **Bulk convert**: This allows you to specify options only once to convert a number of ebooks in bulk. - 3. **Create catalog**: This action allows you to generate a complete listing with all metadata of the books in your library, in several formats, like XML, CSV, EPUB and MOBI. The catalog will contain all the books showing in the library view currently, so you can use the search features to limit the books to be catalogued. In addition, if you select multiple books using the mouse, only those books will be added to the catalog. If you generate the catalog in an e-book format such as EPUB or MOBI, the next time you connect your e-book reader, the catalog will be automatically sent to the device. For details on how catalogs work, see `here `_. - + 3. **Create catalog**: This action allows you to generate a complete listing with all metadata of the books in your library, + in several formats, like XML, CSV, BiBTeX, EPUB and MOBI. The catalog will contain all the books showing in the library view currently, + so you can use the search features to limit the books to be catalogued. In addition, if you select multiple books using the mouse, + only those books will be added to the catalog. If you generate the catalog in an e-book format such as EPUB or MOBI, + the next time you connect your e-book reader, the catalog will be automatically sent to the device. + For details on how catalogs work, see `here `. + .. _view: View ~~~~~~~~~~~ .. |vi| image:: images/view.png -|vi| The :guilabel:`View` action displays the book in an ebook viewer program. |app| has a builtin viewer for the LRF format. For other formats it uses the default operating system application. If a book has more than one format, you can view a particular format by clicking the arrow next to the :guilabel:`View` button. +|vi| The :guilabel:`View` action displays the book in an ebook viewer program. |app| has a builtin viewer for the most e-book formats. +For other formats it uses the default operating system application. You can configure which formats should open with the internal viewer via +Preferences->Behavior. If a book has more than one format, you can view a particular format by clicking the down arrow +on the right of the :guilabel:`View` button. + +.. _send_to_device: + +Send to device +~~~~~~~~~~~~~~~~~~~~~~~~ +.. |stdi| image:: images/send_to_device.png + +|stdi| The :guilabel:`Send to device` action has eight variations, accessed by clicking the down arrow on the right of the button. + + 1. **Send to main memory**: The selected books are transferred to the main memory of the ebook reader. + 2. **Send to card (A)**: The selected books are transferred to the storage card (A) on the ebook reader. + 3. **Send to card (B)**: The selected books are transferred to the storage card (B) on the ebook reader. + 4. **Send and delete from library>**: The selected books are transferred to the selected storage location on the device, and then **deleted** from the Library. + 5. **Send Specific format>**: The selected books are transferred to the selected storage location on the device, in the format that you specify. + 6. **Eject device**: The device is detached from |app|. + 7. **Set default send to device action>**: This action allows you to Specify which of the option 1) through 6) above will be the default action when you click the main button. + 8. **Fetch Annotations**: This is an experimental action which will transfer annotations you may have made on an ebook on your device, and add those annotations to the comments metadata of the book in the |app| library + +You can control the file name and folder structure of files sent to the device by setting up a template in +:guilabel:`Preferences->Import/Export->Sending books to devices`. Also see :ref:`templatelangcalibre`. + +.. _fetch_news: + +Fetch news +~~~~~~~~~~~~~~~~~ +.. |fni| image:: images/fetch_news.png + +|fni| The :guilabel:`Fetch news` action downloads news from various websites and converts it into an ebook that can be read on your ebook reader. Normally, the newly created ebook is added to your ebook library, but if an ebook reader is connected at the time the download finishes, the news is also uploaded to the reader automatically. + +The :guilabel:`Fetch news` action uses simple recipes (10-15 lines of code) for each news site. To learn how to create recipes for your own news sources, see :ref:`news`. + +The :guilabel:`Fetch news` action has three variations, accessed by clicking the down arrow on the right of the button. + + 1. **Schedule news download**: This action allows you to schedule the download of of your selected news sources from a list of hundreds of available. Scheduling can be set individually for each news source you select and the scheduling is flexible allowing you to select specific days of the week or a frequency of days between downloads. + 2. **Add a custom news service**: This action allows you to create a simple recipe for downloading news from a custom news site that you wish to access. Creating the recipe can be as simple as specifying an RSS news feed URL, or you can be more prescriptive by creating python based code for the task, see :ref:`news`. + 3. **Download all scheduled news sources**: This action causes |app| to immediately begin to download all news sources that you have previously scheduled. + + +.. _library: + +Library +~~~~~~~~~~~~~~~~~ +.. |lii| image:: images/library.png + +|lii| The :guilabel: `Library` action allows you to create, switch between, rename or delete a Library. |app| allows you to create as many libraries as you wish. You coudl for instance create a fiction library, a non fiction library, a foreign language library a project library, basically any structure that suits your needs. Libraries are the highest organizational structure within |app|, each library has its own set of books, tags, categories and base storage location. + + 1. **Switch\Create library..**: This action allows you to; a) connect to a pre-existing |app| library at another location from your currently open library, b) Create and empty library at a nw location or, c) Move the current Library to a newly specified location. + 2. **Quick Switch>**: This action allows you to switch between libraries that have been registered or created within |app|. + 3. **Rename Library>**: This action allows you to rename a Library. + 4. **Delete Library>**: This action allows you to **permanenetly delete** a Library. + 5. ****: Actions 5, 6 etc .. give you immediate switch access between multiple Libraries that you have created or attached to. + +.. _device: + +Device +~~~~~~~~~~~~~~~~~ +.. |dvi| image:: images/device.png + +|dvi| The :guilabel:`Device` action allows you to view the books in the main memory or storage cards of your device, or to eject the device (detach it from |app|). +This icon shows up automatically on the main |app| toolbar when you connect a supported device. You can click on it to see the books on your device. You can also drag and drop books from your |app| library onto the icon to transfer them to your device. Conversely, you can drag and drop books from your device onto the |app| icon on the toolbar to transfer books from your device to the |app| library. + + +.. _save_to_disk: + +Save to disk +~~~~~~~~~~~~~~~~~~~~~~~~~ +.. |svdi| image:: images/save_to_disk.png + +|svdi| The :guilabel:`Save to disk` action has five variations, accessed by the arrow next to the button. + +.. _save_to_disk_multiple: + + 1. **Save to disk**: This will save the selected books to disk organized in directories. The directory structure looks like:: + + Author_(sort) + Title + Book Files + + You can control the file name and folder structure of files saved to disk by setting up a template in + :guilabel:`Preferences->Import/Export->Saving books to disk`. Also see :ref:`templatelangcalibre`. + +.. _save_to_disk_single: + + 2. **Save to disk in a single directory**: The selected books are saved to disk in a single directory. + + For 1. and 2. All available formats as well as metadata is stored to disk for each selected book. Metadata is stored in an OPF file. + + Saved books can be re-imported to the library without any loss of information by using the :ref:`Add books ` action. + + 3. **Save only ** format to disk**: The selected books are saved to disk in the directory structure as shown in (1.) but only in your preferred ebook format you can set format in :guilabel:`Preferences->Behaviour->Preferred output format` + + 4. **Save only ** format to disk in a single directory**: The selected books are saved to disk in a single directory but only in ebook format you can set format in :guilabel:`Preferences->Behaviour->Preferred output format` + + 5. **Save single format to disk ..**: The selected books are saved to disk in the directory structure as shown in (1.) but only in the format you select from the pop-out list. There are currently 35 formats available and new ones are being added all the time. + +.. _connect_share: + +Connect/Share +~~~~~~~~~~~~~~~~~ +.. |csi| image:: images/connect_share.png + +|csi| The :guilabel:`Connect/Share` action allows you to manually connect to a device or folder on your computer, it also allows you to set up you |app| library for access via a web browser, or email. + + The :guilabel:`Connect/Share` action has four variations, accessed by clicking the down arrow on the right of the button. + + 1. **Connect to folder**: This action allows you to connect to any folder on your computer as though it were a device and use all the facilities |app| has for devices with that folder. Useful if your device cannot be supported by |app| but is available as a USB disk. + + 2. **Connect to iTunes**: Allows you to connect to your iTunes books database as though it were a device. Once the books are sent to iTunes, you can then use iTunes to make them available on your various iDevices. Useful if you would rather not have |app| send books to your iDevice directly. + + 3. **Start Content Server**: This action causes |app| to start up its built-in web server. When this is started, your |app| library will be accessible via a web browser from the internet (if you choose). You can configure how the web server is accessed by setting preferences at :guilabel:`Preferences->Sharing->Sharing over the net` + + 4. **Setup email based sharing of books**: This action allows you to setup |app| to share books (and news feeds) by email. After setting up email addresses for this option |app| will send news updates and book updates to the entered email addresses. You can configure how the |app| sends email by setting preferences at :guilabel:`Preferences->Sharing->Sharing books by email`. Once you have setup one or more email addresses, this menu entry get replaced by menu entries to send books to the setup email addresses. + +.. _remove_books: + +Remove books +~~~~~~~~~~~~~~~~~~~~~ +.. |rbi| image:: images/remove_books.png + +|rbi| The :guilabel:`Remove books` action **deletes books permanently**, so use it with care. It is *context sensitive*, i.e. it depends on which :ref:`catalog ` you have selected. If you have selected the :guilabel:`Library`, books will be removed from the library. If you have selected the ebook reader device, the books will be removed from the device. To remove only a particular format for a given book use the :ref:`edit_meta_information` action. Remove books also has five variations which can be accessed by clicking the down arrow on the right side of the button. + + 1. **Remove Selected Books**: Allows you to **permanently** remove all books that are selected in the book list. + + 2. **Remove files of a specified format from selected books..**: Allows you to **permanently** remove ebook files of a specified format, from books that are selected in the book list. + + 3. **Remove all files of a specified format, except..**: Allows you to **permanently** remove ebook files of a multiple formats except a given format, from books that are selected in the book list. + + 4. **Remove covers from selected books**: Allows you to **permanently** remove cover images files, from books that are selected in the book list. + + 5. **Remove matching books from device**: Allows you to remove ebook files from a connected device, that match the books that are selected in the book list. + +.. note:: + Note that when you use Remove books to delete books from your |app| library, the book record is permanently deleted, but, on (Windows and OS X) the files are placed into the recycle bin, so you can recover them if you change your mind. + +.. _configuration: + +Preferences +--------------- +.. |cbi| image:: images/preferences.png + +The Preferences Action allows you to change the way various aspects of |app| work. To access it, click the |cbi|. + .. _catalogs: Catalogs ---------- .. image:: images/catalogs.png -A *catalog* is a collection of books. |app| can manage three different catalogs: +A *catalog* is a collection of books. |app| can manage two types of different catalogs: - 1. **Library**: This is a collection of books stored in a database file on your computers harddisk. + 1. **Library**: This is a collection of books stored in your |app| library on your computer - 2. **Reader**: This is a collection of books stored in the main memory of your ebook reader. It will be available when you connect the reader to your computer. - - 3. **Card**: This is a collection of books stored on the storage card in your reader. + 2. **Device**: This is a collection of books stored in the main memory of your ebook reader. It will be available when you connect the reader to your computer. + - In addition, you can see the books on the storage card (if any) in your reader device. + +Many operations, like Adding books, deleting, viewing, etc. are context sensitive. So, for example, if you click the View button when you have the **Device** catalog selected, |app| will open the files on the device to view. If you have the **Library** catalog selected, files in your |app| library will be opened instead. .. _search_sort: @@ -274,14 +378,6 @@ Searching for ``no`` or ``unchecked`` will find all books with ``No`` in the col :guilabel:`Advanced Search Dialog` -You can test for the number of items in multiple-value columns, such as tags, formats, authors, and tags-like custom columns. This is done using a syntax very similar to numeric tests (discussed above), except that the relational operator begins with a ``#`` character. For example:: - - tags:#>3 will give you books with more than three tags - tags:#!=3 will give you books that do not have three tags - authors:#=1 will give you books with exactly one author - #cust:#<5 will give you books with less than five items in custom column #cust - formats:#>1 will give you books with more than one format - Saving searches ----------------- @@ -289,14 +385,6 @@ Saving searches Now, you can access your saved search in the Tag Browser under "Searches". A single click will allow you to re-use any arbitrarily complex search easily, without needing to re-create it. -.. _configuration: - -Preferences ---------------- -The Preferences dialog allows you to change the way various aspects of |app| work. To access it, click the |cbi|. - -.. |cbi| image:: images/configuration.png - .. _config_filename_metadata: Guessing metadata from file names diff --git a/src/calibre/manual/images/actions.png b/src/calibre/manual/images/actions.png index efee432da2..90f1ec4567 100644 Binary files a/src/calibre/manual/images/actions.png and b/src/calibre/manual/images/actions.png differ diff --git a/src/calibre/manual/images/add_books.png b/src/calibre/manual/images/add_books.png index 1a0b341bbd..624a5bf8a5 100644 Binary files a/src/calibre/manual/images/add_books.png and b/src/calibre/manual/images/add_books.png differ diff --git a/src/calibre/manual/images/auto_author_sort.png b/src/calibre/manual/images/auto_author_sort.png new file mode 100644 index 0000000000..9950b77c95 Binary files /dev/null and b/src/calibre/manual/images/auto_author_sort.png differ diff --git a/src/calibre/manual/images/catalogs.png b/src/calibre/manual/images/catalogs.png index 8e5ba480e3..49357d15b2 100644 Binary files a/src/calibre/manual/images/catalogs.png and b/src/calibre/manual/images/catalogs.png differ diff --git a/src/calibre/manual/images/connect_share.png b/src/calibre/manual/images/connect_share.png new file mode 100644 index 0000000000..0275089d1c Binary files /dev/null and b/src/calibre/manual/images/connect_share.png differ diff --git a/src/calibre/manual/images/convert_ebooks.png b/src/calibre/manual/images/convert_ebooks.png index e82725e170..2218a541b8 100644 Binary files a/src/calibre/manual/images/convert_ebooks.png and b/src/calibre/manual/images/convert_ebooks.png differ diff --git a/src/calibre/manual/images/device.png b/src/calibre/manual/images/device.png new file mode 100644 index 0000000000..ce16ea67b4 Binary files /dev/null and b/src/calibre/manual/images/device.png differ diff --git a/src/calibre/manual/images/edit_meta_information.png b/src/calibre/manual/images/edit_meta_information.png index 061653a60a..9f68050767 100644 Binary files a/src/calibre/manual/images/edit_meta_information.png and b/src/calibre/manual/images/edit_meta_information.png differ diff --git a/src/calibre/manual/images/fetch_news.png b/src/calibre/manual/images/fetch_news.png index f93108db49..a0116b15aa 100644 Binary files a/src/calibre/manual/images/fetch_news.png and b/src/calibre/manual/images/fetch_news.png differ diff --git a/src/calibre/manual/images/folder_device.png b/src/calibre/manual/images/folder_device.png new file mode 100644 index 0000000000..87b2d7862f Binary files /dev/null and b/src/calibre/manual/images/folder_device.png differ diff --git a/src/calibre/manual/images/jobs.png b/src/calibre/manual/images/jobs.png index ab0716af48..2c70a947d4 100644 Binary files a/src/calibre/manual/images/jobs.png and b/src/calibre/manual/images/jobs.png differ diff --git a/src/calibre/manual/images/library.png b/src/calibre/manual/images/library.png new file mode 100644 index 0000000000..781c87430f Binary files /dev/null and b/src/calibre/manual/images/library.png differ diff --git a/src/calibre/manual/images/preferences.png b/src/calibre/manual/images/preferences.png new file mode 100644 index 0000000000..ad939d2388 Binary files /dev/null and b/src/calibre/manual/images/preferences.png differ diff --git a/src/calibre/manual/images/remove_books.png b/src/calibre/manual/images/remove_books.png index 9d798394d9..065de14be5 100644 Binary files a/src/calibre/manual/images/remove_books.png and b/src/calibre/manual/images/remove_books.png differ diff --git a/src/calibre/manual/images/save_to_disk.png b/src/calibre/manual/images/save_to_disk.png index 74db6ba6b1..a4d3137349 100644 Binary files a/src/calibre/manual/images/save_to_disk.png and b/src/calibre/manual/images/save_to_disk.png differ diff --git a/src/calibre/manual/images/send_to_device.png b/src/calibre/manual/images/send_to_device.png index 1cc45f020f..ed325ed753 100644 Binary files a/src/calibre/manual/images/send_to_device.png and b/src/calibre/manual/images/send_to_device.png differ diff --git a/src/calibre/manual/images/show_tag_editor.png b/src/calibre/manual/images/show_tag_editor.png new file mode 100644 index 0000000000..55b7a855e4 Binary files /dev/null and b/src/calibre/manual/images/show_tag_editor.png differ diff --git a/src/calibre/manual/images/swap_title_author.png b/src/calibre/manual/images/swap_title_author.png new file mode 100644 index 0000000000..e4d7470a44 Binary files /dev/null and b/src/calibre/manual/images/swap_title_author.png differ diff --git a/src/calibre/manual/images/view.png b/src/calibre/manual/images/view.png index c16ec58bcf..7c3346383f 100644 Binary files a/src/calibre/manual/images/view.png and b/src/calibre/manual/images/view.png differ diff --git a/src/calibre/startup.py b/src/calibre/startup.py index e74660d0bc..9c9c7651b7 100644 --- a/src/calibre/startup.py +++ b/src/calibre/startup.py @@ -199,6 +199,11 @@ if not _run_once: __builtin__.__dict__['lopen'] = local_open + + import mimetypes + mimetypes.init([P('mime.types')]) + guess_type = mimetypes.guess_type + def test_lopen(): from calibre.ptempfile import TemporaryDirectory from calibre import CurrentDir diff --git a/src/calibre/web/feeds/recipes/model.py b/src/calibre/web/feeds/recipes/model.py index 469b7f17ad..559a5c08dd 100644 --- a/src/calibre/web/feeds/recipes/model.py +++ b/src/calibre/web/feeds/recipes/model.py @@ -9,7 +9,7 @@ __docformat__ = 'restructuredtext en' import os, copy from PyQt4.Qt import QAbstractItemModel, QVariant, Qt, QColor, QFont, QIcon, \ - QModelIndex, SIGNAL, QMetaObject, pyqtSlot + QModelIndex, QMetaObject, pyqtSlot, pyqtSignal from calibre.utils.search_query_parser import SearchQueryParser from calibre.gui2 import NONE @@ -120,6 +120,7 @@ class NewsItem(NewsTreeItem): class RecipeModel(QAbstractItemModel, SearchQueryParser): LOCATIONS = ['all'] + searched = pyqtSignal(object) def __init__(self, db, *args): QAbstractItemModel.__init__(self, *args) @@ -254,14 +255,17 @@ class RecipeModel(QAbstractItemModel, SearchQueryParser): return results def search(self, query): + results = [] try: - results = self.parse(unicode(query)) - if not results: - results = None + query = unicode(query).strip() + if query: + results = self.parse(query) + if not results: + results = None except ParseException: results = [] self.do_refresh(restrict_to_urns=results) - self.emit(SIGNAL('searched(PyQt_PyObject)'), True) + self.searched.emit(True) def columnCount(self, parent): return 1