Commit Graph

177 Commits

Author SHA1 Message Date
Benny Malengier
c76159ab9d 3580: People list (private handlers) and display Name format
in reality: associations are not removed on delete person


svn: r14384
2010-02-15 12:13:43 +00:00
Gerald Britton
4268634b1f Remove method that is now unused as a result of changes in rev. 14179
svn: r14183
2010-02-01 18:30:16 +00:00
Benny Malengier
a89e8d1d18 Remove column config from db, move to the plugins
Start with reuse of preferences for all configuration
Allow all view plugins to set configuration dialog
TODO: activate the column reorder in config of listviews


svn: r14176
2010-02-01 07:01:45 +00:00
Gerald Britton
8f0582df8a Use built-in functions to replace for loops:
Old code:

for x in y:
  f(x)

New Code:

map(f, y)

Also use defaultdict instead of simple dict when advantageous and use list comprehensions
instead of for loops where map() could be used but requires lambdas.


svn: r14135
2010-01-25 17:45:21 +00:00
Doug Blank
e5d14f59c1 Fixed DbDjango's
svn: r14112
2010-01-24 13:55:39 +00:00
Doug Blank
2d36aea65a Added doc notes on new database hierarchy
svn: r14111
2010-01-24 13:47:48 +00:00
Gerald Britton
1f2469b09f Simplify with built-in functions where possible. e.g.
change [x for x in y if x] to filter(None, y)
change [f(x) for x in y] to map(f, x)
change [x for x in y] to list(y)

These changes reduce source code size and complexity and produce some minor performance gains

svn: r14104
2010-01-21 18:42:53 +00:00
Brian Matherly
f04880ec09 Move gettext, ngettext and sgettext calls into the new ggettext module. All of them return unicode all of the time.
svn: r14091
2010-01-18 04:42:17 +00:00
Gerald Britton
a4b22193c2 Use defaultdict instead of dict to simplify code and improve performance
svn: r14060
2010-01-13 15:46:12 +00:00
Doug Blank
f415159d6f Revised iterable table interface; removed DbEngine and DbTable
svn: r14048
2010-01-12 18:38:39 +00:00
Doug Blank
95bb81a54c Missing underscore
svn: r14036
2010-01-11 20:34:47 +00:00
Doug Blank
bdefba55ca Towards an DbEngine, for a variety of reasons
svn: r14035
2010-01-11 19:45:17 +00:00
Brian Matherly
252ef6daee Continued work on GEP008: Move BasicUtils/UpdateCallback.py to gen/updatecallback.py.
svn: r14025
2010-01-10 20:21:10 +00:00
Brian Matherly
7aec8904ea Remove gen.db.iterator.py - it is not used.
svn: r13979
2010-01-06 04:44:09 +00:00
Doug Blank
a61a472668 Missing gettext
svn: r13927
2009-12-27 13:49:15 +00:00
Doug Blank
06d0291ff4 Refinements on database hierarchy
svn: r13907
2009-12-24 14:38:39 +00:00
Doug Blank
ab3dfe1415 3465: Create a new hierarchy of base classes for gramps cor databases (read, write) and add methods
svn: r13894
2009-12-23 15:55:58 +00:00
Doug Blank
172988ff36 Apparently gen.proxy.dbbase and gen.db.dbdir are not needed anymore; edited support files too
svn: r13888
2009-12-22 22:53:25 +00:00
Doug Blank
699dcb13fe Fixed svn Id property
svn: r13881
2009-12-21 13:43:50 +00:00
Doug Blank
3a8b4d7e40 Moved fallback functions from Db to gen.utils
svn: r13876
2009-12-21 05:58:55 +00:00
Doug Blank
872e971fd3 gen.lib and gen.utils are independent; removed gen.utils.dbutils --- moved db methods to gen.db.base
svn: r13872
2009-12-21 04:18:31 +00:00
Brian Matherly
814d721f68 Remove QuestionDialog dependency from gen. The database now raises exceptions and the GUI generates the question dialog.
svn: r13865
2009-12-20 22:44:32 +00:00
Doug Blank
c47b494b39 Cleaning up Utils and refactoring common functionality
svn: r13862
2009-12-20 22:21:59 +00:00
Brian Matherly
806bd63ca2 Continued work on GEP008: Move GrampsDbUtils/_Backup.py to gen/db/backup.py.
svn: r13856
2009-12-20 04:30:28 +00:00
Doug Blank
785184e74f 3339: [Patch] Views get their column display data from db (meta); should get from config ini
svn: r13709
2009-12-05 06:52:53 +00:00
Peter Landgren
900d1c57f4 Second update for consistent use of Gramps. See issue 3355.
svn: r13611
2009-11-17 20:45:58 +00:00
Peter Landgren
33686fcf18 First update for consistent use of Gramps. See issue 3355.
svn: r13610
2009-11-17 20:14:53 +00:00
Doug Blank
f272ce3dd1 Move gtk-based items out of scope of import for cli
svn: r13599
2009-11-16 22:39:54 +00:00
Benny Malengier
1b556586a4 3275: PageView reworking main work by Nick Hall
Moving personview to the new pageview classes, and using a generic 
treebasemodel


