mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Cleanups
This commit is contained in:
parent
cbee2f88f4
commit
40f5d79b61
@ -12,8 +12,6 @@
|
||||
## You should have received a copy of the GNU General Public License along
|
||||
## with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
from libprs500.ebooks.lrf.fonts.prs500 import tt0419m_
|
||||
from libprs500.ebooks.lrf.fonts.prs500 import tt0011m_
|
||||
import sys, os
|
||||
from libprs500 import iswindows
|
||||
from libprs500.ptempfile import PersistentTemporaryFile
|
||||
|
@ -1151,11 +1151,11 @@ class TextStyle(LrsStyle):
|
||||
fontfacename="Dutch801 Rm BT Roman",
|
||||
textcolor="0x00000000", wordspace="25", letterspace="0",
|
||||
baselineskip="120", linespace="10", parindent="0", parskip="0",
|
||||
textbgcolor="0xFF000000", emplinetype="solid", emplineposition="after")
|
||||
textbgcolor="0xFF000000")
|
||||
|
||||
alsoAllow = ["empdotscode", "empdotsfontname", "refempdotsfont",
|
||||
"rubyadjust", "rubyalign", "rubyoverhang",
|
||||
"empdotsposition"]
|
||||
"empdotsposition", 'emplinetype', 'emplineposition']
|
||||
|
||||
validSettings = baseDefaults.keys() + alsoAllow
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
UI = main_ui.py dialogs/metadata_single_ui.py dialogs/metadata_bulk_ui.py dialogs/jobs_ui.py \
|
||||
dialogs/conversion_error_ui.py dialogs/lrf_single_ui.py dialogs/choose_format_ui.py \
|
||||
dialogs/password_ui.py
|
||||
dialogs/password_ui.py lrf_renderer/main_ui.py
|
||||
RC = images_rc.pyc
|
||||
|
||||
%_ui.py : %.ui
|
||||
@ -18,3 +18,6 @@ clean :
|
||||
|
||||
test : all
|
||||
python main.py
|
||||
|
||||
lrfviewer: all
|
||||
python lrf_renderer/main.py
|
||||
|
@ -18,7 +18,9 @@ from PyQt4.QtCore import QVariant, QSettings, QFileInfo, QObject, SIGNAL, QBuffe
|
||||
QByteArray
|
||||
from PyQt4.QtGui import QFileDialog, QMessageBox, QPixmap, QFileIconProvider, \
|
||||
QIcon, QTableView
|
||||
from libprs500 import __appname__ as APP_TITLE
|
||||
|
||||
ORG_NAME = 'KovidsBrain'
|
||||
APP_UID = 'libprs500'
|
||||
from libprs500 import __author__, islinux
|
||||
NONE = QVariant() #: Null value to return from the data function of item models
|
||||
|
||||
|
@ -12,7 +12,6 @@
|
||||
## You should have received a copy of the GNU General Public License along
|
||||
## with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
|
||||
from libprs500.gui2.dialogs.password import PasswordDialog
|
||||
import os, sys, traceback, StringIO, textwrap
|
||||
|
||||
from PyQt4.QtCore import Qt, SIGNAL, QObject, QCoreApplication, \
|
||||
@ -28,9 +27,9 @@ from libprs500.ebooks.lrf.web.convert_from import main as web2lrf
|
||||
from libprs500.ebooks.lrf.any.convert_from import main as any2lrf
|
||||
from libprs500.devices.errors import FreeSpaceError
|
||||
from libprs500.devices.interface import Device
|
||||
from libprs500.gui2 import APP_TITLE, warning_dialog, choose_files, error_dialog, \
|
||||
from libprs500.gui2 import APP_UID, warning_dialog, choose_files, error_dialog, \
|
||||
initialize_file_icon_provider, BOOK_EXTENSIONS, \
|
||||
pixmap_to_data, choose_dir
|
||||
pixmap_to_data, choose_dir, ORG_NAME
|
||||
from libprs500.gui2.main_ui import Ui_MainWindow
|
||||
from libprs500.gui2.device import DeviceDetector, DeviceManager
|
||||
from libprs500.gui2.status import StatusBar
|
||||
@ -40,7 +39,7 @@ from libprs500.gui2.dialogs.metadata_bulk import MetadataBulkDialog
|
||||
from libprs500.gui2.dialogs.jobs import JobsDialog
|
||||
from libprs500.gui2.dialogs.conversion_error import ConversionErrorDialog
|
||||
from libprs500.gui2.dialogs.lrf_single import LRFSingleDialog
|
||||
|
||||
from libprs500.gui2.dialogs.password import PasswordDialog
|
||||
|
||||
class Main(QObject, Ui_MainWindow):
|
||||
|
||||
@ -671,9 +670,6 @@ class Main(QObject, Ui_MainWindow):
|
||||
traceback.print_exception(type, value, tb, file=sio)
|
||||
fe = sio.getvalue()
|
||||
print >>sys.stderr, fe
|
||||
if type == KeyboardInterrupt:
|
||||
self.window.close()
|
||||
self.window.thread().exit(0)
|
||||
msg = '<p><b>' + unicode(str(value), 'utf8', 'replace') + '</b></p>'
|
||||
msg += '<p>Detailed <b>traceback</b>:<pre>'+fe+'</pre>'
|
||||
d = ConversionErrorDialog(self.window, 'ERROR: Unhandled exception', msg)
|
||||
@ -685,13 +681,13 @@ def main(args=sys.argv):
|
||||
if pid <= 0:
|
||||
app = QApplication(args)
|
||||
window = QMainWindow()
|
||||
window.setWindowTitle(APP_TITLE)
|
||||
QCoreApplication.setOrganizationName("KovidsBrain")
|
||||
QCoreApplication.setApplicationName(APP_TITLE)
|
||||
|
||||
window.setWindowTitle(__appname__)
|
||||
QCoreApplication.setOrganizationName(ORG_NAME)
|
||||
QCoreApplication.setApplicationName(APP_UID)
|
||||
initialize_file_icon_provider()
|
||||
main = Main(window)
|
||||
sys.excepthook = main.unhandled_exception
|
||||
QObject.connect(app, SIGNAL('lastWindowClosed()'), app.quit)
|
||||
return app.exec_()
|
||||
return 0
|
||||
|
||||
|
@ -73,7 +73,7 @@ def setup_completion():
|
||||
from libprs500.ebooks.lrf.html.convert_from import option_parser as htmlop
|
||||
from libprs500.ebooks.lrf.txt.convert_from import option_parser as txtop
|
||||
from libprs500.ebooks.lrf.meta import option_parser as metaop
|
||||
from libprs500.ebooks.lrf.lrs.convert_to import option_parser as lrf2lrsop
|
||||
from libprs500.ebooks.lrf.parser import option_parser as lrf2lrsop
|
||||
f = open('/etc/bash_completion.d/libprs500', 'wb')
|
||||
f.write('# libprs500 Bash Shell Completion\n')
|
||||
f.write(opts_and_exts('html2lrf', htmlop,
|
||||
@ -171,10 +171,11 @@ complete -o nospace -F _prs500 prs500
|
||||
def setup_udev_rules():
|
||||
print 'Trying to setup udev rules...',
|
||||
sys.stdout.flush()
|
||||
groups = open('/etc/group', 'rb').read()
|
||||
group = 'plugdev' if 'plugdev' in groups else 'usb'
|
||||
udev = open('/etc/udev/rules.d/95-libprs500.rules', 'w')
|
||||
udev.write('''# Sony Reader PRS-500\n'''
|
||||
'''BUS=="usb", SYSFS{idProduct}=="029b", SYSFS{idVendor}=="054c", MODE="660", GROUP="plugdev"\n'''
|
||||
'''BUS=="usb", SYSFS{idProduct}=="029b", SYSFS{idVendor}=="054c", MODE="660", GROUP="usb"\n'''
|
||||
'''BUS=="usb", SYSFS{idProduct}=="029b", SYSFS{idVendor}=="054c", MODE="660", GROUP="%s"\n'''%(group,)
|
||||
)
|
||||
udev.close()
|
||||
try:
|
||||
|
@ -293,8 +293,8 @@ def option_parser(usage='%prog URL\n\nWhere URL is for example http://google.com
|
||||
default='.', type='string', dest='dir')
|
||||
parser.add_option('-t', '--timeout', help='Timeout in seconds to wait for a response from the server. Default: %default s',
|
||||
default=10, type='int', dest='timeout')
|
||||
parser.add_option('-r', '--max-recursions', help='Maximum number of levels to recurse i.e. depth of links to follow. Default %default',
|
||||
default=1, type='int', dest='max_recursions')
|
||||
parser.add_option('-r', '--max-recursions', default=1, help='Maximum number of levels to recurse i.e. depth of links to follow. Default %default',
|
||||
type='int', dest='max_recursions')
|
||||
parser.add_option('-n', '--max-files', default=sys.maxint, type='int', dest='max_files',
|
||||
help='The maximum number of files to download. This only applies to files from <a href> tags. Default is %default')
|
||||
parser.add_option('--delay', default=0, dest='delay', type='int',
|
||||
|
Loading…
x
Reference in New Issue
Block a user