~ubuntu-branches/ubuntu/karmic/calibre/karmic-updates

« back to all changes in this revision

Viewing changes to src/calibre/web/feeds/recipes/recipe_pobjeda.py

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-06-06 17:18:02 UTC
  • mfrom: (1.4.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090606171802-fcu5dzgkxygn79y6
Tags: 0.5.14+dfsg-1
* New upstream release.
* debian/rules, get-orig-source: Do not unpack newly generated orig tarball
  if we don't have unpackaged upstream sources in the tree (such as when
  building with bzr-buildpackage).

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
import re
11
11
from calibre import strftime
12
12
from calibre.web.feeds.news import BasicNewsRecipe
 
13
from calibre.ebooks.BeautifulSoup import BeautifulSoup, Tag
13
14
 
14
15
class Pobjeda(BasicNewsRecipe):
15
16
    title                 = 'Pobjeda Online'
22
23
    encoding              = 'utf8'
23
24
    remove_javascript     = True
24
25
    use_embedded_content  = False
 
26
    language              = _('Serbian')
 
27
    lang                  = 'sr-Latn-Me'
25
28
    INDEX                 = u'http://www.pobjeda.co.me'
26
 
    extra_css = '@font-face {font-family: "serif1";src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf)} body{text-align: justify; font-family: serif1, serif} .article_description{font-family: serif1, serif}'
 
29
    extra_css = '@font-face {font-family: "serif1";src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf)} body{font-family: serif1, serif} .article_description{font-family: serif1, serif}'
27
30
    
28
31
    html2lrf_options = [
29
32
                          '--comment', description
30
 
                        , '--base-font-size', '10'
31
33
                        , '--category', category
32
34
                        , '--publisher', publisher
33
35
                        ]
59
61
            ]
60
62
 
61
63
    def preprocess_html(self, soup):
62
 
        soup.html['xml:lang'] = 'sr-Latn-ME'
63
 
        soup.html['lang']     = 'sr-Latn-ME'
64
 
        mtag = '<meta http-equiv="Content-Language" content="sr-Latn-ME"/>'
65
 
        soup.head.insert(0,mtag)
66
 
        return soup
 
64
        soup.html['xml:lang'] = self.lang
 
65
        soup.html['lang']     = self.lang
 
66
        mlang = Tag(soup,'meta',[("http-equiv","Content-Language"),("content",self.lang)])
 
67
        mcharset = Tag(soup,'meta',[("http-equiv","Content-Type"),("content","text/html; charset=UTF-8")])
 
68
        soup.head.insert(0,mlang)
 
69
        soup.head.insert(1,mcharset)
 
70
        return self.adeify_images(soup)
67
71
 
68
72
    def get_cover_url(self):
69
73
        cover_url = None