diff --git a/pyqtdistutils.py b/pyqtdistutils.py index f452941958..0150cd8684 100644 --- a/pyqtdistutils.py +++ b/pyqtdistutils.py @@ -10,11 +10,17 @@ from distutils.core import Extension as _Extension from distutils.command.build_ext import build_ext as _build_ext from distutils.dep_util import newer_group from distutils import log +from distutils.spawn import find_executable import sipconfig, os, sys, string, glob, shutil from PyQt4 import pyqtconfig iswindows = 'win32' in sys.platform -QMAKE = os.path.expanduser('~/qt/bin/qmake') if 'darwin' in sys.platform else'qmake' +isosx = 'darwin' in sys.platform +QMAKE = '/Volumes/sw/qt/bin/qmake' if isosx else 'qmake' +if find_executable('qmake-qt4'): + QMAKE = find_executable('qmake-qt4') +elif find_executable('qmake'): + QMAKE = find_executable('qmake') QMAKE = os.environ.get('QMAKE', QMAKE) WINDOWS_PYTHON = ['C:/Python26/libs'] OSX_SDK = '/Developer/SDKs/MacOSX10.4u.sdk' diff --git a/setup.py b/setup.py index 9054e9ea9a..439eef6ce2 100644 --- a/setup.py +++ b/setup.py @@ -65,7 +65,7 @@ def setup_mount_helper(): if __name__ == '__main__': from setuptools import setup, find_packages - from pyqtdistutils import PyQtExtension, build_ext, Extension + from pyqtdistutils import PyQtExtension, build_ext, Extension, QMAKE from upload import sdist, pot, build, build_py, manual, \ resources, clean, gui, translations, update, \ tag_release, upload_demo, build_linux, build_windows, \ @@ -76,10 +76,8 @@ if __name__ == '__main__': entry_points['console_scripts'].append( 'calibre_postinstall = calibre.linux:post_install') optional = [] - qmake = '/Volumes/sw/qt/bin/qmake' if isosx else 'qmake' - qmake = os.environ.get('QMAKE', qmake) def qmake_query(arg=''): - return subprocess.Popen([qmake, '-query', arg], + return subprocess.Popen([QMAKE, '-query', arg], stdout=subprocess.PIPE).stdout.read() qt_inc = qt_lib = None qt_inc = qmake_query('QT_INSTALL_HEADERS').splitlines()[0] diff --git a/src/calibre/ebooks/conversion/cli.py b/src/calibre/ebooks/conversion/cli.py index 058ed49130..f705523312 100644 --- a/src/calibre/ebooks/conversion/cli.py +++ b/src/calibre/ebooks/conversion/cli.py @@ -35,14 +35,10 @@ normally have been passed to the output plugin. After specifying the input \ and output file you can customize the conversion by specifying various \ -options. the available options depend on the input and output file types. \ +options. The available options depend on the input and output file types. \ To get help on them specify the input and output file and then use the -h \ option. -You can also get detailed help on all the options any input/output pair \ -of formats supports by specifying the -h flag after the input and output \ -filenames. - For full documentation of the conversion system see ''') + 'http://calibre.kovidgoyal.net/user_manual/conversion.html' diff --git a/src/calibre/gui2/convert/pdb_output.ui b/src/calibre/gui2/convert/pdb_output.ui index 5f21031233..3d35a1f4e3 100644 --- a/src/calibre/gui2/convert/pdb_output.ui +++ b/src/calibre/gui2/convert/pdb_output.ui @@ -17,7 +17,10 @@ - Format: + &Format: + + + opt_format diff --git a/src/calibre/gui2/convert/pdf_input.ui b/src/calibre/gui2/convert/pdf_input.ui index 40f480b15d..626c68ea63 100644 --- a/src/calibre/gui2/convert/pdf_input.ui +++ b/src/calibre/gui2/convert/pdf_input.ui @@ -17,7 +17,10 @@ - Line Un-Wrapping Factor: + Line &Un-Wrapping Factor: + + + opt_unwrap_factor @@ -50,7 +53,7 @@ - No Images + No &Images diff --git a/src/calibre/gui2/convert/pdf_output.ui b/src/calibre/gui2/convert/pdf_output.ui index ef29c55265..ca9bd6b40f 100644 --- a/src/calibre/gui2/convert/pdf_output.ui +++ b/src/calibre/gui2/convert/pdf_output.ui @@ -17,7 +17,10 @@ - Paper Size: + &Paper Size: + + + opt_paper_size @@ -27,7 +30,10 @@ - Orientation: + &Orientation: + + + opt_orientation diff --git a/src/calibre/gui2/convert/txt_output.ui b/src/calibre/gui2/convert/txt_output.ui index dfe6d40fc9..32b14b9bc4 100644 --- a/src/calibre/gui2/convert/txt_output.ui +++ b/src/calibre/gui2/convert/txt_output.ui @@ -17,7 +17,10 @@ - Line ending style: + &Line ending style: + + + opt_newline diff --git a/src/calibre/trac/plugins/Changelog.py b/src/calibre/trac/plugins/Changelog.py index 146d8b16d0..1f438de5e3 100644 --- a/src/calibre/trac/plugins/Changelog.py +++ b/src/calibre/trac/plugins/Changelog.py @@ -54,7 +54,7 @@ class ChangelogFormatter(blog.LogFormatter): for msg in entry[1]: txt.append(u' * ' + msg) - return u'\n'.join(txt) + return (u'\n'.join(txt)).encode('ascii', 'replace') def bzr_log_to_txt(): path = BZR_PATH diff --git a/src/calibre/translations/calibre.pot b/src/calibre/translations/calibre.pot index 5607483f02..3e19a726f6 100644 --- a/src/calibre/translations/calibre.pot +++ b/src/calibre/translations/calibre.pot @@ -5,8 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: calibre 0.6.6\n" -"POT-Creation-Date: 2009-08-10 19:10+MDT\n" -"PO-Revision-Date: 2009-08-10 19:10+MDT\n" +"POT-Creation-Date: 2009-08-11 11:45+MDT\n" +"PO-Revision-Date: 2009-08-11 11:45+MDT\n" "Last-Translator: Automatically generated\n" "Language-Team: LANGUAGE\n" "MIME-Version: 1.0\n" @@ -643,54 +643,52 @@ msgid "" "\n" "The output ebook format is guessed from the file extension of output_file. output_file can also be of the special format .EXT where EXT is the output file extension. In this case, the name of the output file is derived the name of the input file. Note that the filenames must not start with a hyphen. Finally, if output_file has no extension, then it is treated as a directory and an \"open ebook\" (OEB) consisting of HTML files is written to that directory. These files are the files that would normally have been passed to the output plugin.\n" "\n" -"After specifying the input and output file you can customize the conversion by specifying various options. the available options depend on the input and output file types. To get help on them specify the input and output file and then use the -h option.\n" -"\n" -"You can also get detailed help on all the options any input/output pair of formats supports by specifying the -h flag after the input and output filenames.\n" +"After specifying the input and output file you can customize the conversion by specifying various options. The available options depend on the input and output file types. To get help on them specify the input and output file and then use the -h option.\n" "\n" "For full documentation of the conversion system see\n" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/conversion/cli.py:101 +#: /home/kovid/work/calibre/src/calibre/ebooks/conversion/cli.py:97 msgid "INPUT OPTIONS" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/conversion/cli.py:102 +#: /home/kovid/work/calibre/src/calibre/ebooks/conversion/cli.py:98 msgid "Options to control the processing of the input %s file" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/conversion/cli.py:108 +#: /home/kovid/work/calibre/src/calibre/ebooks/conversion/cli.py:104 msgid "OUTPUT OPTIONS" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/conversion/cli.py:109 +#: /home/kovid/work/calibre/src/calibre/ebooks/conversion/cli.py:105 msgid "Options to control the processing of the output %s" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/conversion/cli.py:123 +#: /home/kovid/work/calibre/src/calibre/ebooks/conversion/cli.py:119 msgid "Options to control the look and feel of the output" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/conversion/cli.py:138 +#: /home/kovid/work/calibre/src/calibre/ebooks/conversion/cli.py:134 msgid "Control auto-detection of document structure." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/conversion/cli.py:148 +#: /home/kovid/work/calibre/src/calibre/ebooks/conversion/cli.py:144 msgid "Control the automatic generation of a Table of Contents. By default, if the source file has a Table of Contents, it will be used in preference to the automatically generated one." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/conversion/cli.py:158 +#: /home/kovid/work/calibre/src/calibre/ebooks/conversion/cli.py:154 msgid "Options to set metadata in the output" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/conversion/cli.py:161 +#: /home/kovid/work/calibre/src/calibre/ebooks/conversion/cli.py:157 msgid "Options to help with debugging the conversion" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/conversion/cli.py:185 +#: /home/kovid/work/calibre/src/calibre/ebooks/conversion/cli.py:181 msgid "List builtin recipes" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/conversion/cli.py:254 +#: /home/kovid/work/calibre/src/calibre/ebooks/conversion/cli.py:250 msgid "Output saved to" msgstr "" @@ -4129,7 +4127,7 @@ msgid "" "p, li { white-space: pre-wrap; }\n" "\n" "

Set a regular expression pattern to use when trying to guess ebook metadata from filenames.

\n" -"

A reference on the syntax of regular expressions is available.

\n" +"

A reference on the syntax of regular expressions is available.

\n" "

Use the Test functionality below to test your regular expression on a few sample filenames. The group names for the various metadata entries are documented in tooltips.

" msgstr "" @@ -5889,47 +5887,51 @@ msgid "" "%sUsage%s: %s\n" msgstr "" -#: /home/kovid/work/calibre/src/calibre/utils/config.py:81 +#: /home/kovid/work/calibre/src/calibre/utils/config.py:87 msgid "Created by " msgstr "" -#: /home/kovid/work/calibre/src/calibre/utils/config.py:538 -msgid "Path to the database in which books are stored" +#: /home/kovid/work/calibre/src/calibre/utils/config.py:88 +msgid "Whenever you pass arguments to %prog that have spaces in them, enclose the arguments in quotation marks." msgstr "" #: /home/kovid/work/calibre/src/calibre/utils/config.py:540 -msgid "Pattern to guess metadata from filenames" +msgid "Path to the database in which books are stored" msgstr "" #: /home/kovid/work/calibre/src/calibre/utils/config.py:542 -msgid "Access key for isbndb.com" +msgid "Pattern to guess metadata from filenames" msgstr "" #: /home/kovid/work/calibre/src/calibre/utils/config.py:544 -msgid "Default timeout for network operations (seconds)" +msgid "Access key for isbndb.com" msgstr "" #: /home/kovid/work/calibre/src/calibre/utils/config.py:546 -msgid "Path to directory in which your library of books is stored" +msgid "Default timeout for network operations (seconds)" msgstr "" #: /home/kovid/work/calibre/src/calibre/utils/config.py:548 -msgid "The language in which to display the user interface" +msgid "Path to directory in which your library of books is stored" msgstr "" #: /home/kovid/work/calibre/src/calibre/utils/config.py:550 +msgid "The language in which to display the user interface" +msgstr "" + +#: /home/kovid/work/calibre/src/calibre/utils/config.py:552 msgid "The default output format for ebook conversions." msgstr "" -#: /home/kovid/work/calibre/src/calibre/utils/config.py:554 +#: /home/kovid/work/calibre/src/calibre/utils/config.py:556 msgid "Ordered list of formats to prefer for input." msgstr "" -#: /home/kovid/work/calibre/src/calibre/utils/config.py:556 +#: /home/kovid/work/calibre/src/calibre/utils/config.py:558 msgid "Read metadata from files" msgstr "" -#: /home/kovid/work/calibre/src/calibre/utils/config.py:558 +#: /home/kovid/work/calibre/src/calibre/utils/config.py:560 msgid "The priority of worker processes" msgstr "" @@ -6406,272 +6408,3 @@ msgstr "" msgid "Show detailed output information. Useful for debugging" msgstr "" -#: /home/kovid/work/calibre/src/calibre/www/apps/blog/models.py:12 -#: /home/kovid/work/calibre/src/calibre/www/apps/blog/models.py:38 -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:45 -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:103 -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:141 -msgid "title" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/blog/models.py:13 -#: /home/kovid/work/calibre/src/calibre/www/apps/blog/models.py:39 -msgid "slug" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/blog/models.py:16 -msgid "category" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/blog/models.py:17 -msgid "categories" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/blog/models.py:35 -msgid "Draft" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/blog/models.py:36 -msgid "Public" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/blog/models.py:41 -msgid "body" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/blog/models.py:42 -msgid "tease" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/blog/models.py:43 -msgid "status" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/blog/models.py:44 -msgid "allow comments" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/blog/models.py:45 -msgid "publish" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/blog/models.py:46 -msgid "created" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/blog/models.py:47 -msgid "modified" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/blog/models.py:53 -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:153 -msgid "post" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/blog/models.py:54 -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:154 -msgid "posts" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/admin.py:31 -msgid "Fields updated automatically by Feedjack" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:17 -msgid "Date published." -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:18 -msgid "Date the post was first obtained." -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:22 -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:38 -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:98 -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:126 -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:173 -msgid "name" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:23 -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:26 -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:105 -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:142 -msgid "link" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:27 -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:61 -msgid "links" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:39 -msgid "url" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:42 -msgid "Example" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:46 -msgid "description" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:47 -msgid "welcome" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:48 -msgid "greets" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:50 -msgid "default site" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:51 -msgid "posts per page" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:52 -msgid "order posts by" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:54 -msgid "tagcloud level" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:55 -msgid "show tagcloud" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:57 -msgid "use internal cache" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:58 -msgid "cache duration" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:59 -msgid "Duration in seconds of the cached pages and data." -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:63 -msgid "template" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:65 -msgid "This template must be a directory in your feedjack templates directory. Leave blank to use the default template." -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:69 -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:170 -msgid "site" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:70 -msgid "sites" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:96 -msgid "feed url" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:99 -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:175 -msgid "shortname" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:100 -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:178 -msgid "is active" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:101 -msgid "If disabled, this feed will not be further updated." -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:104 -msgid "tagline" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:108 -msgid "etag" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:109 -msgid "last modified" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:110 -msgid "last checked" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:113 -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:140 -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:171 -msgid "feed" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:114 -msgid "feeds" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:129 -msgid "tag" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:130 -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:149 -msgid "tags" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:143 -msgid "content" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:144 -msgid "date modified" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:145 -msgid "guid" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:146 -msgid "author" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:147 -msgid "author email" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:148 -msgid "comments" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:150 -msgid "date created" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:174 -msgid "Keep blank to use the Feed's original name." -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:177 -msgid "Keep blank to use the Feed's original shortname." -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:179 -msgid "If disabled, this subscriber will not appear in the site or in the site's feed." -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:183 -msgid "subscriber" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/www/apps/feedjack/models.py:184 -msgid "subscribers" -msgstr "" - diff --git a/src/calibre/utils/config.py b/src/calibre/utils/config.py index 73db896e17..06af68dad6 100644 --- a/src/calibre/utils/config.py +++ b/src/calibre/utils/config.py @@ -78,13 +78,15 @@ class OptionParser(_OptionParser): def __init__(self, usage='%prog [options] filename', version='%%prog (%s %s)'%(__appname__, __version__), - epilog=_('Created by ')+terminal_controller.RED+__author__+terminal_controller.NORMAL, + epilog=None, gui_mode=False, conflict_handler='resolve', **kwds): usage = textwrap.dedent(usage) - usage += '''\n\nWhenever you pass arguments to %prog that have spaces in them, '''\ - '''enclose the arguments in quotation marks.''' + if epilog is None: + epilog = _('Created by ')+terminal_controller.RED+__author__+terminal_controller.NORMAL + usage += '\n\n'+_('''Whenever you pass arguments to %prog that have spaces in them, ''' + '''enclose the arguments in quotation marks.''') _OptionParser.__init__(self, usage=usage, version=version, epilog=epilog, formatter=CustomHelpFormatter(), conflict_handler=conflict_handler, **kwds) diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index 2a5f9c7002..6e94a3bef8 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -52,7 +52,7 @@ recipe_modules = ['recipe_' + r for r in ( 'diagonales', 'miradasalsur', 'newsweek_argentina', 'veintitres', 'gva_be', 'hln', 'tijd', 'degentenaar', 'inquirer_net', 'uncrate', 'fastcompany', 'accountancyage', 'laprensa_hn', 'latribuna', - 'eltiempo_hn', 'slate', + 'eltiempo_hn', 'slate', 'tnxm', 'bbcvietnamese', 'vnexpress', )] diff --git a/src/calibre/web/feeds/recipes/recipe_bbcvietnamese.py b/src/calibre/web/feeds/recipes/recipe_bbcvietnamese.py new file mode 100644 index 0000000000..a485798ad1 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_bbcvietnamese.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Huan Komrade T ' +''' +bbc.co.uk +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class BBCVietnamese(BasicNewsRecipe): + title = u'BBC Vietnamese' + __author__ = 'Huan Komrade T' + description = 'Vietnam news and current affairs from the British Broadcasting Corporation' + no_stylesheets = True + language = _('Vietnamese') + encoding = 'utf-8' + recursions = 0 + + remove_tags = [dict(name='div', attrs={'class':'footer'})] + extra_css = '.headline {font-size: x-large;} \n .fact { padding-top: 10pt }' + + feeds = [ + ('Index', 'http://www.bbc.co.uk/vietnamese/index.xml'), + ('Vietnam', 'http://www.bbc.co.uk/vietnamese/vietnam/index.xml'), + ('Business', 'http://www.bbc.co.uk/vietnamese/business/index.xml'), + ('Culture', 'http://www.bbc.co.uk/vietnamese/culture/index.xml'), + ('Football', 'http://www.bbc.co.uk/vietnamese/football/index.xml'), + ('Forum', 'http://www.bbc.co.uk/vietnamese/forum/index.xml'), + ('In Depth', 'http://www.bbc.co.uk/vietnamese/indepth/index.xml'), + ] + + def print_version(self, url): + return url.replace('http://www.bbc.co.uk/vietnamese/', 'http://www.bbc.co.uk/vietnamese/lg/') diff --git a/src/calibre/web/feeds/recipes/recipe_slashdot.py b/src/calibre/web/feeds/recipes/recipe_slashdot.py index f29792bb21..973342759d 100644 --- a/src/calibre/web/feeds/recipes/recipe_slashdot.py +++ b/src/calibre/web/feeds/recipes/recipe_slashdot.py @@ -1,39 +1,36 @@ -#!/usr/bin/env python -# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai -from __future__ import with_statement - -__license__ = 'GPL v3' -__copyright__ = '2009, Kovid Goyal ' -__docformat__ = 'restructuredtext en' - -from calibre.web.feeds.news import BasicNewsRecipe - -class Slashdot(BasicNewsRecipe): - title = u'Slashdot.org' - oldest_article = 7 - max_articles_per_feed = 100 - language = _('English') - __author__ = 'floweros' - no_stylesheets = True - keep_only_tags = [dict(name='div',attrs={'id':'article'})] - remove_tags = [ - dict(name='div',attrs={'id':'userlogin-title'}), - dict(name='div',attrs={'id':'userlogin-content'}), - dict(name='div',attrs={'id':'commentwrap'}), - dict(name='span',attrs={'id':'more_comments_num_a'}), - ] - - feeds = [ - (u'Slashdot', - u'http://rss.slashdot.org/Slashdot/slashdot?m=5072'), - (u'/. IT', - u'http://rss.slashdot.org/Slashdot/slashdotIT'), - (u'/. Hardware', - u'http://rss.slashdot.org/Slashdot/slashdotHardware'), - (u'/. Linux', - u'http://rss.slashdot.org/Slashdot/slashdotLinux'), - (u'/. Your Rights Online', - u'http://rss.slashdot.org/Slashdot/slashdotYourRightsOnline') - ] - - +#!/usr/bin/env python +# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai +from __future__ import with_statement + +__license__ = 'GPL v3' +__copyright__ = '2009, Kovid Goyal edited by Huan T' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Slashdot(BasicNewsRecipe): + title = u'Slashdot.org' + oldest_article = 7 + max_articles_per_feed = 100 + language = _('English') + __author__ = 'floweros edited by Huan T' + no_stylesheets = True +# keep_only_tags = [ +# dict(name='div',attrs={'class':'article'}), +# dict(name='div',attrs={'class':'commentTop'}), +# ] + + feeds = [ + (u'Slashdot', + u'http://rss.slashdot.org/Slashdot/slashdot'), + (u'/. IT', + u'http://rss.slashdot.org/Slashdot/slashdotIT'), + (u'/. Hardware', + u'http://rss.slashdot.org/Slashdot/slashdotHardware'), + (u'/. Linux', + u'http://rss.slashdot.org/Slashdot/slashdotLinux'), + (u'/. Your Rights Online', + u'http://rss.slashdot.org/Slashdot/slashdotYourRightsOnline') + ] + + def get_article_url(self, article): + return article.get('feedburner_origlink', None) diff --git a/src/calibre/web/feeds/recipes/recipe_tnxm.py b/src/calibre/web/feeds/recipes/recipe_tnxm.py new file mode 100644 index 0000000000..6d9ba919de --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_tnxm.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Wasabi ' +''' +tnxm.net +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class TNXM(BasicNewsRecipe): + title = u'Thanh Nien Xa Me' + __author__ = 'Wasabi' + description = 'Vietnam news and current affairs from TNXM - the finest Vietnamese bulletin board.' + no_stylesheets = True + language = _('Vietnamese') + encoding = 'utf-8' + recursions = 0 + + remove_tags = [dict(name='div', attrs={'class':'footer'})] + extra_css = '.headline {font-size: x-large;} \n .fact { padding-top: 10pt }' + + feeds = [ + ('Index', 'http://tnxm.net/external.php?type=RSS'), + ] + + def print_version(self, url): + return url.replace('showthread.php?', 'printthread.php?pp=160&') diff --git a/src/calibre/web/feeds/recipes/recipe_vnexpress.py b/src/calibre/web/feeds/recipes/recipe_vnexpress.py new file mode 100644 index 0000000000..0d50aa5f9a --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_vnexpress.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Huan Komrade T ' +''' +vnexpress.net +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class BBCVietnamese(BasicNewsRecipe): + title = u'VnExpress' + __author__ = 'Huan Komrade T' + description = 'Vietnam news and current affairs from the Food Production Technology Corporation' + no_stylesheets = True + language = _('Vietnamese') + encoding = 'utf-8' + recursions = 0 + + remove_tags = [dict(name='div', attrs={'class':'footer'})] + extra_css = '.headline {font-size: x-large;} \n .fact { padding-top: 10pt }' + + feeds = [ + ('Index', 'http://vnexpress.net/rss/gl/trang-chu.rss'), + ('Vietnam', 'http://vnexpress.net/rss/gl/xa-hoi.rss'), + ('World News', 'http://vnexpress.net/rss/gl/the-gioi.rss'), + ('Business', 'http://vnexpress.net/rss/gl/kinh-doanh.rss'), + ('Culture', 'http://vnexpress.net/rss/gl/van-hoa.rss'), + ('Sports', 'http://vnexpress.net/rss/gl/the-thao.rss'), + ('Lifestyle', 'http://vnexpress.net/rss/gl/doi-song.rss'), + ('From The Readers', 'http://vnexpress.net/rss/gl/ban-doc-viet.rss'), + ('From The Readers - Sharing', 'http://vnexpress.net/rss/gl/ban-doc-viet-tam-su.rss'), + ] + + def print_version(self, url): + return url + '?q=1'