Reloading the preferences

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Reloading the preferences

Robert Unguran
Hi,

I am using the envisage plugin system with the python cmd plugin. If I  
am making a new changes in the preference file I have to restart the
software in order to read the new setting.
Is there an easy way to reload the setting from the preference.ini file?

Regards,
Robert Unguran
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Reloading the preferences

Martin Chilvers
Hi Robert,

On 02/08/2013 14:23, Robert Unguran wrote:
> I am using the envisage plugin system with the python cmd plugin. If I
> am making a new changes in the preference file I have to restart the
> software in order to read the new setting.
> Is there an easy way to reload the setting from the preference.ini file?

The short answer... No.

The long answer...

Envisage doesn't do this automatically because it doesn't know which
preferences are exposed to the user via the preferences dialog, and if
the user has set an explicit value for a preference then reloading the
file won't make any difference. Think of the .ini files as a way of
providing 'system defaults' - any user settings take precedence.

However, if you can guarantee that none of the values in the file are
exposed to the user then just create a file watcher and update the
preferences when a change occurs.

Martin

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Reloading the preferences

Robert Unguran
Hi Martin,

I am not using the preference dialog.
I have the cmd module, so I can implement new commands, what I would
like to achieve to reload the content of the preference.ini file. For
example by typing the reload phrase to the command line interface I can
reload the content of the  preference.ini file.
What I would like to know which function should I call to reload the
content of the preference.ini file.

Regards,
Robert.
On 08/05/2013 08:14 PM, Martin Chilvers wrote:

> Hi Robert,
>
> On 02/08/2013 14:23, Robert Unguran wrote:
>> I am using the envisage plugin system with the python cmd plugin. If I
>> am making a new changes in the preference file I have to restart the
>> software in order to read the new setting.
>> Is there an easy way to reload the setting from the preference.ini file?
> The short answer... No.
>
> The long answer...
>
> Envisage doesn't do this automatically because it doesn't know which
> preferences are exposed to the user via the preferences dialog, and if
> the user has set an explicit value for a preference then reloading the
> file won't make any difference. Think of the .ini files as a way of
> providing 'system defaults' - any user settings take precedence.
>
> However, if you can guarantee that none of the values in the file are
> exposed to the user then just create a file watcher and update the
> preferences when a change occurs.
>
> Martin
>
> _______________________________________________
> Enthought-Dev mailing list
> [hidden email]
> https://mail.enthought.com/mailman/listinfo/enthought-dev

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Reloading the preferences

Martin Chilvers
Hi Roberto,

On 19/08/2013 13:54, Robert Unguran wrote:
> I am not using the preference dialog.
> I have the cmd module, so I can implement new commands, what I would
> like to achieve to reload the content of the preference.ini file. For
> example by typing the reload phrase to the command line interface I can
> reload the content of the  preference.ini file.
> What I would like to know which function should I call to reload the
> content of the preference.ini file.

 From within a plugin:-

self.application.preferences.load(open_file_or_filename)

Marin

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Reloading the preferences

Martin Chilvers
On 20/08/2013 10:07, Martin Chilvers wrote:

> Hi Roberto,
>
> On 19/08/2013 13:54, Robert Unguran wrote:
>> I am not using the preference dialog.
>> I have the cmd module, so I can implement new commands, what I would
>> like to achieve to reload the content of the preference.ini file. For
>> example by typing the reload phrase to the command line interface I can
>> reload the content of the  preference.ini file.
>> What I would like to know which function should I call to reload the
>> content of the preference.ini file.
>
>   From within a plugin:-
>
> self.application.preferences.load(open_file_or_filename)

BTW... I used to think this was an OK name, but to make the intent
clearer, maybe it should be 'load_from_file'? 'load' is ambiguous...
load from where?!?!? Database? File? Server?

Martin

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Reloading the preferences

Robert Unguran
Hi Martin,

Thanks for your answer, I would like to reload the content of the
preference.ini file.

Regards,
Robert
On 08/20/2013 11:17 AM, Martin Chilvers wrote:

> On 20/08/2013 10:07, Martin Chilvers wrote:
>> Hi Roberto,
>>
>> On 19/08/2013 13:54, Robert Unguran wrote:
>>> I am not using the preference dialog.
>>> I have the cmd module, so I can implement new commands, what I would
>>> like to achieve to reload the content of the preference.ini file. For
>>> example by typing the reload phrase to the command line interface I can
>>> reload the content of the  preference.ini file.
>>> What I would like to know which function should I call to reload the
>>> content of the preference.ini file.
>>    From within a plugin:-
>>
>> self.application.preferences.load(open_file_or_filename)
> BTW... I used to think this was an OK name, but to make the intent
> clearer, maybe it should be 'load_from_file'? 'load' is ambiguous...
> load from where?!?!? Database? File? Server?
>
> Martin
>
> _______________________________________________
> Enthought-Dev mailing list
> [hidden email]
> https://mail.enthought.com/mailman/listinfo/enthought-dev

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev