mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #31
This commit is contained in:
parent
379a5f1a5a
commit
50811803d0
@ -33,7 +33,7 @@ You may have to adjust the GROUP and the location of the rules file to
|
||||
suit your distribution.
|
||||
"""
|
||||
|
||||
__version__ = "0.3.14"
|
||||
__version__ = "0.3.15"
|
||||
__docformat__ = "epytext"
|
||||
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
|
||||
|
||||
|
@ -13,11 +13,7 @@
|
||||
## with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
|
||||
""" Create and launch the GUI """
|
||||
import sys
|
||||
import re
|
||||
import os
|
||||
import traceback
|
||||
import tempfile
|
||||
import sys, re, os, traceback, tempfile
|
||||
|
||||
from PyQt4.QtCore import Qt, SIGNAL, QObject, QCoreApplication, \
|
||||
QSettings, QVariant, QSize, QEventLoop, QString, \
|
||||
|
@ -25,6 +25,7 @@ from math import sin, cos, pi
|
||||
|
||||
from libprs500.gui import Error, _Warning
|
||||
from libprs500.ptempfile import PersistentTemporaryFile
|
||||
from libprs500 import iswindows
|
||||
|
||||
from PyQt4.QtCore import Qt, SIGNAL
|
||||
from PyQt4.Qt import QApplication, QString, QFont, QAbstractListModel, \
|
||||
@ -67,6 +68,8 @@ class FileDragAndDrop(object):
|
||||
_Warning(o.scheme + " not supported in drop events", None)
|
||||
continue
|
||||
path = unquote(o.path)
|
||||
if iswindows and path.startswith('/'):
|
||||
path = path[1:]
|
||||
if not os.access(path, os.R_OK):
|
||||
_Warning("You do not have read permission for: " + path, None)
|
||||
continue
|
||||
|
@ -680,7 +680,12 @@ class PRS500(Device):
|
||||
while data_left:
|
||||
data = array('B')
|
||||
try:
|
||||
data.fromfile(infile, chunk_size)
|
||||
# Cannot use data.fromfile(infile, chunk_size) as it
|
||||
# doesn't work in windows w/ python 2.5.1
|
||||
ind = infile.read(chunk_size)
|
||||
data.fromstring(ind)
|
||||
if len(ind) < chunk_size:
|
||||
raise EOFError
|
||||
except EOFError:
|
||||
data_left = False
|
||||
res = self.send_validated_command(FileIO(_id, pos, len(data), \
|
||||
|
Loading…
x
Reference in New Issue
Block a user