Skip to content

A Keeptalking variant to be used alongside systemd and python3

Notifications You must be signed in to change notification settings

semplice/keeptalking2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

keeptalking2

Keeptalking2 is a library to interface with the internationalization features of the distribution.
It provides a public API that can be used to set/get the Keyboard layout, locale and timezone, as well as get a list of the supported ones.

Keeptalking2 is the Python3 port of keeptalking.

While you can easily run the legacy keeptalking in Python3, it will not be supported.

Changes from keeptalking

keeptalking2 dropt the gtk/cli frontends. Keeptalking2 is API-compatible with the legacy version though, so it's possible to port the old frontends to the new library.

In addition, the t9n library has been removed as well. For translations, it's recommended to switch to quickstart.

The set/get methods now rely on localed and timedated, which are part of systemd.
It's possible to use the old, init system agnostic methods by using the 'offline' versions.

For example,

kb = keeptalking2.Keyboard.Keyboard()
print(kb.default) # Uses localed via DBus
print(kb.default_offline) # Looks at /etc/default/keyboard, like the legacy keeptalking

Currently keeptalking2 does NOT check for the existence of the DBus services, and thus can't transparently fallback to the offline variants.
However, it's possible to instantiate the Keyboard(), Locale() and TimeZone() classes with the no_dbus keyword.
If True, keeptalking2 will not connect to dbus and thus the method calls will automatically fallback to the offline variants.

Please note that for techinical reasons it's not possible to change the internationalization settings of another system using the "online" methods. The eventual specified target will not be used when using those methods.

You need to use the offline variants for that.

About

A Keeptalking variant to be used alongside systemd and python3

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages