Merge from trunk

This commit is contained in:
Charles Haley 2010-09-08 13:33:08 +01:00
commit 61ea8ad894
2 changed files with 7 additions and 6 deletions

View File

@ -26,13 +26,13 @@ class NYTimes(BasicNewsRecipe):
#TO LOGIN #TO LOGIN
def get_browser(self): def get_browser(self):
br = BasicNewsRecipe.get_browser() br = BasicNewsRecipe.get_browser()
br.open('http://content.nejm.org/cgi/login?uri=/') br.open('http://www.nejm.org/action/showLogin?uri=http://www.nejm.org/')
br.select_form(nr=0) br.select_form(name='frmLogin')
br['username'] = self.username br['login'] = self.username
br['code'] = self.password br['password'] = self.password
response = br.submit() response = br.submit()
raw = response.read() raw = response.read()
if '<strong>Welcome' not in raw: if '>Sign Out<' not in raw:
raise Exception('Login failed. Check your username and password') raise Exception('Login failed. Check your username and password')
return br return br

View File

@ -9,7 +9,7 @@ import os
from functools import partial from functools import partial
from PyQt4.Qt import QTableView, Qt, QAbstractItemView, QMenu, pyqtSignal, \ from PyQt4.Qt import QTableView, Qt, QAbstractItemView, QMenu, pyqtSignal, \
QModelIndex QModelIndex, QIcon
from calibre.gui2.library.delegates import RatingDelegate, PubDateDelegate, \ from calibre.gui2.library.delegates import RatingDelegate, PubDateDelegate, \
TextDelegate, DateDelegate, TagsDelegate, CcTextDelegate, \ TextDelegate, DateDelegate, TagsDelegate, CcTextDelegate, \
@ -172,6 +172,7 @@ class BooksView(QTableView): # {{{
if self.can_add_columns: if self.can_add_columns:
self.column_header_context_menu.addAction( self.column_header_context_menu.addAction(
QIcon(I('column.png')),
_('Add your own columns'), _('Add your own columns'),
partial(self.column_header_context_handler, partial(self.column_header_context_handler,
action='addcustcol', column=col)) action='addcustcol', column=col))