Pull from trunk

This commit is contained in:
Kovid Goyal 2010-09-15 00:56:16 -06:00
commit 102126b613
16 changed files with 959 additions and 133 deletions

589
imgsrc/rating.svg Normal file
View File

@ -0,0 +1,589 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:i="http://ns.adobe.com/AdobeIllustrator/10.0/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://web.resource.org/cc/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="128"
height="128"
id="svg2"
sodipodi:version="0.32"
inkscape:version="0.45+devel"
version="1.0"
sodipodi:docbase="/Users/david/Progetti/oxygen-svn/theme/svg/actions"
sodipodi:docname="rating.svgz"
inkscape:output_extension="org.inkscape.output.svgz.inkscape"
inkscape:export-filename="/home/pinheiro/pics/oxygen/scalable/actions/rating.png"
inkscape:export-xdpi="11.25"
inkscape:export-ydpi="11.25">
<defs
id="defs4">
<linearGradient
id="linearGradient3946">
<stop
style="stop-color:#552b00;stop-opacity:1;"
offset="0"
id="stop3948" />
<stop
style="stop-color:#673400;stop-opacity:0;"
offset="1"
id="stop3950" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient3844">
<stop
style="stop-color:#faff64;stop-opacity:1;"
offset="0"
id="stop3846" />
<stop
style="stop-color:#faff64;stop-opacity:0;"
offset="1"
id="stop3848" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient3379">
<stop
style="stop-color:#fffc07;stop-opacity:1;"
offset="0"
id="stop3381" />
<stop
style="stop-color:#fffc07;stop-opacity:0;"
offset="1"
id="stop3383" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient3363">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop3365" />
<stop
style="stop-color:#ffffff;stop-opacity:0;"
offset="1"
id="stop3367" />
</linearGradient>
<linearGradient
id="linearGradient3309">
<stop
style="stop-color:#f8ff8a;stop-opacity:1"
offset="0"
id="stop3311" />
<stop
style="stop-color:#ffffff;stop-opacity:0;"
offset="1"
id="stop3313" />
</linearGradient>
<linearGradient
id="linearGradient26907"
gradientUnits="userSpaceOnUse"
x1="-84.002403"
y1="-383.9971"
x2="-12.0029"
y2="-383.9971"
gradientTransform="matrix(0,1,-1,0,-39.9985,140.0029)">
<stop
offset="0"
style="stop-color:#888a85;stop-opacity:1;"
id="stop26909" />
<stop
offset="1"
style="stop-color:#2e3436;stop-opacity:1;"
id="stop26911" />
</linearGradient>
<linearGradient
gradientTransform="matrix(0,1,-1,0,-39.9985,140.0029)"
y2="-383.9975"
x2="-23.516129"
y1="-383.9971"
x1="-84.002403"
gradientUnits="userSpaceOnUse"
id="linearGradient3711">
<stop
id="stop3713"
style="stop-color:white;stop-opacity:1;"
offset="0" />
<stop
id="stop3715"
style="stop-color:white;stop-opacity:0;"
offset="1" />
</linearGradient>
<linearGradient
id="linearGradient3081">
<stop
id="stop3083"
offset="0"
style="stop-color:#28691f;stop-opacity:1;" />
<stop
id="stop3085"
offset="1"
style="stop-color:#00bf00;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient3290">
<stop
style="stop-color:yellow;stop-opacity:1;"
offset="0"
id="stop3292" />
<stop
style="stop-color:#f07800;stop-opacity:1;"
offset="1"
id="stop3294" />
</linearGradient>
<linearGradient
id="linearGradient3638">
<stop
style="stop-color:#ffffff;stop-opacity:0;"
offset="0"
id="stop3640" />
<stop
id="stop3661"
offset="0.06868132"
style="stop-color:#ffffff;stop-opacity:1;" />
<stop
id="stop3659"
offset="0.5"
style="stop-color:#ffffff;stop-opacity:1;" />
<stop
style="stop-color:#ffffff;stop-opacity:0;"
offset="1"
id="stop3642" />
</linearGradient>
<linearGradient
id="linearGradient1563">
<stop
id="stop1565"
offset="0"
style="stop-color:#ffffff;stop-opacity:1;" />
<stop
id="stop1567"
offset="1"
style="stop-color:white;stop-opacity:0;" />
</linearGradient>
<linearGradient
id="linearGradient3273">
<stop
id="stop3275"
offset="0"
style="stop-color:#ffffff;stop-opacity:0.55035973;" />
<stop
id="stop3277"
offset="1"
style="stop-color:#ffffff;stop-opacity:0;" />
</linearGradient>
<linearGradient
id="linearGradient12948">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop12950" />
<stop
style="stop-color:#c0c0c0;stop-opacity:0;"
offset="1"
id="stop12952" />
</linearGradient>
<radialGradient
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1,0,0,0.111111,0,138.1081)"
r="64.796692"
fy="177.29686"
fx="80.738739"
cy="155.37218"
cx="80.738739"
id="radialGradient5079"
xlink:href="#linearGradient5073"
inkscape:collect="always" />
<linearGradient
id="linearGradient5073"
inkscape:collect="always">
<stop
id="stop5075"
offset="0"
style="stop-color:#000000;stop-opacity:1;" />
<stop
id="stop5077"
offset="1"
style="stop-color:#000000;stop-opacity:0;" />
</linearGradient>
<foreignObject
id="foreignObject7221"
height="1"
width="1"
y="0"
x="0"
requiredExtensions="http://ns.adobe.com/AdobeIllustrator/10.0/">
<i:pgfRef
xlink:href="#adobe_illustrator_pgf" />
</foreignObject>
<linearGradient
id="XMLID_1_"
gradientUnits="userSpaceOnUse"
x1="95.693398"
y1="141.1738"
x2="32.308601"
y2="77.789001">
<stop
offset="0"
style="stop-color:#ffd50a;stop-opacity:1;"
id="stop7227" />
<stop
offset="1"
style="stop-color:#8d4000;stop-opacity:1;"
id="stop7233" />
</linearGradient>
<linearGradient
id="XMLID_3_"
gradientUnits="userSpaceOnUse"
x1="63.9995"
y1="92.865196"
x2="63.9995"
y2="120.8652"
gradientTransform="translate(175.0067,11.74752)">
<stop
offset="0"
style="stop-color:#888A85"
id="stop7261" />
<stop
offset="0.3226"
style="stop-color:#A6A7A3"
id="stop7263" />
<stop
offset="1"
style="stop-color:#EEEEEC"
id="stop7265" />
</linearGradient>
<linearGradient
id="XMLID_4_"
gradientUnits="userSpaceOnUse"
x1="64.000504"
y1="108.8652"
x2="64.000504"
y2="92.865196">
<stop
offset="0"
style="stop-color:#EEEEEC"
id="stop7270" />
<stop
offset="1"
style="stop-color:#FFFFFF"
id="stop7272" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3081"
id="linearGradient2149"
gradientUnits="userSpaceOnUse"
x1="62.112335"
y1="90.513916"
x2="67.887672"
y2="39.095695" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient26907"
id="linearGradient3226"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0,1,-1,0,-39.9985,140.0029)"
x1="-70.002899"
y1="-383.9971"
x2="-11.91648"
y2="-383.9971" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3711"
id="radialGradient3228"
gradientUnits="userSpaceOnUse"
cx="343.99899"
cy="92"
fx="343.99899"
fy="92"
r="36" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3711"
id="linearGradient3230"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0,1.022977,-1.022977,0,111.9686,137.8125)"
x1="-88.058083"
y1="-131.93112"
x2="-45.096584"
y2="-131.93112" />
<linearGradient
inkscape:collect="always"
xlink:href="#XMLID_1_"
id="linearGradient2898"
x1="64.07962"
y1="-14.227339"
x2="64.07962"
y2="120.44466"
gradientUnits="userSpaceOnUse" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3290"
id="radialGradient2906"
cx="69.526619"
cy="60.115833"
fx="69.526619"
fy="89.655701"
r="111.65377"
gradientTransform="matrix(0.9439139,-0.3301918,0.332644,0.9509241,-16.097695,27.249949)"
gradientUnits="userSpaceOnUse" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3290"
id="radialGradient3304"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.5227399,0,-1.554444e-8,0.5266221,349.81061,60.575712)"
cx="69.526619"
cy="60.115833"
fx="69.526619"
fy="60.115833"
r="111.65377" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3309"
id="linearGradient3315"
x1="219.22163"
y1="11.902248"
x2="219.22163"
y2="136.85997"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(-170.08594,0)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient1563"
id="linearGradient3345"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(-37.771032,-0.1213203)"
x1="278.47162"
y1="77.652245"
x2="200.17728"
y2="31.10997" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3363"
id="linearGradient3369"
x1="177.42397"
y1="22.377773"
x2="177.60074"
y2="93.022789"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3379"
id="linearGradient3385"
x1="216.88614"
y1="122.5867"
x2="216.88614"
y2="37.969955"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(-152,0)" />
<filter
inkscape:collect="always"
id="filter3391">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.55939545"
id="feGaussianBlur3393" />
</filter>
<filter
inkscape:collect="always"
id="filter3401">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.11157909"
id="feGaussianBlur3403" />
</filter>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3363"
id="linearGradient3800"
x1="63.948792"
y1="12.034382"
x2="67.219337"
y2="12.034382"
gradientUnits="userSpaceOnUse"
spreadMethod="reflect" />
<filter
inkscape:collect="always"
id="filter3838"
x="-0.17816916"
width="1.3563383"
y="-0.15506857"
height="1.3101371">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.46259975"
id="feGaussianBlur3840" />
</filter>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3844"
id="linearGradient3850"
x1="28.637825"
y1="120.84999"
x2="31.289474"
y2="122.08743"
gradientUnits="userSpaceOnUse"
spreadMethod="reflect" />
<filter
inkscape:collect="always"
id="filter3928">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.18346262"
id="feGaussianBlur3930" />
</filter>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3844"
id="linearGradient3934"
gradientUnits="userSpaceOnUse"
spreadMethod="reflect"
x1="28.637825"
y1="120.84999"
x2="31.289474"
y2="122.08743" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3946"
id="radialGradient3956"
cx="64.07962"
cy="114.47154"
fx="64.07962"
fy="114.47154"
r="60.700505"
gradientTransform="matrix(0.2787307,0,0,0.2689969,46.218665,81.520439)"
gradientUnits="userSpaceOnUse" />
<filter
inkscape:collect="always"
id="filter3975">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="1.2948866"
id="feGaussianBlur3977" />
</filter>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.4142136"
inkscape:cx="-57.231582"
inkscape:cy="95.226607"
inkscape:document-units="px"
inkscape:current-layer="layer1"
inkscape:window-width="1247"
inkscape:window-height="816"
inkscape:window-x="388"
inkscape:window-y="110"
showgrid="true"
gridspacingx="4px"
gridspacingy="4px"
gridempspacing="0"
inkscape:grid-points="true">
<inkscape:grid
type="xygrid"
id="grid2302"
spacingx="4px"
spacingy="4px"
empspacing="2" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<path
id="path3961"
d="M 64.03125 8 C 56.162818 8.0100117 46.828561 34.554451 40.46875 39.1875 C 34.10894 43.820548 5.9844574 44.576082 3.5625 52.0625 C 1.1405426 59.548917 23.465249 76.613524 25.90625 84.09375 C 28.347251 91.57398 20.40967 118.5394 26.78125 123.15625 C 33.15283 127.7731 56.287818 111.82251 64.15625 111.8125 C 72.024682 111.80249 95.202691 127.69555 101.5625 123.0625 C 107.92231 118.42945 99.890544 91.486414 102.3125 84 C 104.73446 76.513583 127.03475 59.38648 124.59375 51.90625 C 122.15275 44.426021 94.027829 43.741849 87.65625 39.125 C 81.28467 34.508152 71.899685 7.9899879 64.03125 8 z M 64.03125 11.90625 C 64.208046 12.045423 65.56776 12.712264 67.15625 14.65625 C 68.97167 16.877947 71.031426 20.210059 73.0625 23.75 C 75.093573 27.28994 77.113982 31.048819 79.09375 34.3125 C 81.073519 37.576182 82.75512 40.328991 85.40625 42.25 C 88.057376 44.171009 91.18831 44.91637 94.90625 45.78125 C 98.624192 46.646129 102.81606 47.391152 106.8125 48.21875 C 110.80894 49.046347 114.60465 49.966787 117.28125 51 C 119.62327 51.904061 120.71845 53.000764 120.90625 53.125 C 120.82618 53.333062 120.57672 54.794782 119.21875 56.90625 C 117.66679 59.319356 115.1453 62.318181 112.40625 65.34375 C 109.66721 68.369316 106.71091 71.452346 104.21875 74.34375 C 101.72659 77.235155 99.632744 79.697501 98.625 82.8125 C 97.617256 85.927495 97.892393 89.134266 98.21875 92.9375 C 98.545107 96.740738 99.114622 100.97466 99.5625 105.03125 C 100.01038 109.08783 100.31178 112.97888 100.15625 115.84375 C 100.02016 118.35052 99.34151 119.69095 99.28125 119.90625 C 99.057443 119.89786 97.552762 120.17027 95.125 119.53125 C 92.350417 118.80093 88.723899 117.29504 85 115.625 C 81.276103 113.95497 77.426259 112.10169 73.90625 110.625 C 70.386242 109.1483 67.4302 107.93334 64.15625 107.9375 C 60.882303 107.94167 57.891241 109.1706 54.375 110.65625 C 50.858761 112.1419 47.032137 114.00799 43.3125 115.6875 C 39.592862 117.367 35.960216 118.85638 33.1875 119.59375 C 30.761373 120.23895 29.286908 119.99088 29.0625 120 C 29.004012 119.7864 28.29872 118.4439 28.15625 115.9375 C 27.993428 113.07303 28.281199 109.18271 28.71875 105.125 C 29.156299 101.0673 29.714573 96.835302 30.03125 93.03125 C 30.347928 89.227198 30.609418 85.987425 29.59375 82.875 C 28.578082 79.762573 26.468263 77.322553 23.96875 74.4375 C 21.469238 71.552452 18.527988 68.487339 15.78125 65.46875 C 13.034512 62.450158 10.495601 59.471649 8.9375 57.0625 C 7.5741618 54.954496 7.3592053 53.457399 7.28125 53.25 C 7.2962039 53.337785 8.2681026 52.126785 10.84375 51.125 C 13.517705 50.084977 17.34943 49.150265 21.34375 48.3125 C 25.33807 47.474737 29.534272 46.749339 33.25 45.875 C 36.96573 45.000663 40.103767 44.24025 42.75 42.3125 C 45.396234 40.384748 47.059794 37.612458 49.03125 34.34375 C 51.002705 31.075042 53.009191 27.326347 55.03125 23.78125 C 57.053308 20.236153 59.096493 16.88256 60.90625 14.65625 C 62.489787 12.708229 63.857465 12.044552 64.03125 11.90625 z "
style="opacity:1;fill:url(#linearGradient2898);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:14.80851269000000059;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1;filter:url(#filter3975)" />
<path
transform="matrix(0.4934214,0.1726044,-0.1726044,0.4934214,42.377875,49.908537)"
d="M 153.09403,94.713757 C 144.53658,107.09689 92.616372,93.013297 78.414631,98.001518 C 64.21289,102.98974 32.50348,146.4474 18.082028,142.13539 C 3.6605746,137.82337 1.0106378,84.092245 -8.1220219,72.127031 C -17.254681,60.161818 -68.384124,43.433534 -68.739625,28.385431 C -69.095125,13.337327 -18.812666,-5.7867426 -10.255219,-18.169872 C -1.697772,-30.553002 -1.5880954,-84.349316 12.613645,-89.337536 C 26.815387,-94.325757 60.541592,-52.41396 74.963045,-48.101941 C 89.384498,-43.789923 140.58172,-60.30959 149.71438,-48.344376 C 158.84704,-36.379162 129.40853,8.6478227 129.76403,23.695927 C 130.11953,38.74403 161.65148,82.330628 153.09403,94.713757 z"
inkscape:randomized="0"
inkscape:rounded="0.20136392"
inkscape:flatsided="false"
sodipodi:arg2="1.2330172"
sodipodi:arg1="0.60469864"
sodipodi:r2="76.832565"
sodipodi:r1="121.72647"
sodipodi:cy="25.510532"
sodipodi:cx="52.952892"
sodipodi:sides="5"
id="path3574"
style="opacity:1;fill:url(#radialGradient2906);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:14.80892944000000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
sodipodi:type="star" />
<path
style="opacity:1;fill:url(#linearGradient2898);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:14.80851269000000059;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
d="M 64.03125 8 C 56.162818 8.0100117 46.828561 34.554451 40.46875 39.1875 C 34.10894 43.820548 5.9844574 44.576082 3.5625 52.0625 C 1.1405426 59.548917 23.465249 76.613524 25.90625 84.09375 C 28.347251 91.57398 20.40967 118.5394 26.78125 123.15625 C 33.15283 127.7731 56.287818 111.82251 64.15625 111.8125 C 72.024682 111.80249 95.202691 127.69555 101.5625 123.0625 C 107.92231 118.42945 99.890544 91.486414 102.3125 84 C 104.73446 76.513583 127.03475 59.38648 124.59375 51.90625 C 122.15275 44.426021 94.027829 43.741849 87.65625 39.125 C 81.28467 34.508152 71.899685 7.9899879 64.03125 8 z M 64.03125 11.90625 C 64.208046 12.045423 65.56776 12.712264 67.15625 14.65625 C 68.97167 16.877947 71.031426 20.210059 73.0625 23.75 C 75.093573 27.28994 77.113982 31.048819 79.09375 34.3125 C 81.073519 37.576182 82.75512 40.328991 85.40625 42.25 C 88.057376 44.171009 91.18831 44.91637 94.90625 45.78125 C 98.624192 46.646129 102.81606 47.391152 106.8125 48.21875 C 110.80894 49.046347 114.60465 49.966787 117.28125 51 C 119.62327 51.904061 120.71845 53.000764 120.90625 53.125 C 120.82618 53.333062 120.57672 54.794782 119.21875 56.90625 C 117.66679 59.319356 115.1453 62.318181 112.40625 65.34375 C 109.66721 68.369316 106.71091 71.452346 104.21875 74.34375 C 101.72659 77.235155 99.632744 79.697501 98.625 82.8125 C 97.617256 85.927495 97.892393 89.134266 98.21875 92.9375 C 98.545107 96.740738 99.114622 100.97466 99.5625 105.03125 C 100.01038 109.08783 100.31178 112.97888 100.15625 115.84375 C 100.02016 118.35052 99.34151 119.69095 99.28125 119.90625 C 99.057443 119.89786 97.552762 120.17027 95.125 119.53125 C 92.350417 118.80093 88.723899 117.29504 85 115.625 C 81.276103 113.95497 77.426259 112.10169 73.90625 110.625 C 70.386242 109.1483 67.4302 107.93334 64.15625 107.9375 C 60.882303 107.94167 57.891241 109.1706 54.375 110.65625 C 50.858761 112.1419 47.032137 114.00799 43.3125 115.6875 C 39.592862 117.367 35.960216 118.85638 33.1875 119.59375 C 30.761373 120.23895 29.286908 119.99088 29.0625 120 C 29.004012 119.7864 28.29872 118.4439 28.15625 115.9375 C 27.993428 113.07303 28.281199 109.18271 28.71875 105.125 C 29.156299 101.0673 29.714573 96.835302 30.03125 93.03125 C 30.347928 89.227198 30.609418 85.987425 29.59375 82.875 C 28.578082 79.762573 26.468263 77.322553 23.96875 74.4375 C 21.469238 71.552452 18.527988 68.487339 15.78125 65.46875 C 13.034512 62.450158 10.495601 59.471649 8.9375 57.0625 C 7.5741618 54.954496 7.3592053 53.457399 7.28125 53.25 C 7.2962039 53.337785 8.2681026 52.126785 10.84375 51.125 C 13.517705 50.084977 17.34943 49.150265 21.34375 48.3125 C 25.33807 47.474737 29.534272 46.749339 33.25 45.875 C 36.96573 45.000663 40.103767 44.24025 42.75 42.3125 C 45.396234 40.384748 47.059794 37.612458 49.03125 34.34375 C 51.002705 31.075042 53.009191 27.326347 55.03125 23.78125 C 57.053308 20.236153 59.096493 16.88256 60.90625 14.65625 C 62.489787 12.708229 63.857465 12.044552 64.03125 11.90625 z "
id="path2304" />
<path
style="fill:url(#linearGradient3800);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter3838)"
d="M 60.98796,9.471226 C 62.846491,8.2143022 64.889907,8.0204702 67.219338,9.471226 L 64.037358,15.614216 L 60.98796,9.471226 z"
id="path3409"
sodipodi:nodetypes="cccc" />
<path
style="opacity:1;fill:url(#linearGradient3315);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:14.80892944;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
d="M 64.039064,11.90625 C 63.865274,12.044552 62.497594,12.708229 60.914064,14.65625 C 59.104304,16.88256 57.061124,20.236153 55.039064,23.78125 C 53.017004,27.326347 51.010514,31.075042 49.039064,34.34375 C 47.067604,37.612458 45.404044,40.384748 42.757814,42.3125 C 40.111574,44.24025 36.973544,45.000663 33.257814,45.875 C 29.542084,46.749339 25.345884,47.474737 21.351564,48.3125 C 17.357244,49.150265 13.525514,50.084977 10.851564,51.125 C 8.2759131,52.126785 7.3040131,53.337785 7.2890631,53.25 C 7.3670131,53.457399 7.5819731,54.954496 8.9453131,57.0625 C 10.503414,59.471649 13.042324,62.450158 15.789064,65.46875 C 18.535804,68.487339 21.477054,71.552452 23.976564,74.4375 C 26.476074,77.322553 28.585894,79.762573 29.601564,82.875 C 29.865144,83.682722 30.019904,84.511238 30.132814,85.34375 C 32.540654,85.431079 34.961934,85.5 37.414064,85.5 C 64.456484,85.5 88.974124,80.107134 106.91406,71.34375 C 108.71383,69.370041 110.60784,67.338911 112.41406,65.34375 C 115.15311,62.318181 117.67459,59.319356 119.22656,56.90625 C 120.58453,54.794782 120.83398,53.333062 120.91406,53.125 C 120.72626,53.000764 119.63107,51.904061 117.28906,51 C 114.61246,49.966787 110.81674,49.046347 106.82031,48.21875 C 102.82387,47.391152 98.631994,46.646129 94.914064,45.78125 C 91.196124,44.91637 88.065184,44.171009 85.414064,42.25 C 82.762934,40.328991 81.081334,37.576182 79.101564,34.3125 C 77.121794,31.048819 75.101384,27.28994 73.070314,23.75 C 71.039234,20.210059 68.979484,16.877947 67.164064,14.65625 C 65.575574,12.712264 64.215854,12.045423 64.039064,11.90625 z"
id="path2910" />
<g
id="g3339"
transform="translate(-132.29928,0)">
<path
id="path3317"
d="M 196.34375,11.90625 C 196.16996,12.044552 194.80228,12.708229 193.21875,14.65625 C 191.40899,16.88256 189.36581,20.236153 187.34375,23.78125 C 185.32169,27.326347 183.3152,31.075042 181.34375,34.34375 C 179.37229,37.612458 177.70873,40.384748 175.0625,42.3125 C 172.41626,44.24025 169.27823,45.000663 165.5625,45.875 C 161.84677,46.749339 157.65057,47.474737 153.65625,48.3125 C 149.66193,49.150265 145.8302,50.084977 143.15625,51.125 C 140.5806,52.126785 139.6087,53.337785 139.59375,53.25 C 139.62377,53.329884 139.71528,53.638731 139.84375,54.0625 C 140.2595,53.69998 141.25985,52.862595 143.15625,52.125 C 145.8302,51.084977 149.66193,50.150265 153.65625,49.3125 C 157.65057,48.474737 161.84677,47.749339 165.5625,46.875 C 169.27823,46.000663 172.41626,45.24025 175.0625,43.3125 C 177.70873,41.384748 179.37229,38.612458 181.34375,35.34375 C 183.3152,32.075042 185.32169,28.326347 187.34375,24.78125 C 189.36581,21.236153 191.40899,17.88256 193.21875,15.65625 C 194.80228,13.708229 196.16996,13.044552 196.34375,12.90625 C 196.52054,13.045423 197.88026,13.712264 199.46875,15.65625 C 201.28417,17.877947 203.34392,21.210059 205.375,24.75 C 207.40607,28.28994 209.42648,32.048819 211.40625,35.3125 C 213.38602,38.576182 215.06762,41.328991 217.71875,43.25 C 220.36987,45.171009 223.50081,45.91637 227.21875,46.78125 C 230.93668,47.646129 235.12856,48.391152 239.125,49.21875 C 243.12143,50.046347 246.91715,50.966787 249.59375,52 C 251.51448,52.74144 252.56925,53.579608 253,53.9375 C 253.13371,53.522484 253.18802,53.204851 253.21875,53.125 C 253.03095,53.000764 251.93576,51.904061 249.59375,51 C 246.91715,49.966787 243.12143,49.046347 239.125,48.21875 C 235.12856,47.391152 230.93668,46.646129 227.21875,45.78125 C 223.50081,44.91637 220.36987,44.171009 217.71875,42.25 C 215.06762,40.328991 213.38602,37.576182 211.40625,34.3125 C 209.42648,31.048819 207.40607,27.28994 205.375,23.75 C 203.34392,20.210059 201.28417,16.877947 199.46875,14.65625 C 197.88026,12.712264 196.52054,12.045423 196.34375,11.90625 z"
style="opacity:1;fill:url(#linearGradient3369);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:14.80892944000000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1" />
<path
sodipodi:nodetypes="cscsscsccscsscsc"
id="path3325"
d="M 246.78125,49.937636 C 247.42469,50.142466 248.03845,50.379526 248.59375,50.593886 C 250.93576,51.497946 252.03095,52.594656 252.21875,52.718886 C 252.13867,52.926956 251.88922,54.388676 250.53125,56.500136 C 248.97928,58.913246 246.4578,61.912066 243.71875,64.937636 C 241.91253,66.932796 240.01852,68.963926 238.21875,70.937636 C 220.27881,79.701026 195.76117,85.093886 168.71875,85.093886 C 166.59433,85.093886 164.49568,85.039506 162.40625,84.968886 C 162.4184,85.051736 162.42625,85.135936 162.4375,85.218886 C 164.84534,85.306216 167.26662,85.375136 169.71875,85.375136 C 196.76117,85.375136 221.27881,79.982276 239.21875,71.218886 C 241.01852,69.245176 242.91253,67.214046 244.71875,65.218886 C 247.4578,62.193316 249.97928,59.194496 251.53125,56.781386 C 252.88922,54.669926 253.13867,53.208206 253.21875,53.000136 C 253.03095,52.875906 251.93576,51.779196 249.59375,50.875136 C 248.75868,50.552786 247.80629,50.238636 246.78125,49.937636 z"
style="opacity:1;fill:url(#linearGradient3345);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:14.80892944;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1" />
</g>
<path
style="fill:url(#linearGradient3850);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;opacity:0.77153558000000000;filter:url(#filter3928)"
d="M 25.190679,119.77989 C 26.414679,122.74238 27.241162,124.11897 31.289475,123.31542 L 30.638356,120.21008 L 29.079766,120.3986 L 28.261711,118.57341 L 25.190679,119.77989 z"
id="path3842"
sodipodi:nodetypes="cccccc" />
<path
style="opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient3385);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1;filter:url(#filter3391)"
d="M 64.125001,11.90625 C 63.951211,12.044552 62.583531,12.708229 61.000001,14.65625 C 59.190241,16.88256 57.147061,20.236153 55.125001,23.78125 C 53.102941,27.326347 51.096451,31.075042 49.125001,34.34375 C 47.153541,37.612458 45.489981,40.384748 42.843751,42.3125 C 40.197511,44.24025 37.059481,45.000663 33.343751,45.875 C 29.628021,46.749339 25.431821,47.474737 21.437501,48.3125 C 17.443181,49.150265 13.611451,50.084977 10.937501,51.125 C 8.3618506,52.126785 7.3899506,53.337785 7.3750006,53.25 C 7.4529506,53.457399 7.6679106,54.954496 9.0312506,57.0625 C 10.589351,59.471649 13.128261,62.450158 15.875001,65.46875 C 18.621741,68.487339 21.562991,71.552452 24.062501,74.4375 C 26.562011,77.322553 28.671831,79.762573 29.687501,82.875 C 30.703171,85.987425 30.441681,89.227198 30.125001,93.03125 C 29.808321,96.835302 29.250051,101.0673 28.812501,105.125 C 28.374951,109.18271 28.087181,113.07303 28.250001,115.9375 C 28.392471,118.4439 29.097761,119.7864 29.156251,120 C 29.380661,119.99088 30.855121,120.23895 33.281251,119.59375 C 36.053961,118.85638 39.686611,117.367 43.406251,115.6875 C 47.125881,114.00799 50.952511,112.1419 54.468751,110.65625 C 57.984991,109.1706 60.976051,107.94167 64.250001,107.9375 C 67.523951,107.93334 70.479991,109.1483 74.000001,110.625 C 77.520011,112.10169 81.369851,113.95497 85.093751,115.625 C 88.817651,117.29504 92.444151,118.80093 95.218751,119.53125 C 97.646511,120.17027 99.151181,119.89786 99.375001,119.90625 C 99.435261,119.69095 100.1139,118.35052 100.25,115.84375 C 100.40553,112.97888 100.10412,109.08783 99.656251,105.03125 C 99.208371,100.97466 98.638841,96.740738 98.312501,92.9375 C 97.986141,89.134266 97.710991,85.927495 98.718751,82.8125 C 99.726491,79.697501 101.82033,77.235155 104.3125,74.34375 C 106.80466,71.452346 109.76095,68.369316 112.5,65.34375 C 115.23905,62.318181 117.76053,59.319356 119.3125,56.90625 C 120.67047,54.794782 120.91992,53.333062 121,53.125 C 120.8122,53.000764 119.71701,51.904061 117.375,51 C 114.6984,49.966787 110.90268,49.046347 106.90625,48.21875 C 102.90981,47.391152 98.717931,46.646129 95.000001,45.78125 C 91.282061,44.91637 88.151121,44.171009 85.500001,42.25 C 82.848871,40.328991 81.167271,37.576182 79.187501,34.3125 C 77.207731,31.048819 75.187321,27.28994 73.156251,23.75 C 71.125171,20.210059 69.065421,16.877947 67.250001,14.65625 C 65.661511,12.712264 64.301791,12.045423 64.125001,11.90625 z"
id="path3375"
sodipodi:nodetypes="cssssssssssssssscssssssscssssssscsssssssc" />
<path
sodipodi:nodetypes="cssssssssssssssscssssssscssssssscsssssssc"
id="path3395"
d="M 64.125001,11.90625 C 63.951211,12.044552 62.583531,12.708229 61.000001,14.65625 C 59.190241,16.88256 57.147061,20.236153 55.125001,23.78125 C 53.102941,27.326347 51.096451,31.075042 49.125001,34.34375 C 47.153541,37.612458 45.489981,40.384748 42.843751,42.3125 C 40.197511,44.24025 37.059481,45.000663 33.343751,45.875 C 29.628021,46.749339 25.431821,47.474737 21.437501,48.3125 C 17.443181,49.150265 13.611451,50.084977 10.937501,51.125 C 8.3618506,52.126785 7.3899506,53.337785 7.3750006,53.25 C 7.4529506,53.457399 7.6679106,54.954496 9.0312506,57.0625 C 10.589351,59.471649 13.128261,62.450158 15.875001,65.46875 C 18.621741,68.487339 21.562991,71.552452 24.062501,74.4375 C 26.562011,77.322553 28.671831,79.762573 29.687501,82.875 C 30.703171,85.987425 30.441681,89.227198 30.125001,93.03125 C 29.808321,96.835302 29.250051,101.0673 28.812501,105.125 C 28.374951,109.18271 28.087181,113.07303 28.250001,115.9375 C 28.392471,118.4439 29.097761,119.7864 29.156251,120 C 29.380661,119.99088 30.855121,120.23895 33.281251,119.59375 C 36.053961,118.85638 39.686611,117.367 43.406251,115.6875 C 47.125881,114.00799 50.952511,112.1419 54.468751,110.65625 C 57.984991,109.1706 60.976051,107.94167 64.250001,107.9375 C 67.523951,107.93334 70.479991,109.1483 74.000001,110.625 C 77.520011,112.10169 81.369851,113.95497 85.093751,115.625 C 88.817651,117.29504 92.444151,118.80093 95.218751,119.53125 C 97.646511,120.17027 99.151181,119.89786 99.375001,119.90625 C 99.435261,119.69095 100.1139,118.35052 100.25,115.84375 C 100.40553,112.97888 100.10412,109.08783 99.656251,105.03125 C 99.208371,100.97466 98.638841,96.740738 98.312501,92.9375 C 97.986141,89.134266 97.710991,85.927495 98.718751,82.8125 C 99.726491,79.697501 101.82033,77.235155 104.3125,74.34375 C 106.80466,71.452346 109.76095,68.369316 112.5,65.34375 C 115.23905,62.318181 117.76053,59.319356 119.3125,56.90625 C 120.67047,54.794782 120.91992,53.333062 121,53.125 C 120.8122,53.000764 119.71701,51.904061 117.375,51 C 114.6984,49.966787 110.90268,49.046347 106.90625,48.21875 C 102.90981,47.391152 98.717931,46.646129 95.000001,45.78125 C 91.282061,44.91637 88.151121,44.171009 85.500001,42.25 C 82.848871,40.328991 81.167271,37.576182 79.187501,34.3125 C 77.207731,31.048819 75.187321,27.28994 73.156251,23.75 C 71.125171,20.210059 69.065421,16.877947 67.250001,14.65625 C 65.661511,12.712264 64.301791,12.045423 64.125001,11.90625 z"
style="opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient3385);stroke-width:0.6;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1;filter:url(#filter3401)" />
<path
sodipodi:nodetypes="cccccc"
id="path3932"
d="M 25.190679,119.77989 C 26.414679,122.74238 27.241162,124.11897 31.289475,123.31542 L 30.638356,120.21008 L 29.079766,120.3986 L 28.261711,118.57341 L 25.190679,119.77989 z"
style="opacity:0.7715356;fill:url(#linearGradient3934);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter3928)"
transform="matrix(-1,0,0,1,128.10515,0)" />
<path
style="opacity:1;fill:url(#radialGradient3956);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:14.80851269000000059;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
d="M 26.03125 94.25 C 24.983755 105.1142 22.21942 119.85075 26.78125 123.15625 C 33.15283 127.7731 56.287818 111.82251 64.15625 111.8125 C 72.024682 111.80249 95.202691 127.69555 101.5625 123.0625 C 106.10279 119.75495 103.30815 105.10184 102.21875 94.25 L 98.34375 94.25 C 98.677864 97.707156 99.164649 101.42777 99.5625 105.03125 C 100.01038 109.08783 100.31178 112.97888 100.15625 115.84375 C 100.02016 118.35052 99.34151 119.69095 99.28125 119.90625 C 99.057443 119.89786 97.552762 120.17027 95.125 119.53125 C 92.350417 118.80093 88.723899 117.29504 85 115.625 C 81.276103 113.95497 77.426259 112.10169 73.90625 110.625 C 70.386242 109.1483 67.4302 107.93334 64.15625 107.9375 C 60.882303 107.94167 57.891241 109.1706 54.375 110.65625 C 50.858761 112.1419 47.032137 114.00799 43.3125 115.6875 C 39.592862 117.367 35.960216 118.85638 33.1875 119.59375 C 30.761373 120.23895 29.286908 119.99088 29.0625 120 C 29.004012 119.7864 28.29872 118.4439 28.15625 115.9375 C 27.993428 113.07303 28.281199 109.18271 28.71875 105.125 C 29.110886 101.48845 29.580993 97.733027 29.90625 94.25 L 26.03125 94.25 z "
id="path3936" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 36 KiB

