From: Adit P. <apa...@ba...> - 2004-05-04 02:47:01
|
On May 3, 2004, at 20:43, Roger Binns wrote: > > As far as I know, you just put the key sequence in the string for the > menu > item: > > menu.Append(ID_SAVE, "Save\tCtrl+S") > > That will automatically bind Ctrl+S to the menu item. Is there > anything > you do often enough with the menus to justify an accelerator key? > Not really, so I suppose it isn't necessary. Just figured we should have an alternate way to do things, if necessary. :) But thanks for the tip - I will keep that in mind for future projects. > Given a list of column headers, you can call phonebook.getdata > to get the relevant field. > > For example: > > phonebook.getdata("Cell2", entry, "") > phonebook.getdata("Name", entry, "") > > The full list of column names is phonebook.AvailableColumns. > > I would expect the exporting UI to look similar to the importing > UI. You should be able to select one of the predefined column > types (Palm Desktop, Mozilla etc) or define your own and the > order they go in. > > The columns offered should be > importexport.ImportCSVDialog.possiblecolumns. > You will need a mapping table between those names and the ones used > by BitPim in the phonebook module. > > Roger Actually I already finished the parsing of the phonebook. I did use the phonebook.getdata() function, but I ended up finding a way to just go through the whole dict and get what I needed out of it. It works, but if it is unacceptable, I can change it. Right now, I am using hard-coded Mozilla address-book columns to export, and it works (currently it just prints to the console, but that output imports perfectly into Mozilla Thunderbird). I just have to write the code to output the CSV to a file. Other than that, the only remaining thing to do is write the gui and put in user-defined options as you listed above. If you want, I can attach the stuff I have done, so if anyone wants to test the parsing routines. I guess I'll do that when I have it able to save to a file. Adit |