[Sugar-devel] How is the 'default' string in '.sugar/default' determined?
Bert Freudenberg
bert at freudenbergs.de
Tue Aug 18 05:39:55 EDT 2009
On 18.08.2009, at 10:52, Martin Langhoff wrote:
> On Tue, Aug 18, 2009 at 10:43 AM, Tomeu Vizoso<tomeu at sugarlabs.org>
> wrote:
>> On Tue, Aug 11, 2009 at 17:24, Martin Langhoff<martin.langhoff at gmail.com
>> > wrote:
>>> In the Sugar internals, how do you obtain the Sugar config storage
>>> directory? Moreover, what is the /correct/, recommended way to do
>>> it,
>>> one that will work on .82, .84 & .86 from activities, Sugar Shell
>>> code... and cronjobs (that run under the same user, but different
>>> ENV,
>>> and not spawned by sugar shell).
>>
>> 'default' is the name of the profile. If you want to use a different
>> profile, you can set the env var SUGAR_PROFILE.
>
> Cool.
>
>> You can use sugar.env.get_profile_path() in all those Sugar versions.
>
> How can I get that safely from a cronjob?
Why would you? $SUGAR_PROFILE is never set except by developers, and
rarely even by them. How they set it you cannot guess - .xsession is a
common place, but there isn't even a recommendation for it I think.
And since I doubt you want to run .xsession from your cronjob, you
will not get the same environment as Sugar anyways.
So IMHO you should just use "default".
- Bert -
More information about the Sugar-devel
mailing list