BIN
resources/images/rating.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,116 @@
/*
** Book Jacket generation
**
** The template for Book Jackets is template.xhtml
** This CSS is inserted into the generated HTML at conversion time
**
** Users can control parts of the presentation of a generated book jacket by
** editing this file and template.xhtml
**
** The general form of a generated Book Jacket:
**
** Title
** Series: series [series_index]
** Published: year_of_publication
** Rating: #_of_stars
** Tags: tag1, tag2, tag3 ...
**
** Comments
**
** If a book does not have Series information, a date of publication, a rating or tags
** the corresponding row is automatically removed from the generated book jacket.
*/
/*
** Banner
** Only affects EPUB, kindle ignores this type of formatting
*/
.cbj_banner {
background: #eee;
border: thin solid black;
margin: 1em;
padding: 1em;
-webkit-border-radius:8px;
}
/*
** Title
*/
.cbj_title {
font-size: x-large;
text-align: center;
}
/*
** Table containing Series, Publication Year, Rating and Tags
*/
table.cbj_header {
width: 100%;
}
/*
** General formatting for banner labels
*/
table.cbj_header td.cbj_label {
font-family: sans-serif;
font-weight: bold;
text-align: right;
width: 40%;
}
/*
** General formatting for banner content
*/
table.cbj_header td.cbj_content {
font-family: sans-serif;
text-align: left;
width:60%;
}
/*
** To skip a banner item (Series|Published|Rating|Tags),
** edit the appropriate CSS rule below.
*/
table.cbj_header tr.cbj_series {
/* Uncomment the next line to remove 'Series' from banner section */
/* display:none; */
}
table.cbj_header tr.cbj_pubdate {
/* Uncomment the next line to remove 'Published' from banner section */
/* display:none; */
}
table.cbj_header tr.cbj_rating {
/* Uncomment the next line to remove 'Rating' from banner section */
/* display:none; */
}
table.cbj_header tr.cbj_tags {
/* Uncomment the next line to remove 'Tags' from banner section */
/* display:none; */
}
hr {
/* This rule controls formatting for any hr elements contained in the jacket */
border-top: 0px solid white;
border-right: 0px solid white;
border-bottom: 2px solid black;
border-left: 0px solid white;
margin-left: 10%;
width: 80%;
}
.cbj_footer {
font-family: sans-serif;
font-size: small;
margin-top: 8px;
text-align: center;
}
.cbj_smallcaps {
font-size: 90%;
}
.cbj_comments {
font-family: sans-serif;
}

