Discussion:
[BitPim-devel] BitPim support for multiple data dir
Joe Pham
2005-12-20 03:55:23 UTC
Permalink
I'm looking into adding support for multiple data dir to BitPim. The idea is that a user should be able to select a specific data dir to use with BitPim. This allows data isolation between phones should users need to. My first implementation choice is a simple command line option:

bp.py -d <Data Path>

which would kick-off BitPim using the '<Data Path>' dir for data, and that works well enough for me. However, at this point, I'm asking for any other ideas or suggestions of ways for users to select specific data dir prior to or as part of starting up BitPim. One approach that Roger had previously suggested is to specify the data dir in a text file with a '.bitpim' extension, which type is associated with the BitPim exe. Users would then create these .bitpim files, and double-click on them to launch BitPim. Another approach is to display a dir selection dialog to users prior starting BitPim.

I still like the command line option! :-)

-Joe Pham



______________________________________________________________________
Call Anyone, Anytime, Anywhere in the World - FREE!
Free Internet calling from NetZero Voice
Visit http://www.netzerovoice.com today!
Roger Binns
2005-12-20 06:16:31 UTC
Permalink
Post by Joe Pham
bp.py -d <Data Path>
Having to specify a flag makes things considerably more difficult.
For example when doing file associations in Windows or Linux (and Mac
IIRC) you can specify the program to open a file, but you can't
specify extra flags at the same time. If you dig under the hood
you can but that is more painful to do.

So here is my recommendation:

- Remove the ability to specify a data directory in the settings
dialog. You can have a read only text box. The reason for this
is very simple - it doesn't currently work, won't work in the
future and would get more and more complex to maintain over time.

For the feature to work correctly, it should copy all the data
files over to the new location and use then switch over to using
them. It does a half assed job of that at the moment.

Additionally it is very rare for the majority of people to want
to move the data directory.

- Look for a file with an extension of .bitpim specified on the
command line. If one is found:

- Do a dirname to work out what directory to use as the data
directory to use
- Write that location to the registry/equivalent
- Use the ConfigParser module and get all remaining config
settings out of the specified .bitpim file

If one is not found:

- Look in the registry/equivalent for the last directory directory
used and use that
- .... or the current default if that doesn't exist
- Do everything else as in the previous section

- Change the config object on the main window object to use ConfigParser

- Change the installer on Windows to associate .bitpim files with
bitpim

- Try to do the same on Linux and Mac

- Power users can still create .bitpim files in random directories and
then double click on them to cause BitPim to use that as a data directory

Roger
Joe Pham
2005-12-22 05:54:52 UTC
Permalink
Post by Roger Binns
Having to specify a flag makes things considerably more difficult.
Agreed.
Post by Roger Binns
when doing file associations in Windows or Linux (and Mac IIRC)
Not sure 'bout Linux & Mac, but fortunately for Windows, it's fairly straight forward to add file associations, even with additional command flags.

At this point, I committed the changes required to support multiple data dir. I took the suggested approach with one exception: command line argument:

bitpim.exe -c <Config File>
bitpim.exe -d <Data Path>

which can easily be changed should that presents problems to the Linux & Mac platform.

-Joe Pham




______________________________________________________________________
Call Anyone, Anytime, Anywhere in the World - FREE!
Free Internet calling from NetZero Voice
Visit http://www.netzerovoice.com today!

Loading...