[pybliographer/gtk3] Let's save bibtex entries sorted
- From: Germán Poó Caamaño <gpoo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pybliographer/gtk3] Let's save bibtex entries sorted
- Date: Thu, 20 Mar 2014 01:49:38 +0000 (UTC)
commit 9bd8033aa1c69020513ceaefc06d5a73991e77a5
Author: Zoltan Kota <zoltank gmail com>
Date: Thu Mar 6 14:10:55 2014 +0100
Let's save bibtex entries sorted
Now we save bibtex entries sorted by the entry key. It helps to
keep the database file 'ordered'. It may be useful if somebody
wants to track the file in version control...
Fixes SF bug #92.
Pyblio/GnomeUI/Document.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/Pyblio/GnomeUI/Document.py b/Pyblio/GnomeUI/Document.py
index 32d9303..d66bebd 100644
--- a/Pyblio/GnomeUI/Document.py
+++ b/Pyblio/GnomeUI/Document.py
@@ -714,7 +714,7 @@ class Document (Connector.Publisher):
self.w.error (_("Error during autosaving:\n%s") % error [1])
return False
- iterator = Selection.Selection (sort = self.selection.sort)
+ iterator = Selection.Selection (sort = Sort.Sort([Sort.KeySort()]))
Open.bibwrite (iterator.iterator (self.data.iterator ()),
out = savefile, how = how, database=self.data)
@@ -736,7 +736,7 @@ class Document (Connector.Publisher):
Utils.set_cursor (self.w, 'clock')
try:
try:
- self.data.update (self.selection.sort)
+ self.data.update (Sort.Sort([Sort.KeySort()]))
except (OSError, IOError), error:
Utils.set_cursor (self.w, 'normal')
self.w.error (_("Unable to save `%s':\n%s") % (str (self.data.key),
@@ -780,7 +780,7 @@ class Document (Connector.Publisher):
Utils.set_cursor (self.w, 'clock')
- iterator = Selection.Selection (sort = self.selection.sort)
+ iterator = Selection.Selection (sort = Sort.Sort([Sort.KeySort()]))
Open.bibwrite (iterator.iterator (self.data.iterator ()),
out = file, how = how, database=self.data)
file.close ()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]