View File

@ -0,0 +1,34 @@
<html xmlns="{xmlns}">
<head>
<title>{title_str}</title>
<meta name="calibre-content" content="jacket"/>
<style type="text/css" media="screen">{css}</style>
</head>
<body>
<div class="cbj_banner">
<div class="cbj_title">{title}</div>
<table class="cbj_header">
<tr class="cbj_series">
<td class="cbj_label">{series_label}:</td>
<td class="cbj_content">{series}</td>
</tr>
<tr class="cbj_pubdate">
<td class="cbj_label">{pubdate_label}:</td>
<td class="cbj_content">{pubdate}</td>
</tr>
<tr class="cbj_rating">
<td class="cbj_label">{rating_label}:</td>
<td class="cbj_content">{rating}</td>
</tr>
<tr class="cbj_tags">
<td class="cbj_label">{tags_label}:</td>
<td class="cbj_content">{tags}</td>
</tr>
</table>
<div class="cbj_footer">{footer}</div>
</div>
<hr class="cbj_kindle_banner_hr" />
<div class="cbj_comments">{comments}</div>
</body>
</html>

View File

@ -27,9 +27,6 @@ class PeriodicalNameHere(BasicNewsRecipe):
encoding = None encoding = None
language = 'en' language = 'en'
# Method variables for customizing feed parsing # Method variables for customizing feed parsing
summary_length = 250 summary_length = 250
use_embedded_content = None use_embedded_content = None
@ -45,13 +42,26 @@ class PeriodicalNameHere(BasicNewsRecipe):
match_regexps = [] match_regexps = []
# The second entry is for 'Big Money', which comes from a different site, uses different markup # The second entry is for 'Big Money', which comes from a different site, uses different markup
keep_only_tags = [dict(attrs={ 'id':['article_top', 'article_body']}), keep_only_tags = [dict(attrs={ 'id':['article_top', 'article_body', 'story']}),
dict(attrs={ 'id':['content']}) ] dict(attrs={ 'id':['content']}) ]
# The second entry is for 'Big Money', which comes from a different site, uses different markup # The second entry is for 'Big Money', which comes from a different site, uses different markup
remove_tags = [dict(attrs={ 'id':['toolbox','recommend_tab','insider_ad_wrapper', remove_tags = [dict(attrs={ 'id':[
'article_bottom_tools_cntr','fray_article_discussion', 'fray_article_links','bottom_sponsored_links','author_bio', 'add_comments_button',
'bizbox_links_bottom','ris_links_wrapper','BOXXLE']}), 'article_bottom_tools',
'article_bottom_tools_cntr',
'bizbox_links_bottom',
'BOXXLE',
'comments_button',
'comments-to-fray',
'fbog_article_bottom_cntr',
'fray_article_discussion', 'fray_article_links','bottom_sponsored_links','author_bio',
'insider_ad_wrapper',
'js_kit_cntr',
'recommend_tab',
'ris_links_wrapper',
'toolbox',
]}),
dict(attrs={ 'id':['content-top','service-links-bottom','hed']}) ] dict(attrs={ 'id':['content-top','service-links-bottom','hed']}) ]
excludedDescriptionKeywords = ['Slate V','Twitter feed','podcast'] excludedDescriptionKeywords = ['Slate V','Twitter feed','podcast']
@ -339,8 +349,8 @@ class PeriodicalNameHere(BasicNewsRecipe):
# Change <h1> to <h2> # Change <h1> to <h2>
headline = soup.find("h1") headline = soup.find("h1")
tag = headline.find("span") #tag = headline.find("span")
tag.name = 'div' #tag.name = 'div'
if headline is not None : if headline is not None :
h2tag = Tag(soup, "h2") h2tag = Tag(soup, "h2")

