mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Add beta launcher
This commit is contained in:
parent
7093f7e80f
commit
fb2a358c73
1
setup.py
1
setup.py
@ -31,6 +31,7 @@ entry_points = {
|
|||||||
'web2disk = libprs500.web.fetch.simple:main',\
|
'web2disk = libprs500.web.fetch.simple:main',\
|
||||||
'web2lrf = libprs500.ebooks.lrf.web.convert_from:main',\
|
'web2lrf = libprs500.ebooks.lrf.web.convert_from:main',\
|
||||||
'pdf2lrf = libprs500.ebooks.lrf.pdf.convert_from:main',\
|
'pdf2lrf = libprs500.ebooks.lrf.pdf.convert_from:main',\
|
||||||
|
'libprs500-beta = libprs500.gui2.main:main',\
|
||||||
],
|
],
|
||||||
'gui_scripts' : [ APPNAME+' = libprs500.gui.main:main']
|
'gui_scripts' : [ APPNAME+' = libprs500.gui.main:main']
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
## with this program; if not, write to the Free Software Foundation, Inc.,
|
## with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
''' E-book management software'''
|
''' E-book management software'''
|
||||||
__version__ = "0.3.84"
|
__version__ = "0.3.86"
|
||||||
__docformat__ = "epytext"
|
__docformat__ = "epytext"
|
||||||
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
|
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
|
||||||
__appname__ = 'libprs500'
|
__appname__ = 'libprs500'
|
||||||
|
@ -2,7 +2,7 @@ UI = main_ui.py dialogs/metadata_single_ui.py dialogs/metadata_bulk_ui.py dialog
|
|||||||
RC = images_rc.pyc
|
RC = images_rc.pyc
|
||||||
|
|
||||||
%_ui.py : %.ui
|
%_ui.py : %.ui
|
||||||
pyuic4 $< > $@
|
pyuic4 $< | sed "s/import images_rc/from libprs500.gui2 import images_rc/" > $@
|
||||||
|
|
||||||
%_rc.pyc : %.qrc %
|
%_rc.pyc : %.qrc %
|
||||||
pyrcc4 $< > $*_rc.py
|
pyrcc4 $< > $*_rc.py
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
## You should have received a copy of the GNU General Public License along
|
## 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.,
|
## with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
|
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
|
||||||
|
from libprs500.ptempfile import PersistentTemporaryFile
|
||||||
import os, tempfile, sys, traceback
|
import os, tempfile, sys, traceback
|
||||||
|
|
||||||
from PyQt4.QtCore import Qt, SIGNAL, QObject, QCoreApplication, \
|
from PyQt4.QtCore import Qt, SIGNAL, QObject, QCoreApplication, \
|
||||||
@ -485,40 +486,25 @@ class Main(QObject, Ui_MainWindow):
|
|||||||
|
|
||||||
def unhandled_exception(self, type, value, tb):
|
def unhandled_exception(self, type, value, tb):
|
||||||
traceback.print_exception(type, value, tb, file=sys.stderr)
|
traceback.print_exception(type, value, tb, file=sys.stderr)
|
||||||
|
if type == KeyboardInterrupt:
|
||||||
|
self.window.close()
|
||||||
|
self.window.thread().exit(0)
|
||||||
fe = '\n'.join(traceback.format_exception(type, value, tb))
|
fe = '\n'.join(traceback.format_exception(type, value, tb))
|
||||||
msg = '<p><b>' + str(value) + '</b></p>'
|
msg = '<p><b>' + str(value) + '</b></p>'
|
||||||
msg += '<p>Detailed <b>traceback</b>:<pre>'+fe+'</pre>'
|
msg += '<p>Detailed <b>traceback</b>:<pre>'+fe+'</pre>'
|
||||||
d = error_dialog(self.window, 'ERROR: Unhandled exception', msg)
|
d = error_dialog(self.window, 'ERROR: Unhandled exception', msg)
|
||||||
d.exec_()
|
d.exec_()
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
lock = os.path.join(tempfile.gettempdir(),"libprs500_gui_lock")
|
|
||||||
if os.access(lock, os.F_OK):
|
|
||||||
print >>sys.stderr, "Another instance of", APP_TITLE, "is running"
|
|
||||||
print >>sys.stderr, "If you are sure this is not the case then "+\
|
|
||||||
"manually delete the file", lock
|
|
||||||
sys.exit(1)
|
|
||||||
from PyQt4.Qt import QApplication, QMainWindow
|
from PyQt4.Qt import QApplication, QMainWindow
|
||||||
app = QApplication(sys.argv)
|
app = QApplication(sys.argv)
|
||||||
#from IPython.Shell import IPShellEmbed
|
|
||||||
#ipshell = IPShellEmbed([],
|
|
||||||
# banner = 'Dropping into IPython',
|
|
||||||
# exit_msg = 'Leaving Interpreter, back to program.')
|
|
||||||
#ipshell()
|
|
||||||
#return 0
|
|
||||||
window = QMainWindow()
|
window = QMainWindow()
|
||||||
window.setWindowTitle(APP_TITLE)
|
window.setWindowTitle(APP_TITLE)
|
||||||
QCoreApplication.setOrganizationName("KovidsBrain")
|
QCoreApplication.setOrganizationName("KovidsBrain")
|
||||||
QCoreApplication.setApplicationName(APP_TITLE)
|
QCoreApplication.setApplicationName(APP_TITLE)
|
||||||
initialize_file_icon_provider()
|
initialize_file_icon_provider()
|
||||||
main = Main(window)
|
main = Main(window)
|
||||||
def unhandled_exception(type, value, tb):
|
sys.excepthook = main.unhandled_exception
|
||||||
import traceback
|
|
||||||
traceback.print_exception(type, value, tb, file=sys.stderr)
|
|
||||||
if type == KeyboardInterrupt:
|
|
||||||
main.window.close()
|
|
||||||
sys.excepthook = main.unhandled_exception
|
|
||||||
|
|
||||||
return app.exec_()
|
return app.exec_()
|
||||||
|
|
||||||
|
|
||||||
|
14
upload.py
14
upload.py
@ -89,6 +89,7 @@ def upload_docs():
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
upload = len(sys.argv) < 2
|
||||||
shutil.rmtree('build')
|
shutil.rmtree('build')
|
||||||
os.mkdir('build')
|
os.mkdir('build')
|
||||||
shutil.rmtree('docs')
|
shutil.rmtree('docs')
|
||||||
@ -99,12 +100,13 @@ def main():
|
|||||||
dmg = build_osx()
|
dmg = build_osx()
|
||||||
print 'Building Windows installer...'
|
print 'Building Windows installer...'
|
||||||
exe = build_windows()
|
exe = build_windows()
|
||||||
print 'Uploading installers...'
|
if upload:
|
||||||
upload_installers(exe, dmg)
|
print 'Uploading installers...'
|
||||||
print 'Uploading to PyPI'
|
upload_installers(exe, dmg)
|
||||||
check_call('''python setup.py register bdist_egg --exclude-source-files upload''')
|
print 'Uploading to PyPI'
|
||||||
upload_docs()
|
check_call('''python setup.py register bdist_egg --exclude-source-files upload''')
|
||||||
check_call('''rm -rf dist/* build/*''')
|
upload_docs()
|
||||||
|
check_call('''rm -rf dist/* build/*''')
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
@ -190,7 +190,7 @@ Section "Device Drivers" "secdd"
|
|||||||
IfErrors 0 +3
|
IfErrors 0 +3
|
||||||
MessageBox MB_OK|MB_ICONINFORMATION|MB_TOPMOST "Failed to install USB driver. devcon exit code: $0"
|
MessageBox MB_OK|MB_ICONINFORMATION|MB_TOPMOST "Failed to install USB driver. devcon exit code: $0"
|
||||||
Goto +2
|
Goto +2
|
||||||
MessageBox MB_OK 'If you have the SONY Connect Reader software installed: $\nGoto Add Remove Programs and uninstall the entry "Windows Driver Package - Sony Corporation (PRSUSB)". $\n$\nIf your reader is connected to the computer, disconnect and reconnect it now.'
|
MessageBox MB_OK '1. If you have the SONY Connect Reader software installed: $\nGoto Add Remove Programs and uninstall the entry "Windows Driver Package - Sony Corporation (PRSUSB)". $\n$\n2. If your reader is connected to the computer, disconnect and reconnect it now.'
|
||||||
DetailPrint " "
|
DetailPrint " "
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user