svn: r13515
2009-11-07 13:04:45 +00:00
Gerald Britton
f186d8bce8 fix bug on database errors; remove bsddb transaction for batch operations
svn: r13283
2009-10-01 20:38:23 +00:00
Gerald Britton
9b586eaf4f 1. Enhance cursor.py to support updating records after reading them
2. Implement enhancement in write.py, get_cursor method
3. Exploit new capability in ChangeNames.py

svn: r13237
2009-09-23 20:07:58 +00:00
Gerald Britton
311d9b16b9 Silently accept "not found" errors when deleting database files
svn: r13215
2009-09-16 20:31:28 +00:00
Gerald Britton
966d2bcd42 Use new iter_objects methods
svn: r13203
2009-09-14 20:50:25 +00:00
Gerald Britton
03dc41bff9 Documentation updates
svn: r13183
2009-09-09 14:43:55 +00:00
Gerald Britton
768ea89a0f Remove deprecated method
svn: r13164
2009-09-07 16:22:12 +00:00
Gerald Britton
54d4bf6134 Add function decorator to catch dabatase errors
svn: r13163
2009-09-07 16:19:59 +00:00
Gerald Britton
be1aaf9f7b restore set_name_group_mapping method
svn: r13161
2009-09-05 23:03:31 +00:00
Gerald Britton
06458ae1d7 Remove unused methods
svn: r13159
2009-09-04 17:57:00 +00:00
Gerald Britton
20bfbc8719 add from __future__ import with_statement
svn: r13158
2009-09-04 17:20:37 +00:00
Gerald Britton
ee9f1e82e0 Tweaks to database objects plus initial documentation in rst format
svn: r13157
2009-09-03 19:44:01 +00:00
Gerald Britton
3564b04584 1. Implement iter_<object> methods in proxybase.
2. Change include_object to include_media_object to avoid confusion
3. Make _validated_id_prefix method in read.py a staticmethod
4. Use new iter_<objects> methods in Records.py, StatsgGramplet.py, GivenNameGramplet.py, ExtractCity.py and _IsSiblingOfFilterMatch.py as examples

svn: r13151
2009-09-02 20:10:45 +00:00
Gerald Britton
5fc1618a85 1. Use closures to define iterator methods
2. Change sorts on people and places to work like other sorts

svn: r13149
2009-09-01 17:46:08 +00:00
Gerald Britton
00d6b8cd50 Fix write.py to do imports from gen.db
svn: r13148
2009-09-01 17:43:54 +00:00
Gerald Britton
4e8f59c4bd grampsdbtxn.py module renamed to txn.py
svn: r13141
2009-08-31 19:07:41 +00:00
Gerald Britton
1587cb8ad1 Implement restructured database objects
svn: r13139
2009-08-31 18:42:29 +00:00
Gerald Britton
ae404f496f Latest updates to new modules
svn: r13101
2009-08-21 20:06:11 +00:00
Benny Malengier
5700f6ab66 2863: Wrong row when dropping on embedded list
This patch makes sure open of old database shows correct columns, and 
adds ... if several main participants