View File

@ -2343,8 +2343,10 @@ class ITUNES(DriverBase):
if isosx: if isosx:
if DEBUG: if DEBUG:
self.log.info(" deleting '%s' from iDevice" % cached_book['title']) self.log.info(" deleting '%s' from iDevice" % cached_book['title'])
cached_book['dev_book'].delete() try:
cached_book['dev_book'].delete()
except:
self.log.error(" error deleting '%s'" % cached_book['title'])
elif iswindows: elif iswindows:
hit = self._find_device_book(cached_book) hit = self._find_device_book(cached_book)
if hit: if hit:

View File

@ -36,15 +36,15 @@ class PRS505(USBMS):
VENDOR_NAME = 'SONY' VENDOR_NAME = 'SONY'
WINDOWS_MAIN_MEM = re.compile( WINDOWS_MAIN_MEM = re.compile(
r'(PRS-(505|300|500))|' r'(PRS-(505|300|500))|'
r'(PRS-((700[#/])|((6|9)00&)))' r'(PRS-((700[#/])|((6|9|3)(0|5)0&)))'
) )
WINDOWS_CARD_A_MEM = re.compile( WINDOWS_CARD_A_MEM = re.compile(
r'(PRS-(505|500)[#/]\S+:MS)|' r'(PRS-(505|500)[#/]\S+:MS)|'
r'(PRS-((700[/#]\S+:)|((6|9)00[#_]))MS)' r'(PRS-((700[/#]\S+:)|((6|9)(0|5)0[#_]))MS)'
) )
WINDOWS_CARD_B_MEM = re.compile( WINDOWS_CARD_B_MEM = re.compile(
r'(PRS-(505|500)[#/]\S+:SD)|' r'(PRS-(505|500)[#/]\S+:SD)|'
r'(PRS-((700[/#]\S+:)|((6|9)00[#_]))SD)' r'(PRS-((700[/#]\S+:)|((6|9)(0|5)0[#_]))SD)'
) )

