Saving overview db apart from text files?

9 views
Skip to first unread message

justinian

unread,
Dec 28, 2009, 2:17:40 PM12/28/09
to wikidpad-devel
Hi all,

I just discovered Wikidpad and love it - I've been looking for an
application like this to use as a personal knowledge base, and was
just about to start on my own. (Probably in wxPython, no less. Heh.)
So thanks!

There's one change I'd like to make, and I'd like to run it by you, in
case any of you have any insight..

Here's my usage pattern: I would like to keep my wiki notebooks in a
shared location. Specifically for me, this is usually my Dropbox
folder, but sometimes also a network file share. I don't want to close
and reopen my notebooks on each machine i use them on when i sit down
at a machine or leave it - I'd never remember to. So the overview db
is constantly held open, so it's locked on a network share, or (worse)
doesn't exist in other machines' dropboxes because dropbox can't open
the file to sync it.

My solution is to add an option to keep the overview built separately
in the temp folder. This will probably mean having to rebuild the
overview when files change. It also seems specific to the non-compact
sqlite format.

I'm putting changes into WikiData for the sqlite format for this as a
test now.. is there a better place for this?

Thanks for any input!

justin

Michael Butscher

unread,
Jan 20, 2010, 7:49:25 AM1/20/10
to wikidpa...@googlegroups.com


This is a good idea. In the end you may have to build your own database
backend based on the Original Sqlite backend.

A few remarks:

1. You should be aware that the overview file not only contains cache
information but also holds saved searches, saved exports (since 2.0) and
optionally previous versions of wiki pages.

You would have to store this all as files outside of the overview. For
this look in the "WikiData" class for Original Sqlite at the whole "data
block handling", starting with function
"getDataBlockUnifNamesStartingWith" until "deleteDataBlock". Saved
searches and such things are all stored as data blocks with long
"unified names". You would have to manage a persistent list of the data
blocks and implement the whole data block functions.


2. For checking if a file was modified externally, the overview database
stores a "file signature" for each wiki page file. The signature
consists of modification date and file size in a compact binary form.

The "WikiData" class provides the function
validateFileSignatureForWord(word) to check if wiki page for "word" was
unmodified and returns True if it wasn' changed externally.

The function refreshFileSignatureForWord(word) updates the signature in
the overview file based on the current state of the wiki page file.

Another way to use this functions is in the file "DocPages.py", class
"WikiPage", function "checkFileSignatureAndMarkDirty" which checks the
file signature and, if necessary, marks the file as dirty in one step.


3. The overview file holds a path to each wiki page file and each
external data blocks. Look in class "WikiData" at functions
"getWikiWordFileNameRaw(wikiWord)" up to "_guessWikiWordFileName(wikiWord)".


Michael

HelgeM

unread,
Jan 30, 2010, 7:12:24 AM1/30/10
to wikidpad-devel
Hi!

I wrote this a while ago:

--
I am using getdropbox.com successfully for several years to sync my
WikidPad-wikis to three computers. I use a original-sqlite database.
This is important for it to work. In WikidPad's help you will find how
to convert an existing wiki. I do not even quit WikidPad on one of the
computers at all. Nevertheless I have no syncing problems. Since I
don't quit WikidPad from time to time not all pages are found because
they were changed on a different computer and were not indexed yet;
then I do a database rebuild (in WikiPad's menu "Wiki") and everything
is fine again; you can ignore the warning. Once in a while you should
check your Wikis data directory for files with "conflicted copy" in
the name; these are generated by Dropbox. You have to merge these
manually. I recommend WinMerge for doing that.
(on http://sites.google.com/site/wikidpad/synchronizing-wikidpad-on-multiple-computers
)
--

Cheers

HelgeM

unread,
Jan 30, 2010, 7:14:17 AM1/30/10
to wikidpad-devel
Oh and the Metasearch (http://wikidpad.sourceforge.net/search/ ) finds
more interesting stuff concerning Dropbox.
Reply all
Reply to author
Forward
0 new messages