From: Roger B. <ro...@ro...> - 2003-12-19 04:27:53
|
> I haven't seen any hints of beginnings of > code in bitpim to deal with this. Look harder :-) There is a module named importexport almost 500 lines long and a whole bunch of code in phonebook.py! The intention is for 0.7 to have the ability to import. (This isn't the same thing as synchronization, but is an important first step). If anyone actually wants to design synchronization then that would be a good idea. The actual process would have to recognising changes in various data sources and applying them to others. Overall trivial big picture but really difficult when you get down to nuts and bolts. It is also an absolute prerequisite that it isn't stupid. I would rather not have the feature at all, than have one that magically duplicates data. > but I'm not sure the best way to slip this into bitpim. Start with importing address information. There are two stages, both of which are present in importexport and phonebook respectively. Try importing a CSV file to get a feel for the process. The first stage is handled in importexport.py and allows the user to choose what they want to import. It is currently missing a category checklistbox which I will be adding. In the case of CSV files, the user also gets to define the columns. For other data sources (vcard, WAB, etc) we already know what the columns are and the column header stuff won't be present. The user will be able to filter what gets imported (eg requiring at least a phone number, or for the entry to be in a particular category). The importexport code then converts the entry into the bitpim python dictionary format and supplies it to importdata() in phonebook.py. That then brings up another dialog that controls the merging of the imported entries with what you already have. The process is very similar to reconciling transactions in programs like Quicken or Microsoft Money. An imported entry could match an existing entry and be 'merged' or it could be a new entry. The code takes its best guess and then lets the user override what happens. I have also tried to put a numerical 'certainty' value on each match and merge, but will probably remove that as it isn't user friendly. (The code should just get it right). That code mostly works at the moment. However there is an edit control for each line missing (to allow you select a different match or to say an entry should be new or deleted). I also needed a entryeditor. So I went off and wrote one. But that needed the publish/subscribe system in order to deal with wallpapers and ringtones correctly. And the VX4400/6000 code wasn't in any fit shape to cooperate so I went in and fixed that. I am in the final throes of that and then will be able to go back to what I was working on in the first place before the several week detour :-) So there are several things you can do: 1 - Get various data sources working but not hooked into the bitpim code (ie they are ready for 0.8) 2 - Complete the code for the current import phonebook code (gui and mechanism) 3 - Write new code for importing calendar (gui and mechanism) 4 - Write code for generic phonebook export (gui and mechanism) 5 - Write code for generic calendar export (gui and mechanism) 6 - Design and completely think through a synchronisation algorithm. It should be able to cope with multiple phones (eg people wanting it to work with both their and their partners phones), and not be stupid. There should also be some sort of design for an undo/redo system in there as well, as I suspect this would all be based on some sort of transactioning and differencing engine. I would also expect it to need some sort of real database behind the scenes, and have already selected sqlite (and pysqlite as the wrapper) for those purposes I'll be completing the gui bit of #2 so don't bother working on that. However the mechanism bit is what needs the most work, I would be very happy for someone else to do it. Start at the MergeEntries function in phonebook.py. Anyway, let us know what tickles your fancy. #2 (both gui and mechanism) is what needs to be completed for the 0.7 release. Everything else can be later. Roger |