View File

@ -28,6 +28,9 @@ class FB2Output(OutputFormatPlugin):
]) ])
def convert(self, oeb_book, output_path, input_plugin, opts, log): def convert(self, oeb_book, output_path, input_plugin, opts, log):
from calibre.ebooks.oeb.transforms.jacket import linearize_jacket
linearize_jacket(oeb_book)
fb2mlizer = FB2MLizer(log) fb2mlizer = FB2MLizer(log)
fb2_content = fb2mlizer.extract_content(oeb_book, opts) fb2_content = fb2mlizer.extract_content(oeb_book, opts)

View File

@ -99,7 +99,8 @@ class CoverManager(object):
series_string = None series_string = None
if m.series and m.series_index: if m.series and m.series_index:
series_string = _('Book %s of %s')%( series_string = _('Book %s of %s')%(
fmt_sidx(m.series_index[0], use_roman=True), m.series[0]) fmt_sidx(m.series_index[0], use_roman=True),
unicode(m.series[0]))
try: try:
from calibre.ebooks import calibre_cover from calibre.ebooks import calibre_cover

View File

@ -147,7 +147,6 @@ class CSSFlattener(object):
extra_css=css) extra_css=css)
self.stylizers[item] = stylizer self.stylizers[item] = stylizer
def baseline_node(self, node, stylizer, sizes, csize): def baseline_node(self, node, stylizer, sizes, csize):
csize = stylizer.style(node)['font-size'] csize = stylizer.style(node)['font-size']
if node.text: if node.text:
@ -195,7 +194,7 @@ class CSSFlattener(object):
value = 0.0 value = 0.0
cssdict[property] = "%0.5fem" % (value / fsize) cssdict[property] = "%0.5fem" % (value / fsize)
def flatten_node(self, node, stylizer, names, styles, psize, left=0): def flatten_node(self, node, stylizer, names, styles, psize, item_id, left=0):
if not isinstance(node.tag, basestring) \ if not isinstance(node.tag, basestring) \
or namespace(node.tag) != XHTML_NS: or namespace(node.tag) != XHTML_NS:
return return
@ -287,15 +286,18 @@ class CSSFlattener(object):
if self.lineh and 'line-height' not in cssdict: if self.lineh and 'line-height' not in cssdict:
lineh = self.lineh / psize lineh = self.lineh / psize
cssdict['line-height'] = "%0.5fem" % lineh cssdict['line-height'] = "%0.5fem" % lineh
if (self.context.remove_paragraph_spacing or if (self.context.remove_paragraph_spacing or
self.context.insert_blank_line) and tag in ('p', 'div'): self.context.insert_blank_line) and tag in ('p', 'div'):
for prop in ('margin', 'padding', 'border'): if item_id != 'calibre_jacket' or self.context.output_profile.name == 'Kindle':
for edge in ('top', 'bottom'): for prop in ('margin', 'padding', 'border'):
cssdict['%s-%s'%(prop, edge)] = '0pt' for edge in ('top', 'bottom'):
cssdict['%s-%s'%(prop, edge)] = '0pt'
if self.context.insert_blank_line: if self.context.insert_blank_line:
cssdict['margin-top'] = cssdict['margin-bottom'] = '0.5em' cssdict['margin-top'] = cssdict['margin-bottom'] = '0.5em'
if self.context.remove_paragraph_spacing: if self.context.remove_paragraph_spacing:
cssdict['text-indent'] = "%1.1fem" % self.context.remove_paragraph_spacing_indent_size cssdict['text-indent'] = "%1.1fem" % self.context.remove_paragraph_spacing_indent_size
if cssdict: if cssdict:
items = cssdict.items() items = cssdict.items()
items.sort() items.sort()
@ -314,7 +316,7 @@ class CSSFlattener(object):
if 'style' in node.attrib: if 'style' in node.attrib:
del node.attrib['style'] del node.attrib['style']
for child in node: for child in node:
self.flatten_node(child, stylizer, names, styles, psize, left) self.flatten_node(child, stylizer, names, styles, psize, item_id, left)
def flatten_head(self, item, stylizer, href): def flatten_head(self, item, stylizer, href):
html = item.data html = item.data
@ -361,7 +363,7 @@ class CSSFlattener(object):
stylizer = self.stylizers[item] stylizer = self.stylizers[item]
body = html.find(XHTML('body')) body = html.find(XHTML('body'))
fsize = self.context.dest.fbase fsize = self.context.dest.fbase
self.flatten_node(body, stylizer, names, styles, fsize) self.flatten_node(body, stylizer, names, styles, fsize, item.id)
items = [(key, val) for (val, key) in styles.items()] items = [(key, val) for (val, key) in styles.items()]
items.sort() items.sort()
css = ''.join(".%s {\n%s;\n}\n\n" % (key, val) for key, val in items) css = ''.join(".%s {\n%s;\n}\n\n" % (key, val) for key, val in items)

