IGN:Add a message explaining the change of database format

This commit is contained in:
Kovid Goyal 2008-09-03 20:51:56 -07:00
parent 201f7bd569
commit 6603854e6b
18 changed files with 5948 additions and 27877 deletions

View File

@ -2,7 +2,7 @@ __license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net' __copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
__docformat__ = 'restructuredtext en' __docformat__ = 'restructuredtext en'
__appname__ = 'calibre' __appname__ = 'calibre'
__version__ = '0.4.84b7' __version__ = '0.4.84b8'
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>" __author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
''' '''
Various run time constants. Various run time constants.

View File

@ -219,6 +219,12 @@ class Main(MainWindow, Ui_MainWindow):
db = LibraryDatabase2(self.library_path) db = LibraryDatabase2(self.library_path)
self.library_view.set_database(db) self.library_view.set_database(db)
if self.olddb is not None: if self.olddb is not None:
QMessageBox.information(self, 'Database format changed',
'''\
<p>calibre's book storage format has changed. Instead of storing book files in a database, the
files are now stored in a folder on your filesystem. You will now be asked to choose the folder
in which you want to store your books files. Any existing books will be automatically migrated.
''')
from PyQt4.QtGui import QProgressDialog from PyQt4.QtGui import QProgressDialog
pd = QProgressDialog('', '', 0, 100, self) pd = QProgressDialog('', '', 0, 100, self)
pd.setWindowModality(Qt.ApplicationModal) pd.setWindowModality(Qt.ApplicationModal)

View File

@ -1539,6 +1539,9 @@ ALTER TABLE books ADD COLUMN isbn TEXT DEFAULT "" COLLATE NOCASE;
for id in indices: for id in indices:
try: try:
data = self.format(id, format, index_is_id=True) data = self.format(id, format, index_is_id=True)
if not data:
failures.append((id, self.title(id, index_is_id=True)))
continue
except: except:
failures.append((id, self.title(id, index_is_id=True))) failures.append((id, self.title(id, index_is_id=True)))
continue continue

View File

@ -3,3 +3,41 @@ __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
''' '''
Manage translation of user visible strings. Manage translation of user visible strings.
''' '''
import shutil, tarfile, re, os, subprocess, urllib2
def import_from_launchpad(url):
f = open('/tmp/launchpad_export.tar.gz', 'wb')
shutil.copyfileobj(urllib2.urlopen(url), f)
f.close()
tf = tarfile.open('/tmp/launchpad_export.tar.gz', 'r:gz')
next = tf.next()
while next is not None:
if next.isfile() and next.name.endswith('.po'):
try:
po = re.search(r'-([a-z]{2,3}\.po)', next.name).group(1)
except:
next = tf.next()
continue
out = os.path.abspath(os.path.join('.', os.path.basename(po)))
print 'Updating', '%6s'%po, '-->', out
open(out, 'wb').write(tf.extractfile(next).read())
next = tf.next()
check_for_critical_bugs()
return 0
def check_for_critical_bugs():
if os.path.exists('.errors'):
shutil.rmtree('.errors')
pofilter = ('pofilter', '-i', '.', '-o', '.errors',
'-t', 'accelerators', '-t', 'escapes', '-t', 'variables',
'-t', 'xmltags')
subprocess.check_call(pofilter)
errs = os.listdir('.errors')
if errs:
print 'WARNING: Translation errors detected'
print 'See the .errors directory and http://translate.sourceforge.net/wiki/toolkit/using_pofilter'
if __name__ == '__main__':
import sys
import_from_launchpad(sys.argv[1])

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff