mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge from trunk
This commit is contained in:
commit
1646fdea1e
@ -16,6 +16,8 @@ class TheTorontoStar(BasicNewsRecipe):
|
||||
language = 'en_CA'
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
#auto_cleanup = True
|
||||
#auto_cleanup_keep = '//div[@class="topsContent topsContentActive"]'
|
||||
use_embedded_content = False
|
||||
delay = 2
|
||||
publisher = 'The Toronto Star'
|
||||
@ -28,18 +30,18 @@ class TheTorontoStar(BasicNewsRecipe):
|
||||
,'publisher' : publisher
|
||||
}
|
||||
|
||||
keep_only_tags = [dict(name='div', attrs={'class':'ts-article'})]
|
||||
remove_tags_before = dict(name='div',attrs={'id':'ts-article_header'})
|
||||
#keep_only_tags = [dict(name='div', attrs={'class':'ts-article'})]
|
||||
#remove_tags_before = dict(name='div',attrs={'id':'ts-article_header'})
|
||||
|
||||
feeds = [
|
||||
(u'News' , u'http://www.thestar.com/rss/82672?' )
|
||||
,(u'Opinion' , u'http://www.thestar.com/rss/82863?' )
|
||||
,(u'Business' , u'http://www.thestar.com/rss/82796?' )
|
||||
,(u'Sports' , u'http://www.thestar.com/rss/82758?' )
|
||||
,(u'Entertainment', u'http://www.thestar.com/rss/117741?' )
|
||||
,(u'Living' , u'http://www.thestar.com/rss/82839?' )
|
||||
,(u'Travel' , u'http://www.thestar.com/rss/82858?' )
|
||||
,(u'Science' , u'http://www.thestar.com/rss/82848?')
|
||||
(u'News' , u'http://www.thestar.com/rss/?categories=293' )
|
||||
,(u'Opinion' , u'http://www.thestar.com/rss/?categories=303' )
|
||||
,(u'Business' , u'http://www.thestar.com/rss/?categories=294' )
|
||||
,(u'Sports' , u'http://www.thestar.com/rss/?categories=295' )
|
||||
,(u'Entertainment', u'http://www.toronto.com/rss?categories=6298' )
|
||||
,(u'Living' , u'http://www.thestar.com/rss/?categories=297' )
|
||||
,(u'Travel' , u'http://www.thestar.com/rss/list/1042246?' )
|
||||
,(u'Science' , u'http://www.thestar.com/rss?categories=6481')
|
||||
]
|
||||
|
||||
def print_version(self, url):
|
||||
@ -47,3 +49,4 @@ class TheTorontoStar(BasicNewsRecipe):
|
||||
artid = artl.rpartition('/')[2]
|
||||
return 'http://www.thestar.com/printarticle/' + artid
|
||||
|
||||
|
||||
|
@ -624,8 +624,9 @@ class Py2App(object):
|
||||
if os.path.exists(dmg):
|
||||
os.unlink(dmg)
|
||||
tdir = tempfile.mkdtemp()
|
||||
shutil.copytree(d, os.path.join(tdir, os.path.basename(d)),
|
||||
symlinks=True)
|
||||
appdir = os.path.join(tdir, os.path.basename(d))
|
||||
shutil.copytree(d, appdir, symlinks=True)
|
||||
subprocess.check_call(['/Users/kovid/sign.sh', appdir])
|
||||
os.symlink('/Applications', os.path.join(tdir, 'Applications'))
|
||||
subprocess.check_call(['/usr/bin/hdiutil', 'create', '-srcfolder', tdir,
|
||||
'-volname', volname, '-format', format, dmg])
|
||||
|
@ -6,11 +6,13 @@ __license__ = 'GPL v3'
|
||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
import os, shutil, subprocess
|
||||
import os, shutil, subprocess, re
|
||||
|
||||
from setup import Command, __appname__, __version__
|
||||
from setup.installer import VMInstaller
|
||||
|
||||
SIGNTOOL = r'C:\cygwin\home\kovid\sign.bat'
|
||||
|
||||
class Win(Command):
|
||||
|
||||
description = 'Build windows binary installers'
|
||||
@ -34,10 +36,19 @@ class Win32(VMInstaller):
|
||||
INSTALLER_EXT = 'msi'
|
||||
SHUTDOWN_CMD = ['shutdown.exe', '-s', '-f', '-t', '0']
|
||||
|
||||
def sign_msi(self):
|
||||
raw = open(self.VM).read()
|
||||
vmx = re.search(r'''launch_vmware\(['"](.+?)['"]''', raw).group(1)
|
||||
subprocess.check_call(['vmrun', '-T', 'ws', '-gu', 'kovid', '-gp',
|
||||
"et tu brutus", 'runProgramInGuest', vmx, 'cmd.exe', '/C',
|
||||
r'C:\cygwin\home\kovid\sign.bat'])
|
||||
|
||||
def download_installer(self):
|
||||
installer = self.installer()
|
||||
if os.path.exists('build/winfrozen'):
|
||||
shutil.rmtree('build/winfrozen')
|
||||
self.sign_msi()
|
||||
|
||||
subprocess.check_call(('scp',
|
||||
'xp_build:build/%s/%s'%(__appname__, installer), 'dist'))
|
||||
if not os.path.exists(installer):
|
||||
|
@ -23,7 +23,6 @@ SW = r'C:\cygwin\home\kovid\sw'
|
||||
IMAGEMAGICK = os.path.join(SW, 'build', 'ImageMagick-6.7.6',
|
||||
'VisualMagick', 'bin')
|
||||
CRT = r'C:\Microsoft.VC90.CRT'
|
||||
SIGNTOOL = r'C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\signtool.exe'
|
||||
|
||||
VERSION = re.sub('[a-z]\d+', '', __version__)
|
||||
WINVER = VERSION+'.0'
|
||||
|
@ -185,16 +185,19 @@ class Completer(QListView): # {{{
|
||||
e.accept()
|
||||
return True
|
||||
if key in (Qt.Key_Enter, Qt.Key_Return):
|
||||
if not self.currentIndex().isValid():
|
||||
# We handle this explicitly because on OS X activated() is
|
||||
# not emitted on pressing Enter.
|
||||
idx = self.currentIndex()
|
||||
if idx.isValid():
|
||||
self.item_chosen(idx)
|
||||
self.hide()
|
||||
e.accept()
|
||||
return True
|
||||
return False
|
||||
if key in (Qt.Key_PageUp, Qt.Key_PageDown):
|
||||
# Let the list view handle these keys
|
||||
return False
|
||||
if key in (Qt.Key_Tab, Qt.Key_Backtab, Qt.Key_Up, Qt.Key_Down):
|
||||
self.next_match(previous=key in (Qt.Key_Backtab, Qt.Key_Up))
|
||||
if key in (Qt.Key_Up, Qt.Key_Down):
|
||||
self.next_match(previous=key == Qt.Key_Up)
|
||||
e.accept()
|
||||
return True
|
||||
# Send to widget
|
||||
@ -211,6 +214,8 @@ class Completer(QListView): # {{{
|
||||
self.hide()
|
||||
e.accept()
|
||||
return True
|
||||
elif etype == e.ShortcutOverride:
|
||||
QApplication.sendEvent(widget, e)
|
||||
return False
|
||||
# }}}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user