Add beta launcher

This commit is contained in:
Kovid Goyal 2007-08-05 02:44:20 +00:00
parent 7093f7e80f
commit fb2a358c73
6 changed files with 19 additions and 30 deletions

View File

@ -31,6 +31,7 @@ entry_points = {
'web2disk = libprs500.web.fetch.simple:main',\
'web2lrf = libprs500.ebooks.lrf.web.convert_from:main',\
'pdf2lrf = libprs500.ebooks.lrf.pdf.convert_from:main',\
'libprs500-beta = libprs500.gui2.main:main',\
],
'gui_scripts' : [ APPNAME+' = libprs500.gui.main:main']
}

View File

@ -13,7 +13,7 @@
## with this program; if not, write to the Free Software Foundation, Inc.,
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
''' E-book management software'''
__version__ = "0.3.84"
__version__ = "0.3.86"
__docformat__ = "epytext"
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
__appname__ = 'libprs500'

View File

@ -2,7 +2,7 @@ UI = main_ui.py dialogs/metadata_single_ui.py dialogs/metadata_bulk_ui.py dialog
RC = images_rc.pyc
%_ui.py : %.ui
pyuic4 $< > $@
pyuic4 $< | sed "s/import images_rc/from libprs500.gui2 import images_rc/" > $@
%_rc.pyc : %.qrc %
pyrcc4 $< > $*_rc.py

View File

@ -12,6 +12,7 @@
## 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.ptempfile import PersistentTemporaryFile
import os, tempfile, sys, traceback
from PyQt4.QtCore import Qt, SIGNAL, QObject, QCoreApplication, \
@ -485,40 +486,25 @@ class Main(QObject, Ui_MainWindow):
def unhandled_exception(self, type, value, tb):
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))
msg = '<p><b>' + str(value) + '</b></p>'
msg += '<p>Detailed <b>traceback</b>:<pre>'+fe+'</pre>'
d = error_dialog(self.window, 'ERROR: Unhandled exception', msg)
d.exec_()
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)
def main():
from PyQt4.Qt import QApplication, QMainWindow
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.setWindowTitle(APP_TITLE)
QCoreApplication.setOrganizationName("KovidsBrain")
QCoreApplication.setApplicationName(APP_TITLE)
initialize_file_icon_provider()
main = Main(window)
def unhandled_exception(type, value, tb):
import traceback
traceback.print_exception(type, value, tb, file=sys.stderr)
if type == KeyboardInterrupt:
main.window.close()
sys.excepthook = main.unhandled_exception
main = Main(window)
sys.excepthook = main.unhandled_exception
return app.exec_()

View File

@ -89,6 +89,7 @@ def upload_docs():
def main():
upload = len(sys.argv) < 2
shutil.rmtree('build')
os.mkdir('build')
shutil.rmtree('docs')
@ -99,12 +100,13 @@ def main():
dmg = build_osx()
print 'Building Windows installer...'
exe = build_windows()
print 'Uploading installers...'
upload_installers(exe, dmg)
print 'Uploading to PyPI'
check_call('''python setup.py register bdist_egg --exclude-source-files upload''')
upload_docs()
check_call('''rm -rf dist/* build/*''')
if upload:
print 'Uploading installers...'
upload_installers(exe, dmg)
print 'Uploading to PyPI'
check_call('''python setup.py register bdist_egg --exclude-source-files upload''')
upload_docs()
check_call('''rm -rf dist/* build/*''')
if __name__ == '__main__':
main()

View File

@ -190,7 +190,7 @@ Section "Device Drivers" "secdd"
IfErrors 0 +3
MessageBox MB_OK|MB_ICONINFORMATION|MB_TOPMOST "Failed to install USB driver. devcon exit code: $0"
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 " "