svn: r13085
2009-08-20 09:31:10 +00:00
Benny Malengier
5f0c935256 2773: Primary participant(s) in Events View
svn: r13083
2009-08-19 22:27:06 +00:00
Gerald Britton
5b8bc47bce Update makefile to add new modules
svn: r13080
2009-08-19 20:30:40 +00:00
Gerald Britton
b4b9675feb cursor.py -- add additional methods mirroring those in DBCursor and a getattr method to pass through non-overridden method calls to DBCursor
svn: r13079
2009-08-19 17:14:32 +00:00
Gerald Britton
c8f7bf0c69 Add new modules to support restructured database objects
bsddbtxn.py -- Wrapper for BSDDB DBTxn to support context manager protocol
    txn.py      -- GrampsDbTxn class to manage atomic transactions
    write.py    -- GrampsDbWrite class for read/write databases
    read.py     -- GrampsDbRead class for read-only databases
    undoredo.py -- GrampsDbUndo class to manage the undo database
    upgrade.py  -- Helper module for upgrading a database at open time


svn: r13078
2009-08-19 17:05:39 +00:00
Raphael Ackermann
b33a53e487 fixed typos
svn: r12937
2009-08-09 22:43:43 +00:00
Raphael Ackermann
65f72560d1 pep8 fixes
fixing typos


svn: r12934
2009-08-09 17:09:32 +00:00
Doug Blank
dd1f4f0b26 Added a convienence method __len__ for cursors; you can remove if you don't like
svn: r12912
2009-08-07 09:11:13 +00:00
Benny Malengier
ee69317b62 Fix for: 1277: database corroption on delete outside of DisplayTabs while tab open
Introduces the concept of callman.py as one single way to follow handles an
interface is interested in. 
dbguielement.py contains a small base class using that, usable for all windows/
guielements that need to track database changes to handles


svn: r12881
2009-08-05 10:32:05 +00:00
Gary Burton
215aeb4667 Fix incorrect method name
svn: r12786
2009-07-11 15:32:37 +00:00
Gerald Britton
f680992d04 Tweaks
svn: r12775
2009-07-08 16:10:13 +00:00
Gerald Britton
b0a6f7c854 replace refs to locale.strcoll with refs to locale.strxfrm
svn: r12712
2009-06-25 21:09:49 +00:00
Gerald Britton
70a0c50fca Use GrampsCursor as a context manager using "with" statement
svn: r12672
2009-06-16 15:49:17 +00:00
Gerald Britton
035096e5b2 Add iterator and context manager methods to GrampsCursor object and use them in GrampsDbBase and GrampsDBDir.
svn: r12660
2009-06-12 16:17:07 +00:00
Peter Landgren
581b33524e Fix of issue 3007.
svn: r12622
2009-06-03 18:40:10 +00:00
Gerald Britton
220873d92e Bug 3030: ID formats not properly verified
svn: r12587
2009-05-29 17:09:09 +00:00
Gerald Britton
021b754939 Bug 3011: change old-style classes to new-style classes
svn: r12559
2009-05-21 17:19:50 +00:00
Doug Blank
cf03cf4b23 2792: Dates in sourcereferences in person_ref_list not upgraded; this fixes the missing conversion in child-ref-list
svn: r12286
2009-03-09 19:49:51 +00:00
Doug Blank
a858c2a9b0 2792: Dates in sourcereferences in person_ref_list not upgraded
svn: r12265
2009-03-09 11:39:58 +00:00
Doug Blank
6d50c002fe Upgrade of source, place, and media tables.
svn: r11710
2009-01-25 02:29:05 +00:00
Doug Blank
983f6d3e71 Added new signal to database: home-person-changed, which is emitted when the default person is set
svn: r11534
2008-12-29 14:13:44 +00:00
Doug Blank
9aa7bc6030 Fixed some missed dates in conversion from 13 to 14
svn: r11447
2008-12-08 13:15:40 +00:00
Doug Blank
8a690810fc Continued attempted fix for BSDDB new methods and attributes
svn: r11360
2008-11-29 12:53:00 +00:00
Doug Blank
f067bf6e2c Changes with Python 2.5.2 and BSDDB are more subtle---seems to require checking both Python and BSDDB versions. This involves a method name change, and a flag name change.
svn: r11354
2008-11-28 04:28:10 +00:00
Peter Landgren
2876068bdf Fix of issue 2504, sorting in WinXP.
svn: r11332
2008-11-21 15:26:26 +00:00
Benny Malengier
7424433a69 0002483: Gramps crashes while loading database, always.
Patch of Josip, support bsddb >= 4.7


