mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Sync to trunk.
This commit is contained in:
commit
efde939ffb
@ -365,8 +365,8 @@ class Device(DeviceConfig, DevicePlugin):
|
|||||||
ok[node] = False
|
ok[node] = False
|
||||||
except:
|
except:
|
||||||
ok[node] = False
|
ok[node] = False
|
||||||
if ok[node]:
|
devnodes.append(node)
|
||||||
devnodes.append(node)
|
|
||||||
devnodes += list(repeat(None, 3))
|
devnodes += list(repeat(None, 3))
|
||||||
ans = tuple(['/dev/'+x if ok.get(x, False) else None for x in devnodes[:3]])
|
ans = tuple(['/dev/'+x if ok.get(x, False) else None for x in devnodes[:3]])
|
||||||
return self.linux_swap_drives(ans)
|
return self.linux_swap_drives(ans)
|
||||||
@ -423,7 +423,7 @@ class Device(DeviceConfig, DevicePlugin):
|
|||||||
label = self.STORAGE_CARD_VOLUME_LABEL + ' 2'
|
label = self.STORAGE_CARD_VOLUME_LABEL + ' 2'
|
||||||
extra = 0
|
extra = 0
|
||||||
while True:
|
while True:
|
||||||
q = '_(%d)'%extra if extra else ''
|
q = ' (%d)'%extra if extra else ''
|
||||||
if not os.path.exists('/media/'+label+q):
|
if not os.path.exists('/media/'+label+q):
|
||||||
break
|
break
|
||||||
extra += 1
|
extra += 1
|
||||||
@ -457,16 +457,16 @@ class Device(DeviceConfig, DevicePlugin):
|
|||||||
_('Unable to mount main memory (Error code: %d)')%ret)
|
_('Unable to mount main memory (Error code: %d)')%ret)
|
||||||
if not mp.endswith('/'): mp += '/'
|
if not mp.endswith('/'): mp += '/'
|
||||||
self._main_prefix = mp
|
self._main_prefix = mp
|
||||||
cards = [x for x in (carda, cardb) if x is not None]
|
cards = [(carda, '_card_a_prefix', 'carda'),
|
||||||
prefix, typ = '_card_a_prefix', 'carda'
|
(cardb, '_card_b_prefix', 'cardb')]
|
||||||
for card in cards:
|
for card, prefix, typ in cards:
|
||||||
|
if card is None: continue
|
||||||
mp, ret = mount(card, typ)
|
mp, ret = mount(card, typ)
|
||||||
if mp is None:
|
if mp is None:
|
||||||
print >>sys.stderr, 'Unable to mount card (Error code: %d)'%ret
|
print >>sys.stderr, 'Unable to mount card (Error code: %d)'%ret
|
||||||
else:
|
else:
|
||||||
if not mp.endswith('/'): mp += '/'
|
if not mp.endswith('/'): mp += '/'
|
||||||
setattr(self, prefix, mp)
|
setattr(self, prefix, mp)
|
||||||
prefix, typ = '_card_b_prefix', 'cardb'
|
|
||||||
|
|
||||||
def open(self):
|
def open(self):
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
|
@ -180,17 +180,23 @@ class LocationModel(QAbstractListModel):
|
|||||||
def rowCount(self, *args):
|
def rowCount(self, *args):
|
||||||
return 1 + len([i for i in self.free if i >= 0])
|
return 1 + len([i for i in self.free if i >= 0])
|
||||||
|
|
||||||
|
def get_device_row(self, row):
|
||||||
|
if row == 2 and self.free[1] == -1 and self.free[2] > -1:
|
||||||
|
row = 3
|
||||||
|
return row
|
||||||
|
|
||||||
def data(self, index, role):
|
def data(self, index, role):
|
||||||
row = index.row()
|
row = index.row()
|
||||||
|
drow = self.get_device_row(row)
|
||||||
data = NONE
|
data = NONE
|
||||||
if role == Qt.DisplayRole:
|
if role == Qt.DisplayRole:
|
||||||
text = self.text[row]%(human_readable(self.free[row-1])) if row > 0 \
|
text = self.text[drow]%(human_readable(self.free[drow-1])) if row > 0 \
|
||||||
else self.text[row]%self.count
|
else self.text[drow]%self.count
|
||||||
data = QVariant(text)
|
data = QVariant(text)
|
||||||
elif role == Qt.DecorationRole:
|
elif role == Qt.DecorationRole:
|
||||||
data = self.icons[row]
|
data = self.icons[drow]
|
||||||
elif role == Qt.ToolTipRole:
|
elif role == Qt.ToolTipRole:
|
||||||
data = QVariant(self.tooltips[row])
|
data = QVariant(self.tooltips[drow])
|
||||||
elif role == Qt.SizeHintRole:
|
elif role == Qt.SizeHintRole:
|
||||||
data = QVariant(QSize(155, 90))
|
data = QVariant(QSize(155, 90))
|
||||||
elif role == Qt.FontRole:
|
elif role == Qt.FontRole:
|
||||||
|
@ -26,7 +26,6 @@ class Guardian(BasicNewsRecipe):
|
|||||||
extra_css = 'h2 {font-size: medium;} \n h1 {text-align: left;}'
|
extra_css = 'h2 {font-size: medium;} \n h1 {text-align: left;}'
|
||||||
|
|
||||||
feeds = [
|
feeds = [
|
||||||
|
|
||||||
('Front Page', 'http://www.guardian.co.uk/rss'),
|
('Front Page', 'http://www.guardian.co.uk/rss'),
|
||||||
('Business', 'http://www.guardian.co.uk/business/rss'),
|
('Business', 'http://www.guardian.co.uk/business/rss'),
|
||||||
('Sport', 'http://www.guardian.co.uk/sport/rss'),
|
('Sport', 'http://www.guardian.co.uk/sport/rss'),
|
||||||
@ -37,4 +36,4 @@ class Guardian(BasicNewsRecipe):
|
|||||||
('Environment', 'http://www.guardian.co.uk/environment/rss'),
|
('Environment', 'http://www.guardian.co.uk/environment/rss'),
|
||||||
('Comment','http://www.guardian.co.uk/commentisfree/rss'),
|
('Comment','http://www.guardian.co.uk/commentisfree/rss'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user