mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge from custcol trunk
This commit is contained in:
commit
aab35d2dae
@ -23,7 +23,8 @@ class darknet(BasicNewsRecipe):
|
|||||||
|
|
||||||
remove_tags = [dict(id='navi_top'),
|
remove_tags = [dict(id='navi_top'),
|
||||||
dict(id='navi_bottom'),
|
dict(id='navi_bottom'),
|
||||||
dict(id='logo'),
|
dict(id='nav'),
|
||||||
|
dict(id='top-ad'),
|
||||||
dict(id='login_suche'),
|
dict(id='login_suche'),
|
||||||
dict(id='navi_login'),
|
dict(id='navi_login'),
|
||||||
dict(id='breadcrumb'),
|
dict(id='breadcrumb'),
|
||||||
@ -32,13 +33,14 @@ class darknet(BasicNewsRecipe):
|
|||||||
dict(name='span', attrs={'class':'rsaquo'}),
|
dict(name='span', attrs={'class':'rsaquo'}),
|
||||||
dict(name='span', attrs={'class':'next'}),
|
dict(name='span', attrs={'class':'next'}),
|
||||||
dict(name='span', attrs={'class':'prev'}),
|
dict(name='span', attrs={'class':'prev'}),
|
||||||
|
dict(name='span', attrs={'class':'comments'}),
|
||||||
dict(name='div', attrs={'class':'news_logo'}),
|
dict(name='div', attrs={'class':'news_logo'}),
|
||||||
dict(name='div', attrs={'class':'nextprev'}),
|
dict(name='div', attrs={'class':'nextprev'}),
|
||||||
|
dict(name='div', attrs={'class':'tags'}),
|
||||||
|
dict(name='div', attrs={'class':'Nav'}),
|
||||||
dict(name='p', attrs={'class':'news_option'}),
|
dict(name='p', attrs={'class':'news_option'}),
|
||||||
dict(name='p', attrs={'class':'news_foren'})]
|
dict(name='p', attrs={'class':'news_foren'})]
|
||||||
remove_tags_after = [dict(name='div', attrs={'class':'entrybody'})]
|
remove_tags_after = [dict(name='div', attrs={'class':'meta-footer'})]
|
||||||
|
|
||||||
feeds = [ ('darknet', 'http://feedproxy.google.com/darknethackers') ]
|
feeds = [ ('darknet', 'http://feedproxy.google.com/darknethackers') ]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ class KOBO(USBMS):
|
|||||||
BCD = [0x0110]
|
BCD = [0x0110]
|
||||||
|
|
||||||
VENDOR_NAME = 'KOBO_INC'
|
VENDOR_NAME = 'KOBO_INC'
|
||||||
WINDOWS_MAIN_MEM = '.KOBOEREADER'
|
WINDOWS_MAIN_MEM = WINDOWS_CARD_A_MEM = '.KOBOEREADER'
|
||||||
|
|
||||||
EBOOK_DIR_MAIN = ''
|
EBOOK_DIR_MAIN = ''
|
||||||
SUPPORTS_SUB_DIRS = True
|
SUPPORTS_SUB_DIRS = True
|
||||||
|
@ -9,6 +9,9 @@ from calibre.constants import islinux
|
|||||||
|
|
||||||
class TagEditor(QDialog, Ui_TagEditor):
|
class TagEditor(QDialog, Ui_TagEditor):
|
||||||
|
|
||||||
|
def tag_cmp(self, x, y):
|
||||||
|
return cmp(x.lower(), y.lower())
|
||||||
|
|
||||||
def __init__(self, window, db, index=None):
|
def __init__(self, window, db, index=None):
|
||||||
QDialog.__init__(self, window)
|
QDialog.__init__(self, window)
|
||||||
Ui_TagEditor.__init__(self)
|
Ui_TagEditor.__init__(self)
|
||||||
@ -22,7 +25,7 @@ class TagEditor(QDialog, Ui_TagEditor):
|
|||||||
tags = []
|
tags = []
|
||||||
if tags:
|
if tags:
|
||||||
tags = [tag.strip() for tag in tags.split(',') if tag.strip()]
|
tags = [tag.strip() for tag in tags.split(',') if tag.strip()]
|
||||||
tags.sort()
|
tags.sort(cmp=self.tag_cmp)
|
||||||
for tag in tags:
|
for tag in tags:
|
||||||
self.applied_tags.addItem(tag)
|
self.applied_tags.addItem(tag)
|
||||||
else:
|
else:
|
||||||
@ -32,7 +35,7 @@ class TagEditor(QDialog, Ui_TagEditor):
|
|||||||
|
|
||||||
all_tags = [tag for tag in self.db.all_tags()]
|
all_tags = [tag for tag in self.db.all_tags()]
|
||||||
all_tags = list(set(all_tags))
|
all_tags = list(set(all_tags))
|
||||||
all_tags.sort()
|
all_tags.sort(cmp=self.tag_cmp)
|
||||||
for tag in all_tags:
|
for tag in all_tags:
|
||||||
if tag not in tags:
|
if tag not in tags:
|
||||||
self.available_tags.addItem(tag)
|
self.available_tags.addItem(tag)
|
||||||
@ -79,7 +82,7 @@ class TagEditor(QDialog, Ui_TagEditor):
|
|||||||
self.tags.append(tag)
|
self.tags.append(tag)
|
||||||
self.available_tags.takeItem(self.available_tags.row(item))
|
self.available_tags.takeItem(self.available_tags.row(item))
|
||||||
|
|
||||||
self.tags.sort()
|
self.tags.sort(cmp=self.tag_cmp)
|
||||||
self.applied_tags.clear()
|
self.applied_tags.clear()
|
||||||
for tag in self.tags:
|
for tag in self.tags:
|
||||||
self.applied_tags.addItem(tag)
|
self.applied_tags.addItem(tag)
|
||||||
@ -93,12 +96,17 @@ class TagEditor(QDialog, Ui_TagEditor):
|
|||||||
self.tags.remove(tag)
|
self.tags.remove(tag)
|
||||||
self.available_tags.addItem(tag)
|
self.available_tags.addItem(tag)
|
||||||
|
|
||||||
self.tags.sort()
|
self.tags.sort(cmp=self.tag_cmp)
|
||||||
self.applied_tags.clear()
|
self.applied_tags.clear()
|
||||||
for tag in self.tags:
|
for tag in self.tags:
|
||||||
self.applied_tags.addItem(tag)
|
self.applied_tags.addItem(tag)
|
||||||
|
|
||||||
self.available_tags.sortItems()
|
items = [unicode(self.available_tags.item(x).text()) for x in
|
||||||
|
range(self.available_tags.count())]
|
||||||
|
items.sort(cmp=self.tag_cmp)
|
||||||
|
self.available_tags.clear()
|
||||||
|
for item in items:
|
||||||
|
self.available_tags.addItem(item)
|
||||||
|
|
||||||
def add_tag(self):
|
def add_tag(self):
|
||||||
tags = unicode(self.add_tag_input.text()).split(',')
|
tags = unicode(self.add_tag_input.text()).split(',')
|
||||||
@ -109,7 +117,7 @@ class TagEditor(QDialog, Ui_TagEditor):
|
|||||||
if tag not in self.tags:
|
if tag not in self.tags:
|
||||||
self.tags.append(tag)
|
self.tags.append(tag)
|
||||||
|
|
||||||
self.tags.sort()
|
self.tags.sort(cmp=self.tag_cmp)
|
||||||
self.applied_tags.clear()
|
self.applied_tags.clear()
|
||||||
for tag in self.tags:
|
for tag in self.tags:
|
||||||
self.applied_tags.addItem(tag)
|
self.applied_tags.addItem(tag)
|
||||||
|
@ -122,6 +122,7 @@ class FieldMetadata(dict):
|
|||||||
'is_category':True}),
|
'is_category':True}),
|
||||||
('tags', {'table':'tags',
|
('tags', {'table':'tags',
|
||||||
'column':'name',
|
'column':'name',
|
||||||
|
'link_column': 'tag',
|
||||||
'datatype':'text',
|
'datatype':'text',
|
||||||
'is_multiple':',',
|
'is_multiple':',',
|
||||||
'kind':'field',
|
'kind':'field',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user