svn: r11297
2008-11-13 08:28:32 +00:00
Brian Matherly
dfd426e5ca Move the contents of "_GrampsBSDDB.py" into "ReadGrdb.py" because that is the only place it is used. Then, rename "ReadGrdb.py" to "plugins/ImportGrdb.py" for consistency. Also clean up misc import related code.
svn: r11173
2008-10-21 04:22:45 +00:00
Brian Matherly
8e8f37d5d3 Create a new plugin class for Import plugins.
svn: r11142
2008-10-14 02:34:28 +00:00
Gary Burton
e68981fb69 Crash caused by change made in bug #2289. Reversing change.
svn: r10929
2008-07-26 20:58:43 +00:00
Gerald Britton
437bde6e5c Revert 10874 changes to base.py and _FilterParser.py
svn: r10877
2008-07-18 13:15:15 +00:00
Gerald Britton
49316e07e8 Revert 10874 changes to dbdir.py and _GrampsBSDDB.py
svn: r10875
2008-07-17 21:03:26 +00:00
Gerald Britton
882199f1c2 Replace dict.has_key(x) with x in dict for performance gain
svn: r10874
2008-07-17 18:10:32 +00:00
Gerald Britton
6037e9fdd4 Replace lambdas with list comprehensions
svn: r10843
2008-07-04 17:27:51 +00:00
Gerald Britton
4982292774 Code optimizations wrt handling of None - bug 2212
svn: r10811
2008-06-16 15:01:46 +00:00
Doug Blank
2098a01f8d refactored SimpleTable; QuickReports can return values; date diffs return Span
svn: r10578
2008-04-18 01:09:32 +00:00
Doug Blank
e410f04c7a Removed extra line from a previous aborted refactor
svn: r10539
2008-04-10 02:01:47 +00:00
Doug Blank
dbf925c63e 0002041: show dialog if db version too high; ask question to upgrade the db version
svn: r10535
2008-04-10 01:15:12 +00:00
Doug Blank
d4311078f0 Added an integer newyear code to all dates, db version 14
svn: r10521
2008-04-08 04:24:18 +00:00
Doug Blank
2ac01bfcc7 Undo db update... missed many dates; reworking upgrade
svn: r10499
2008-04-06 12:20:33 +00:00
Doug Blank
1644727587 Upgrade the database some more for version 14: new int on dates for newyear
svn: r10495
2008-04-06 03:43:24 +00:00
Zsolt Foldvari
abbd6781c1 Reverting change from r10429, because metadata is now always set after DB creation.
svn: r10486
2008-04-05 22:02:59 +00:00
Zsolt Foldvari
311278e6a8 Method 'write_version' is created instead of loading the db after creation.
svn: r10484
2008-04-05 21:47:49 +00:00
Zsolt Foldvari
0cc320ac90 When new db was created metadata still contained no information, thus in
dbdir.GrampsDBDir.__load the version check failed.


svn: r10429
2008-03-31 16:46:00 +00:00
Doug Blank
02b110a2b0 Missing space in db error
svn: r10419
2008-03-29 20:54:04 +00:00
Zsolt Foldvari
1c2ec7559b Fix #0001991: supported database versions checked properly.
svn: r10417
2008-03-29 19:59:33 +00:00
Zsolt Foldvari
0542a9b78c Introducing StyledText in Notes.
svn: r10410
2008-03-28 23:22:46 +00:00
Benny Malengier
957239950d 2008-03-09 Benny Malengier <benny.malengier@gramps-project.org>
* src/gen/db/base.py: add docstring to find functions, #1866
	* src/gen/db/dbdir.py: add docstring to find functions, #1866