View File

@ -6,139 +6,200 @@ __license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>' __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en' __docformat__ = 'restructuredtext en'
import textwrap import sys
from xml.sax.saxutils import escape from xml.sax.saxutils import escape
from itertools import repeat
from lxml import etree from lxml import etree
from calibre.ebooks.oeb.base import XPath, XPNSMAP from calibre import guess_type, strftime
from calibre import guess_type from calibre.ebooks.BeautifulSoup import BeautifulSoup
from calibre.ebooks.oeb.base import XPath, XHTML_NS, XHTML
from calibre.library.comments import comments_to_html from calibre.library.comments import comments_to_html
JACKET_XPATH = '//h:meta[@name="calibre-content" and @content="jacket"]'
class Jacket(object): class Jacket(object):
''' '''
Book jacket manipulation. Remove first image and insert comments at start of Book jacket manipulation. Remove first image and insert comments at start of
book. book.
''' '''
JACKET_TEMPLATE = textwrap.dedent(u'''\ def remove_images(self, item, limit=1):
<html xmlns="%(xmlns)s"> path = XPath('//h:img[@src]')
<head> removed = 0
<title>%(title)s</title> for img in path(item.data):
<meta name="calibre-content" content="jacket"/> if removed >= limit:
</head> break
<body> href = item.abshref(img.get('src'))
<div class="calibre_rescale_100"> image = self.oeb.manifest.hrefs.get(href, None)
<div style="text-align:center"> if image is not None:
<h1 class="calibre_rescale_180">%(title)s</h1> self.oeb.manifest.remove(image)
<h2 class="calibre_rescale_140">%(jacket)s</h2> img.getparent().remove(img)
<div class="calibre_rescale_100">%(series)s</div> removed += 1
<div class="calibre_rescale_100">%(rating)s</div> return removed
<div class="calibre_rescale_100">%(tags)s</div>
</div>
<div style="margin-top:2em" class="calibre_rescale_100">
%(comments)s
</div>
</div>
</body>
</html>
''')
def remove_first_image(self): def remove_first_image(self):
path = XPath('//h:img[@src]') for item in self.oeb.spine:
for i, item in enumerate(self.oeb.spine): removed = self.remove_images(item)
if i > 2: break if removed > 0:
for img in path(item.data): self.log('Removed first image')
href = item.abshref(img.get('src')) break
image = self.oeb.manifest.hrefs.get(href, None)
if image is not None:
self.log('Removing first image', img.get('src'))
self.oeb.manifest.remove(image)
img.getparent().remove(img)
return
def get_rating(self, rating):
ans = ''
if rating is None:
return
try:
num = float(rating)/2
except:
return ans
num = max(0, num)
num = min(num, 5)
if num < 1:
return ans
id, href = self.oeb.manifest.generate('star', 'star.png')
self.oeb.manifest.add(id, href, 'image/png', data=I('star.png', data=True))
ans = 'Rating: ' + ''.join(repeat('<img style="vertical-align:text-top" alt="star" src="%s" />'%href, num))
return ans
def insert_metadata(self, mi): def insert_metadata(self, mi):
self.log('Inserting metadata into book...') self.log('Inserting metadata into book...')
comments = mi.comments
if not comments:
try:
comments = unicode(self.oeb.metadata.description[0])
except:
comments = ''
if not comments.strip():
comments = ''
orig_comments = comments
if comments:
comments = comments_to_html(comments)
series = '<b>Series: </b>' + escape(mi.series if mi.series else '')
if mi.series and mi.series_index is not None:
series += escape(' [%s]'%mi.format_series_index())
if not mi.series:
series = ''
tags = mi.tags
if not tags:
try:
tags = map(unicode, self.oeb.metadata.subject)
except:
tags = []
if tags:
tags = '<b>Tags: </b>' + self.opts.dest.tags_to_string(tags)
else:
tags = ''
try: try:
title = mi.title if mi.title else unicode(self.oeb.metadata.title[0]) tags = map(unicode, self.oeb.metadata.subject)
except:
tags = []
try:
comments = unicode(self.oeb.metadata.description[0])
except:
comments = ''
try:
title = unicode(self.oeb.metadata.title[0])
except: except:
title = _('Unknown') title = _('Unknown')
def generate_html(comments): root = render_jacket(mi, self.opts.output_profile,
return self.JACKET_TEMPLATE%dict(xmlns=XPNSMAP['h'], alt_title=title, alt_tags=tags,
title=escape(title), comments=comments, alt_comments=comments)
jacket=escape(_('Book Jacket')), series=series, id, href = self.oeb.manifest.generate('calibre_jacket', 'jacket.xhtml')
tags=tags, rating=self.get_rating(mi.rating))
id, href = self.oeb.manifest.generate('jacket', 'jacket.xhtml')
from calibre.ebooks.oeb.base import RECOVER_PARSER, XPath
try:
root = etree.fromstring(generate_html(comments), parser=RECOVER_PARSER)
except:
root = etree.fromstring(generate_html(escape(orig_comments)),
parser=RECOVER_PARSER)
jacket = XPath('//h:meta[@name="calibre-content" and @content="jacket"]')
found = None
for item in list(self.oeb.spine)[:4]:
try:
if jacket(item.data):
found = item
break
except:
continue
if found is None:
item = self.oeb.manifest.add(id, href, guess_type(href)[0], data=root)
self.oeb.spine.insert(0, item, True)
else:
self.log('Found existing book jacket, replacing...')
found.data = root
item = self.oeb.manifest.add(id, href, guess_type(href)[0], data=root)
self.oeb.spine.insert(0, item, True)
def remove_existing_jacket(self):
for x in self.oeb.spine[:4]:
if XPath(JACKET_XPATH)(x.data):
self.remove_images(x, limit=sys.maxint)
self.oeb.manifest.remove(x)
self.log('Removed existing jacket')
break
def __call__(self, oeb, opts, metadata): def __call__(self, oeb, opts, metadata):
'''
Add metadata in jacket.xhtml if specified in opts
If not specified, remove previous jacket instance
'''
self.oeb, self.opts, self.log = oeb, opts, oeb.log self.oeb, self.opts, self.log = oeb, opts, oeb.log
self.remove_existing_jacket()
if opts.remove_first_image: if opts.remove_first_image:
self.remove_first_image() self.remove_first_image()
if opts.insert_metadata: if opts.insert_metadata:
self.insert_metadata(metadata) self.insert_metadata(metadata)
# Render Jacket {{{
def get_rating(rating):
ans = ''
try:
num = float(rating)/2
except:
return ans
num = max(0, num)
num = min(num, 5)
if num < 1:
return ans
ans = u'\u2605' * int(num)
return ans
def render_jacket(mi, output_profile,
alt_title=_('Unknown'), alt_tags=[], alt_comments=''):
css = P('jacket/stylesheet.css', data=True).decode('utf-8')
try:
title_str = mi.title if mi.title else alt_title
except:
title_str = _('Unknown')
title = '<span class="title">%s</span>' % (escape(title_str))
series = escape(mi.series if mi.series else '')
if mi.series and mi.series_index is not None:
series += escape(' [%s]'%mi.format_series_index())
if not mi.series:
series = ''
try:
pubdate = strftime(u'%Y', mi.pubdate.timetuple())
except:
pubdate = ''
rating = get_rating(mi.rating)
tags = mi.tags if mi.tags else alt_tags
if tags:
tags = output_profile.tags_to_string(tags)
else:
tags = ''
comments = mi.comments if mi.comments else alt_comments
comments = comments.strip()
orig_comments = comments
if comments:
comments = comments_to_html(comments)
def generate_html(comments):
args = dict(xmlns=XHTML_NS,
title_str=title_str,
css=css,
title=title,
pubdate_label=_('Published'), pubdate=pubdate,
series_label=_('Series'), series=series,
rating_label=_('Rating'), rating=rating,
tags_label=_('Tags'), tags=tags,
comments=comments,
footer=''
)
generated_html = P('jacket/template.xhtml',
data=True).decode('utf-8').format(**args)
# 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.extract()
if not rating:
rating_tag = soup.find('tr', attrs={'class':'cbj_rating'})
rating_tag.extract()
if not tags:
tags_tag = soup.find('tr', attrs={'class':'cbj_tags'})
tags_tag.extract()
if not pubdate:
pubdate_tag = soup.find('tr', attrs={'class':'cbj_pubdate'})
pubdate_tag.extract()
if output_profile.short_name != 'kindle':
hr_tag = soup.find('hr', attrs={'class':'cbj_kindle_banner_hr'})
hr_tag.extract()
return soup.renderContents(None)
from calibre.ebooks.oeb.base import RECOVER_PARSER
try:
root = etree.fromstring(generate_html(comments), parser=RECOVER_PARSER)
except:
try:
root = etree.fromstring(generate_html(escape(orig_comments)),
parser=RECOVER_PARSER)
except:
root = etree.fromstring(generate_html(''),
parser=RECOVER_PARSER)
return root
# }}}
def linearize_jacket(oeb):
for x in oeb.spine[:4]:
if XPath(JACKET_XPATH)(x.data):
for e in XPath('//h:table|//h:tr|//h:th')(x.data):
e.tag = XHTML('div')
for e in XPath('//h:td')(x.data):
e.tag = XHTML('span')
break

