- Removed commented code (just for you, TRB143!)

- Removed any non-alphanumeric character for Bible names, just to be safe, since we don't actually use the filenames anymore.
This commit is contained in:
Raoul Snyman 2010-03-16 22:43:41 +02:00
parent c63c09017e
commit dc6c6bec31
2 changed files with 1 additions and 11 deletions

View File

@ -106,9 +106,7 @@ class BibleDB(QtCore.QObject):
def clean_filename(self, old_filename):
if not isinstance(old_filename, unicode):
old_filename = unicode(old_filename, u'utf-8')
for char in [u'\\', u'/', u':', u'*', u'?', u'"', u'<', u'>', u'|', u' ']:
old_filename = old_filename.replace(char, u'_')
old_filename = re.sub(r'[_]+', u'_', old_filename).strip(u'_')
old_filename = re.sub(r'[^\w]+', u'_', old_filename).strip(u'_')
return old_filename + u'.sqlite'
def register(self, wizard):
@ -266,8 +264,6 @@ class BibleDB(QtCore.QObject):
count = self.session.query(Verse.chapter).join(Book)\
.filter(Book.name==book)\
.distinct().count()
#verse = self.session.query(Verse).join(Book).filter(
# Book.name == bookname).order_by(Verse.chapter.desc()).first()
if not count:
return 0
else:
@ -279,9 +275,6 @@ class BibleDB(QtCore.QObject):
.filter(Book.name==book)\
.filter(Verse.chapter==chapter)\
.count()
#verse = self.session.query(Verse).join(Book).filter(
# Book.name == bookname).filter(
# Verse.chapter == chapter).order_by(Verse.verse.desc()).first()
if not count:
return 0
else:

View File

@ -125,8 +125,6 @@ class BibleManager(object):
for filename in files:
bible = BibleDB(self.parent, path=self.path, file=filename,
config=self.config)
#self.db_cache[name] = BibleDB(self.parent, path=self.path,
# name=name, config=self.config)
name = bible.get_name()
log.debug(u'Bible Name: "%s"', name)
self.db_cache[name] = bible
@ -140,7 +138,6 @@ class BibleManager(object):
download_source=source.value, download_name=download_name)
if meta_proxy:
web_bible.set_proxy_server(meta_proxy.value)
#del self.db_cache[name]
self.db_cache[name] = web_bible
log.debug(u'Bibles reloaded')