svn: r10236
2008-03-09 18:10:13 +00:00
Gary Burton
34cf711351 2008-03-02 Gary Burton <gary.burton@zen.co.uk>
* src/GrampsCfg.py:
	* src/Config/_GrampsConfigKeys.py:
	* src/gen/db/dbdir.py:
	* src/DbManager.py:
	* src/DbLoader.py: Gramps databases run with transactions enabled. The
	option to switch off transactions is now removed. The "transactions" and 
	"port_warn" settings are ignored in the config file.



svn: r10169
2008-03-02 21:34:51 +00:00
Benny Malengier
b1561e5f78 2008-02-28 Benny Malengier <benny.malengier@gramps-project.org>
* src/ViewManager.py: allow for info dialog after import
	* src/gen/db/base.py: find returns if new object or not
	* src/gen/db/dbdir.py: find returns if new object or not
	* src/plugins/ImportGeneWeb.py: allow multiple mime types
	* src/plugins/ImportvCard.py: allow multiple mime types
	* src/plugins/ReadGrdb.py: allow multiple mime types
	* src/plugins/ReadPkg.py: allow multiple mime types
	* src/plugins/ImportCSV.py: allow multiple mime types
	* src/DbManager.py: use family tree string, not database
	* src/glade/gramps.glade: add info dialog
	* src/QuestionDialog.py: add info dialog, clean up set transient errors
	* src/GrampsDbUtils/_GrampsDbWriteXML.py: improve comment
	* src/GrampsDbUtils/_ReadXML.py: fix change dates problems, fix 
	 creation of empty objects in bookmarks, add info dialog, clean up
	 relative media import, remove unneeded parameters
	* src/GrampsDbUtils/_GrampsDbWRFactories.py: 
	* src/GrampsDbUtils/_GrampsBSDDB.py: allow multiple mime types
	* src/DbLoader.py: fix up import filters and some mime type issues



svn: r10138
2008-02-28 22:32:40 +00:00
Raphael Ackermann
c962d5e6e1 2008-02-22 Raphael Ackermann <raphael.ackermann@gmail.com>
* various (294 files)
	pep8 doc fixes & pylint fixes

svn: r10103
2008-02-24 13:55:55 +00:00
Raphael Ackermann
5f375b106f 2008-02-22 Raphael Ackermann <raphael.ackermann@gmail.com>
* ViewManager.py
	* gen/db/iterator.py
	* gen/db/base.py
	* gen/db/dbconst.py
	* gen/db/cursor.py
	* gen/db/__init__.py
	* gen/db/exceptions.py
	* gen/db/dbdir.py
	* gen/lib/srcbase.py
	* gen/callback: deleted unused directory
	* plugins/ReorderIds.py:
	pylint and pep8 doc fixes

svn: r10099
2008-02-23 08:38:55 +00:00
Don Allingham
d45a676492 2008-02-20 Don Allingham <don@gramps-project.org>
* src/GrampsCfg.py: refactoring
	* src/gen/utils/test/callback_test.py: refactoring
	* src/gen/utils/callback.py: refactoring
	* src/gen/utils/longop.py: refactoring
	* src/gen/utils/__init__.py: refactoring
	* src/gen/db/base.py: refactoring
	* src/gen/Makefile.am: refactoring
	* src/DisplayState.py: refactoring
	* src/DbState.py: refactoring
	* src/PluginUtils/_MenuOptions.py: refactoring
	* src/ListModel.py: refactoring
	* src/BaseDoc.py: refactoring



svn: r10086
2008-02-21 04:58:56 +00:00
Raphael Ackermann
90f883e46d 2008-02-18 Raphael Ackermann <raphael.ackermann@gmail.com>
* src/* 143 files
    * test/try_tree_model.py
    * windows/nsis/gcheck.py
    imports cleanup

svn: r10055
2008-02-18 20:07:09 +00:00
Gary Burton
2742e8d00b 2008-02-03 Gary Burton <gary.burton@zen.co.uk>
* src/gen/db/base.py: Functions using the pop function expect a return
	value. Bug #1632



svn: r9991
2008-02-03 21:55:03 +00:00