View File

@ -376,7 +376,7 @@ class TagsModel(QAbstractItemModel): # {{{
'series' : QIcon(I('series.png')), 'series' : QIcon(I('series.png')),
'formats' : QIcon(I('book.png')), 'formats' : QIcon(I('book.png')),
'publisher' : QIcon(I('publisher.png')), 'publisher' : QIcon(I('publisher.png')),
'rating' : QIcon(I('star.png')), 'rating' : QIcon(I('rating.png')),
'news' : QIcon(I('news.png')), 'news' : QIcon(I('news.png')),
'tags' : QIcon(I('tags.png')), 'tags' : QIcon(I('tags.png')),
':custom' : QIcon(I('column.png')), ':custom' : QIcon(I('column.png')),

View File

@ -2523,6 +2523,10 @@ class EPUB_MOBI(CatalogPlugin):
# Fetch the database as a dictionary # Fetch the database as a dictionary
self.booksBySeries = self.plugin.search_sort_db(self.db, self.opts) self.booksBySeries = self.plugin.search_sort_db(self.db, self.opts)
if not self.booksBySeries:
self.opts.generate_series = False
self.opts.log(" no series found in selected books, cancelling series generation")
return
friendly_name = "Series" friendly_name = "Series"

View File

@ -604,7 +604,7 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
return identical_book_ids return identical_book_ids
def has_cover(self, index, index_is_id=False): def has_cover(self, index, index_is_id=False):
id = index if index_is_id else self.id(index) id = index if index_is_id else self.id(index)
path = os.path.join(self.library_path, self.path(id, index_is_id=True), 'cover.jpg') path = os.path.join(self.library_path, self.path(id, index_is_id=True), 'cover.jpg')
return os.access(path, os.R_OK) return os.access(path, os.R_OK)

