altern said :
> az., 2010.eko marren 24a 19:36(e)an, Aymeric Mansoux(e)k idatzi zuen:
> >altern said :
> >>>I would say the most important now would be this language/locales
> >>>selector as we are still fiddling around the other scripts and there
> >>>might be quite some changes....
> >>>
> >>>What do you think?
> >>
> >>send me the script you would use to do this. i can then check with
> >>parameters it takes and try to see what type of widgets it might
> >>require.
> >
> >The GUI for locales should do that:
> > - list what are the installed locales
> > - allow the user to select one (with pwetty flags)
> > - set the new locale for this user
> > - prompt for restarting xfce4 to have the changes applied
> >
> >optionnaly:
> > - install new locales, any from the /usr/share/i18n/SUPPORTED list
> > and refresh the installed locales list.
> >
> >I can probably write a bunch of Python functions that do that, and then
> >you could try to make the GUI for it?
>
> i have been researching. you might know already but...
>
> set locale this can be done from python
>
> import locale
> locale.setlocale(locale.LC_ALL, 'de_DE')
I just quickly browsed through the Python doc for this module, and it
seems to me that this just to be used by an application to change which
locale it should used
- C if not set
- system default if called with locale.setlocale(locale.LC_ALL,'')
- custom if called with locale.setlocale(locale.LC_ALL,'blabla')
So unless I miss the point, or read too fast, this is not setting the
system default locale, which is what we want here :)
Meaning we probably have to set and store $LANG for the users that will
run this tool.
>
> but i dont see how to get a list with the installed locales
>
> interfacing with shell commands can be done this way
>
> import os
> stdout_handle = os.popen("ls /home/r2d2", "r")
> text = stdout_handle.read()
> print text
>
>
> ---
> [email protected]
> http://identi.ca/group/puredyne
> irc://irc.goto10.org/puredyne
>
---
[email protected]
http://identi.ca/group/puredyne
irc://irc.goto10.org/puredyne