Re: [dabo-dev] dabo Commit 5762

Author: Paul McNett

Posted: 2010-03-22 at 13:01:49

On 3/22/10 9:34 AM, Ed Leafe wrote:

> On Mar 22, 2010, at 12:15 PM, Paul McNett wrote:

>

>> Not objecting, just discussing.

>>

>> If someone is explicitly setting HomeDirectory, but the path doesn't exist, IMO an

>> exception *should* be raised.

>>

>> I've never found the need to *set* HomeDirectory.

>

> HomeDirectory is now added automatically in the Class Designer, as a way of handling path resolution. We discussed this at PyCon. As usual, though, Windows will store something like 'E:\foo\bar', which will always fail on POSIX systems. I'm looking into a way to make this a little more x-platform, but in the meantime, crashing isn't the best way of handling things.

I remember listening to the problem you were solving, that HomeDirectory wasn't

resolving correctly in all situations (basically, it was resolving to the location of

ClassDesigner.py instead of to the location of the app being developed, causing a

mismatch between development-time and run-time relative file locations. Since we want

all files to be relative to the HomeDirectory, it's important for the appdev to know

where that HomeDirectory is and to be able to specify it).

But setting HomeDirectory in a portable file just seems like it is going to be prone

to all kinds of trouble, especially if it is absolute (and it needs to be absolute to

have the intended use). The user could install the app anywhere on their system, yet

HomeDirectory is still set to '/home/pmcnett/MyCoolApp', even on Windows where that

path makes no sense.

I just don't think that HomeDirectory is a portable property, and it shouldn't be set

in stone in the cdxml file.

I think that the appdev being able to set the current HomeDirectory for the app being

developed is good, but I don't think persisting that HomeDirectory to the cdxml file

is good or even necessary. At runtime, Dabo will correctly resolve the HomeDirectory

based on the location of the main application script (if this isn't working in some

cases, we need to fix it, but it's been working for me for years) so we are only

talking about design-time needs.

But that discussion we had at PyCon was only a couple minutes, so if I'm missing part

of the puzzle please indulge me! :)

Paul

_______________________________________________

Post Messages to: Dabo-dev@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Searchable Archives: http://leafe.com/archives/search/dabo-dev

This message: http://leafe.com/archives/byMID/4BA7A27D.8010002@ulmcnett.com

©2010 Paul McNett