From 05f7f42400cc90fc43b223309d7a93d1d4a419c7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 24 Aug 2009 08:44:58 -0600 Subject: [PATCH] IGN:Fix #2152 (Typo in GUI) --- installer/linux/freeze.py | 11 +++- setup.py | 4 +- src/calibre/ebooks/epub/output.py | 2 +- src/calibre/translations/calibre.pot | 65 ++++++++++----------- upload.py | 85 +++++++++++++++++++++------- 5 files changed, 111 insertions(+), 56 deletions(-) diff --git a/installer/linux/freeze.py b/installer/linux/freeze.py index 3b272551ff..c0f4edfd01 100644 --- a/installer/linux/freeze.py +++ b/installer/linux/freeze.py @@ -9,7 +9,7 @@ Create linux binary. ''' def freeze(): - import glob, sys, tarfile, os, textwrap, shutil + import glob, sys, tarfile, os, textwrap, shutil, platform from contextlib import closing from cx_Freeze import Executable, setup from calibre.constants import __version__, __appname__ @@ -19,6 +19,9 @@ def freeze(): from calibre.ebooks.lrf.fonts import FONT_MAP import calibre + is64bit = platform.architecture()[0] == '64bit' + arch = 'x86_64' if is64bit else 'i686' + QTDIR = '/usr/lib/qt4' QTDLLS = ('QtCore', 'QtGui', 'QtNetwork', 'QtSvg', 'QtXml', @@ -47,7 +50,8 @@ def freeze(): '/usr/lib/libxslt.so.1', '/usr/lib/libxslt.so.1', '/usr/lib/libgthread-2.0.so.0', - '/usr/lib/gcc/i686-pc-linux-gnu/4.3.3/libstdc++.so.6', + '/usr/lib/gcc/***-pc-linux-gnu/4.4.1/libstdc++.so.6'.replace('***', + arch).replace('i686', 'i486'), '/usr/lib/libpng12.so.0', '/usr/lib/libexslt.so.0', '/usr/lib/libMagickWand.so', @@ -228,7 +232,8 @@ def freeze(): open(os.path.join(FREEZE_DIR, 'manifest'), 'wb').write('\n'.join(exes)) print 'Creating archive...' - dist = open(os.path.join(DIST_DIR, 'calibre-%s-i686.tar.bz2'%__version__), 'wb') + dist = open(os.path.join(DIST_DIR, 'calibre-%s-%s.tar.bz2'%(__version__, + arch)), 'wb') with closing(tarfile.open(fileobj=dist, mode='w:bz2', format=tarfile.PAX_FORMAT)) as tf: for f in walk(FREEZE_DIR): diff --git a/setup.py b/setup.py index 439eef6ce2..ed372920de 100644 --- a/setup.py +++ b/setup.py @@ -71,7 +71,7 @@ if __name__ == '__main__': tag_release, upload_demo, build_linux, build_windows, \ build_osx, upload_installers, upload_user_manual, \ upload_to_pypi, stage3, stage2, stage1, upload, \ - upload_rss, betas + upload_rss, betas, build_linux32, build_linux64 entry_points['console_scripts'].append( 'calibre_postinstall = calibre.linux:post_install') @@ -258,6 +258,8 @@ if __name__ == '__main__': 'tag_release' : tag_release, 'upload_demo' : upload_demo, 'build_linux' : build_linux, + 'build_linux32' : build_linux32, + 'build_linux64' : build_linux64, 'build_windows' : build_windows, 'build_osx' : build_osx, 'upload_installers': upload_installers, diff --git a/src/calibre/ebooks/epub/output.py b/src/calibre/ebooks/epub/output.py index 8955906501..6c38a7d4d3 100644 --- a/src/calibre/ebooks/epub/output.py +++ b/src/calibre/ebooks/epub/output.py @@ -78,7 +78,7 @@ class EPUBOutput(OutputFormatPlugin): ), OptionRecommendation(name='no_default_epub_cover', recommended_value=False, - help=_('Normally, if the input file ahs no cover and you don\'t' + help=_('Normally, if the input file has no cover and you don\'t' ' specify one, a default cover is generated with the title, ' 'authors, etc. This option disables the generation of this cover.')), diff --git a/src/calibre/translations/calibre.pot b/src/calibre/translations/calibre.pot index cf2695ebb1..92b93cb92b 100644 --- a/src/calibre/translations/calibre.pot +++ b/src/calibre/translations/calibre.pot @@ -5,8 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: calibre 0.6.8\n" -"POT-Creation-Date: 2009-08-23 11:19+MDT\n" -"PO-Revision-Date: 2009-08-23 11:19+MDT\n" +"POT-Creation-Date: 2009-08-24 08:38+MDT\n" +"PO-Revision-Date: 2009-08-24 08:38+MDT\n" "Last-Translator: Automatically generated\n" "Language-Team: LANGUAGE\n" "MIME-Version: 1.0\n" @@ -937,7 +937,7 @@ msgid "Split all HTML files larger than this size (in KB). This is necessary as msgstr "" #: /home/kovid/work/calibre/src/calibre/ebooks/epub/output.py:81 -msgid "Normally, if the input file ahs no cover and you don't specify one, a default cover is generated with the title, authors, etc. This option disables the generation of this cover." +msgid "Normally, if the input file has no cover and you don't specify one, a default cover is generated with the title, authors, etc. This option disables the generation of this cover." msgstr "" #: /home/kovid/work/calibre/src/calibre/ebooks/fb2/fb2ml.py:123 @@ -3074,109 +3074,109 @@ msgstr "" msgid "new email address" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:507 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:508 msgid "No valid plugin path" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:508 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:509 msgid "%s is not a valid plugin path" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:511 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:512 msgid "Choose plugin" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:523 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:524 msgid "Plugin cannot be disabled" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:524 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:525 msgid "The plugin: %s cannot be disabled" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:533 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:534 msgid "Plugin not customizable" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:534 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:535 msgid "Plugin: %s does not need customization" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:558 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:559 msgid "Customize %s" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:568 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:569 msgid "Cannot remove builtin plugin" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:569 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:570 msgid " cannot be removed. It is a builtin plugin. Try disabling it instead." msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:602 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:603 msgid "Error log:" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:609 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:610 msgid "Access log:" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:634 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:635 #: /home/kovid/work/calibre/src/calibre/gui2/main.py:564 msgid "Failed to start content server" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:658 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:659 #: /home/kovid/work/calibre/src/calibre/gui2/wizard/__init__.py:469 msgid "Select location for books" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:675 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:676 msgid "Invalid size" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:676 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:677 msgid "The size %s is invalid. must be of the form widthxheight" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:720 -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:725 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:721 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:726 msgid "Invalid database location" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:721 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:722 msgid "Invalid database location " msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:722 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:723 msgid "
Must be a directory." msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:726 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:727 msgid "Invalid database location.
Cannot write to " msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:763 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:764 msgid "Checking database integrity" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:782 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:783 #: /home/kovid/work/calibre/src/calibre/gui2/main.py:141 #: /home/kovid/work/calibre/src/calibre/gui2/main.py:995 #: /home/kovid/work/calibre/src/calibre/utils/ipc/job.py:52 msgid "Error" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:783 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:784 msgid "Failed to check database integrity" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:788 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:789 msgid "Some inconsistencies found" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:789 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config/__init__.py:790 msgid "The following books had formats listed in the database that are not actually available. The entries for the formats have been removed. You should check them manually. This can happen if you manipulate the files in the library folder directly." msgstr "" @@ -6072,7 +6072,7 @@ msgstr "" msgid "Password to access your calibre library. Username is " msgstr "" -#: /home/kovid/work/calibre/src/calibre/library/server.py:523 +#: /home/kovid/work/calibre/src/calibre/library/server.py:526 msgid "" "[options]\n" "\n" @@ -6219,7 +6219,7 @@ msgid "\tFailed links:" msgstr "" #: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:682 -msgid "Could not fetch article. Run with --debug to see the reason" +msgid "Could not fetch article. Run with -vv to see the reason" msgstr "" #: /home/kovid/work/calibre/src/calibre/web/feeds/news.py:703 @@ -6309,6 +6309,7 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_7dias.py:23 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_ambito.py:61 +#: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_axxon_news.py:21 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_buenosaireseconomico.py:23 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_clarin.py:26 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_criticadigital.py:17 @@ -6422,7 +6423,7 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_nytimes.py:17 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_nytimes_sub.py:17 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_ourdailybread.py:16 -#: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_outlook_india.py:15 +#: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_outlook_india.py:17 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_phd_comics.py:16 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_physics_today.py:11 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_physics_world.py:8 diff --git a/upload.py b/upload.py index 8dac5af79c..e82946af37 100644 --- a/upload.py +++ b/upload.py @@ -4,7 +4,7 @@ __copyright__ = '2009, Kovid Goyal ' __docformat__ = 'restructuredtext en' import shutil, os, glob, re, cStringIO, sys, tempfile, time, textwrap, socket, \ - struct, subprocess + struct, subprocess, platform from datetime import datetime from setuptools.command.build_py import build_py as _build_py, convert_path from distutils.core import Command @@ -24,6 +24,7 @@ HTML2LRF = "src/calibre/ebooks/lrf/html/demo" TXT2LRF = "src/calibre/ebooks/lrf/txt/demo" MOBILEREAD = 'ftp://dev.mobileread.com/calibre/' +is64bit = platform.architecture()[0] == '64bit' def get_ip_address(ifname): import fcntl @@ -35,7 +36,7 @@ def get_ip_address(ifname): )[20:24]) try: - HOST=get_ip_address('eth0') + HOST=get_ip_address('br0') except: try: HOST=get_ip_address('wlan0') @@ -481,12 +482,12 @@ class upload_demo(OptionlessCommand): def installer_name(ext): if ext in ('exe', 'dmg'): return 'dist/%s-%s.%s'%(__appname__, __version__, ext) - return 'dist/%s-%s-i686.%s'%(__appname__, __version__, ext) + ans = 'dist/%s-%s-i686.%s'%(__appname__, __version__, ext) + if is64bit: + ans = ans.replace('i686', 'x86_64') + return ans - -class build_linux(OptionlessCommand): - description = 'Build linux installer' - def run(self): +def _build_linux(): installer = installer_name('tar.bz2') locals = {} exec open('installer/linux/freeze.py') in locals @@ -495,9 +496,15 @@ class build_linux(OptionlessCommand): raise Exception('Failed to build installer '+installer) return os.path.basename(installer) +class build_linux64(OptionlessCommand): + description = 'Build linux 64bit installer' + + def run(self): + return _build_linux() + class VMInstaller(OptionlessCommand): - user_options = [('dont-shutdown', 'd', 'Dont shutdown Vm after build')] + user_options = [('dont-shutdown', 'd', 'Dont shutdown VM after build')] boolean_options = ['dont-shutdown'] def initialize_options(self): @@ -521,10 +528,13 @@ class VMInstaller(OptionlessCommand): def get_build_script(self, subs): return self.BUILD_SCRIPT%subs - def start_vm(self, ssh_host, build_script, sleep=75): - build_script = self.get_build_script(build_script) + def run_vm(self): vmware = ('vmware', '-q', '-x', '-n', self.VM) - Popen(vmware) + self.__p = Popen(vmware) + + def start_vm(self, ssh_host, build_script, sleep=75): + self.run_vm() + build_script = self.get_build_script(build_script) t = tempfile.NamedTemporaryFile(suffix='.sh') t.write(build_script) t.flush() @@ -537,6 +547,28 @@ class VMInstaller(OptionlessCommand): check_call(('scp', t.name, ssh_host+':build-calibre')) check_call('ssh -t %s bash build-calibre'%ssh_host, shell=True) +class build_linux32(VMInstaller): + + description = 'Build linux 32bit installer' + + def run_vm(self): + self.__p = Popen('/vmware/bin/linux_build') + + def run(self): + if is64bit: + installer = installer_name('tar.bz2').replace('x86_64', 'i686') + self.start_vm('linux_build', ('python setup.py build_ext', + 'python', 'setup.py build_linux32')) + check_call(('scp', 'linux_build:build/calibre/dist/*.tar.bz2', 'dist')) + if not os.path.exists(installer): + raise Exception('Failed to build installer '+installer) + if not self.dont_shutdown: + Popen(('ssh', 'linux_build', 'sudo', '/sbin/poweroff')) + return os.path.basename(installer) + else: + return _build_linux() + + class build_windows(VMInstaller): description = 'Build windows installer' VM = '/mnt/backup/calibre_windows_xp_home/calibre_windows_xp_home.vmx' @@ -573,9 +605,7 @@ class build_windows(VMInstaller): class build_osx(VMInstaller): description = 'Build OS X app bundle' - VM = '/mnt/backup/calibre_os_x/Mac OSX.vmx' - if not os.path.exists(VM): - VM = '/home/kovid/calibre_os_x/Mac OSX.vmx' + VM = '/vmware/calibre_os_x/Mac OSX.vmx' def get_build_script(self, subs): return (self.BUILD_SCRIPT%subs).replace('rm ', 'sudo rm ') @@ -583,13 +613,25 @@ class build_osx(VMInstaller): def run(self): installer = installer_name('dmg') python = '/Library/Frameworks/Python.framework/Versions/Current/bin/python' - self.start_vm('osx', ('sudo %s setup.py develop'%python, python, + if os.path.exists('/dev/kvm'): + check_call('sudo rmmod -w kvm-intel kvm', shell=True) + check_call('sudo /etc/init.d/vmware restart', shell=True) + self.start_vm('osx_build', ('sudo %s setup.py develop'%python, python, 'installer/osx/freeze.py')) - check_call(('scp', 'osx:build/calibre/dist/*.dmg', 'dist')) + check_call(('scp', 'osx_build:build/calibre/dist/*.dmg', 'dist')) if not os.path.exists(installer): raise Exception('Failed to build installer '+installer) if not self.dont_shutdown: - Popen(('ssh', 'osx', 'sudo', '/sbin/shutdown', '-h', 'now')) + Popen(('ssh', 'osx_build', 'sudo', '/sbin/shutdown', '-h', 'now')) + time.sleep(20) + while True: + try: + check_call('sudo /etc/init.d/vmware stop', shell=True) + break + except: + pass + check_call('sudo modprobe kvm-intel', shell=True) + return os.path.basename(installer) @@ -661,8 +703,9 @@ class upload_installers(OptionlessCommand): def run(self): print 'Uploading installers...' - for i in ('dmg', 'exe', 'tar.bz2'): - self.upload_installer(installer_name(i)) + installers = list(map(installer_name, ('dmg', 'exe', 'tar.bz2'))) + installers.append(installers[-1].replace('x86_64', 'i686')) + map(self.upload_installer, installers) check_call('''ssh divok echo %s \\> %s/latest_version'''\ %(__version__, DOWNLOADS), shell=True) @@ -715,6 +758,10 @@ class stage3(OptionlessCommand): OptionlessCommand.run(self) self.misc() +class build_linux(OptionlessCommand): + description = 'Build linux installers' + sub_commands = [ ('build_linux64', None), ('build_linux32', None) ] + class stage2(OptionlessCommand): description = 'Stage 2 of the build process' sub_commands = [