mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
KG updates
This commit is contained in:
commit
aafd1c81c6
@ -5,7 +5,7 @@ from calibre.web.feeds.recipes import BasicNewsRecipe
|
|||||||
class IHNed(BasicNewsRecipe):
|
class IHNed(BasicNewsRecipe):
|
||||||
|
|
||||||
|
|
||||||
stahnout_vsechny = False
|
stahnout_vsechny = True
|
||||||
#True = stahuje vsechny z homepage
|
#True = stahuje vsechny z homepage
|
||||||
#False = stahuje pouze dnesni clanky (ze dne, kdy je skript spusten)
|
#False = stahuje pouze dnesni clanky (ze dne, kdy je skript spusten)
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ class ANDROID(USBMS):
|
|||||||
|
|
||||||
# Google
|
# Google
|
||||||
0x18d1 : { 0x4e11 : [0x0100, 0x226, 0x227], 0x4e12: [0x0100, 0x226,
|
0x18d1 : { 0x4e11 : [0x0100, 0x226, 0x227], 0x4e12: [0x0100, 0x226,
|
||||||
0x227], 0x4e21: [0x0100, 0x226, 0x227]},
|
0x227], 0x4e21: [0x0100, 0x226, 0x227], 0xb058: [0x0222]},
|
||||||
|
|
||||||
# Samsung
|
# Samsung
|
||||||
0x04e8 : { 0x681d : [0x0222, 0x0223, 0x0224, 0x0400],
|
0x04e8 : { 0x681d : [0x0222, 0x0223, 0x0224, 0x0400],
|
||||||
@ -64,12 +64,13 @@ class ANDROID(USBMS):
|
|||||||
EXTRA_CUSTOMIZATION_DEFAULT = ', '.join(EBOOK_DIR_MAIN)
|
EXTRA_CUSTOMIZATION_DEFAULT = ', '.join(EBOOK_DIR_MAIN)
|
||||||
|
|
||||||
VENDOR_NAME = ['HTC', 'MOTOROLA', 'GOOGLE_', 'ANDROID', 'ACER',
|
VENDOR_NAME = ['HTC', 'MOTOROLA', 'GOOGLE_', 'ANDROID', 'ACER',
|
||||||
'GT-I5700', 'SAMSUNG', 'DELL', 'LINUX', 'GOOGLE', 'ARCHOS']
|
'GT-I5700', 'SAMSUNG', 'DELL', 'LINUX', 'GOOGLE', 'ARCHOS',
|
||||||
|
'TELECHIP']
|
||||||
WINDOWS_MAIN_MEM = ['ANDROID_PHONE', 'A855', 'A853', 'INC.NEXUS_ONE',
|
WINDOWS_MAIN_MEM = ['ANDROID_PHONE', 'A855', 'A853', 'INC.NEXUS_ONE',
|
||||||
'__UMS_COMPOSITE', '_MB200', 'MASS_STORAGE', '_-_CARD', 'SGH-I897',
|
'__UMS_COMPOSITE', '_MB200', 'MASS_STORAGE', '_-_CARD', 'SGH-I897',
|
||||||
'GT-I9000', 'FILE-STOR_GADGET', 'SGH-T959', 'SAMSUNG_ANDROID',
|
'GT-I9000', 'FILE-STOR_GADGET', 'SGH-T959', 'SAMSUNG_ANDROID',
|
||||||
'SCH-I500_CARD', 'SPH-D700_CARD', 'MB810', 'GT-P1000', 'DESIRE',
|
'SCH-I500_CARD', 'SPH-D700_CARD', 'MB810', 'GT-P1000', 'DESIRE',
|
||||||
'SGH-T849', '_MB300', 'A70S']
|
'SGH-T849', '_MB300', 'A70S', 'S_ANDROID']
|
||||||
WINDOWS_CARD_A_MEM = ['ANDROID_PHONE', 'GT-I9000_CARD', 'SGH-I897',
|
WINDOWS_CARD_A_MEM = ['ANDROID_PHONE', 'GT-I9000_CARD', 'SGH-I897',
|
||||||
'FILE-STOR_GADGET', 'SGH-T959', 'SAMSUNG_ANDROID', 'GT-P1000_CARD',
|
'FILE-STOR_GADGET', 'SGH-T959', 'SAMSUNG_ANDROID', 'GT-P1000_CARD',
|
||||||
'A70S']
|
'A70S']
|
||||||
|
@ -193,6 +193,9 @@ class LUMIREAD(USBMS):
|
|||||||
|
|
||||||
THUMBNAIL_HEIGHT = 200
|
THUMBNAIL_HEIGHT = 200
|
||||||
|
|
||||||
|
VENDOR_NAME = 'ACER'
|
||||||
|
WINDOWS_MAIN_MEM = WINDOWS_CARD_A_MEM = 'LUMIREAD_600'
|
||||||
|
|
||||||
def upload_cover(self, path, filename, metadata, filepath):
|
def upload_cover(self, path, filename, metadata, filepath):
|
||||||
if metadata.thumbnail and metadata.thumbnail[-1]:
|
if metadata.thumbnail and metadata.thumbnail[-1]:
|
||||||
cfilepath = filepath.replace('/', os.sep)
|
cfilepath = filepath.replace('/', os.sep)
|
||||||
|
@ -85,6 +85,9 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QCheckBox" name="opt_use_subdirs">
|
<widget class="QCheckBox" name="opt_use_subdirs">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>If checked, books are placed into sub directories based on their metadata on the device. If unchecked, books are all put into the top level directory.</string>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Use sub directories</string>
|
<string>Use sub directories</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -292,7 +292,7 @@ class CcEnumDelegate(QStyledItemDelegate): # {{{
|
|||||||
def createEditor(self, parent, option, index):
|
def createEditor(self, parent, option, index):
|
||||||
m = index.model()
|
m = index.model()
|
||||||
col = m.column_map[index.column()]
|
col = m.column_map[index.column()]
|
||||||
editor = QComboBox(parent)
|
editor = DelegateCB(parent)
|
||||||
editor.addItem('')
|
editor.addItem('')
|
||||||
for v in m.custom_columns[col]['display']['enum_values']:
|
for v in m.custom_columns[col]['display']['enum_values']:
|
||||||
editor.addItem(v)
|
editor.addItem(v)
|
||||||
@ -353,6 +353,17 @@ class CcCommentsDelegate(QStyledItemDelegate): # {{{
|
|||||||
model.setData(index, QVariant(editor.textbox.html), Qt.EditRole)
|
model.setData(index, QVariant(editor.textbox.html), Qt.EditRole)
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
class DelegateCB(QComboBox): # {{{
|
||||||
|
|
||||||
|
def __init__(self, parent):
|
||||||
|
QComboBox.__init__(self, parent)
|
||||||
|
|
||||||
|
def event(self, e):
|
||||||
|
if e.type() == e.ShortcutOverride:
|
||||||
|
e.accept()
|
||||||
|
return QComboBox.event(self, e)
|
||||||
|
# }}}
|
||||||
|
|
||||||
class CcBoolDelegate(QStyledItemDelegate): # {{{
|
class CcBoolDelegate(QStyledItemDelegate): # {{{
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
'''
|
'''
|
||||||
@ -361,7 +372,7 @@ class CcBoolDelegate(QStyledItemDelegate): # {{{
|
|||||||
QStyledItemDelegate.__init__(self, parent)
|
QStyledItemDelegate.__init__(self, parent)
|
||||||
|
|
||||||
def createEditor(self, parent, option, index):
|
def createEditor(self, parent, option, index):
|
||||||
editor = QComboBox(parent)
|
editor = DelegateCB(parent)
|
||||||
items = [_('Y'), _('N'), ' ']
|
items = [_('Y'), _('N'), ' ']
|
||||||
icons = [I('ok.png'), I('list_remove.png'), I('blank.png')]
|
icons = [I('ok.png'), I('list_remove.png'), I('blank.png')]
|
||||||
if tweaks['bool_custom_columns_are_tristate'] == 'no':
|
if tweaks['bool_custom_columns_are_tristate'] == 'no':
|
||||||
|
@ -46,6 +46,14 @@ local_tz = _local_tz = SafeLocalTimeZone()
|
|||||||
|
|
||||||
UNDEFINED_DATE = datetime(101,1,1, tzinfo=utc_tz)
|
UNDEFINED_DATE = datetime(101,1,1, tzinfo=utc_tz)
|
||||||
|
|
||||||
|
def is_date_undefined(qt_or_dt):
|
||||||
|
d = qt_or_dt
|
||||||
|
if hasattr(d, 'toString'):
|
||||||
|
d = datetime(d.year(), d.month(), d.day(), tzinfo=utc_tz)
|
||||||
|
return d.year == UNDEFINED_DATE.year and \
|
||||||
|
d.month == UNDEFINED_DATE.month and \
|
||||||
|
d.day == UNDEFINED_DATE.day
|
||||||
|
|
||||||
def parse_date(date_string, assume_utc=False, as_utc=True, default=None):
|
def parse_date(date_string, assume_utc=False, as_utc=True, default=None):
|
||||||
'''
|
'''
|
||||||
Parse a date/time string into a timezone aware datetime object. The timezone
|
Parse a date/time string into a timezone aware datetime object. The timezone
|
||||||
|
@ -554,6 +554,8 @@ class SMTP:
|
|||||||
|
|
||||||
def encode_cram_md5(challenge, user, password):
|
def encode_cram_md5(challenge, user, password):
|
||||||
challenge = base64.decodestring(challenge)
|
challenge = base64.decodestring(challenge)
|
||||||
|
if isinstance(password, unicode): # Added by Kovid, see http://bugs.python.org/issue5285
|
||||||
|
password = password.encode('utf-8')
|
||||||
response = user + " " + hmac.HMAC(password, challenge).hexdigest()
|
response = user + " " + hmac.HMAC(password, challenge).hexdigest()
|
||||||
return encode_base64(response, eol="")
|
return encode_base64(response, eol="")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user