View File

@ -5,12 +5,14 @@ __license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>' __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en' __docformat__ = 'restructuredtext en'
import os
from calibre.utils.magick import Image, DrawingWand, create_canvas from calibre.utils.magick import Image, DrawingWand, create_canvas
from calibre.constants import __appname__, __version__ from calibre.constants import __appname__, __version__
from calibre import fit_image from calibre import fit_image
def save_cover_data_to(data, path, bgcolor='white', resize_to=None): def save_cover_data_to(data, path, bgcolor='white', resize_to=None,
return_data=False):
''' '''
Saves image in data to path, in the format specified by the path Saves image in data to path, in the format specified by the path
extension. Composes the image onto a blank canvas so as to extension. Composes the image onto a blank canvas so as to
@ -22,6 +24,8 @@ def save_cover_data_to(data, path, bgcolor='white', resize_to=None):
img.size = (resize_to[0], resize_to[1]) img.size = (resize_to[0], resize_to[1])
canvas = create_canvas(img.size[0], img.size[1], bgcolor) canvas = create_canvas(img.size[0], img.size[1], bgcolor)
canvas.compose(img) canvas.compose(img)
if return_data:
return canvas.export(os.path.splitext(path)[1][1:])
canvas.save(path) canvas.save(path)
def thumbnail(data, width=120, height=120, bgcolor='white', fmt='jpg'): def thumbnail(data, width=120, height=120, bgcolor='white', fmt='jpg'):