diff options
author | Lance Stout <lancestout@gmail.com> | 2013-01-24 23:05:05 -0800 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2013-01-24 23:05:05 -0800 |
commit | a1b33da9ca7eb0d93c02b842935386d9286d82be (patch) | |
tree | f603d724710c76afb434fd10607bf360634a9f5c /sleekxmpp/plugins/google/__init__.py | |
parent | 1741059cf629960fbbe0c135fa530a786ec9b72e (diff) | |
download | slixmpp-a1b33da9ca7eb0d93c02b842935386d9286d82be.tar.gz slixmpp-a1b33da9ca7eb0d93c02b842935386d9286d82be.tar.bz2 slixmpp-a1b33da9ca7eb0d93c02b842935386d9286d82be.tar.xz slixmpp-a1b33da9ca7eb0d93c02b842935386d9286d82be.zip |
Refactor Google GTalk extensions into a single meta plugin.
Diffstat (limited to 'sleekxmpp/plugins/google/__init__.py')
-rw-r--r-- | sleekxmpp/plugins/google/__init__.py | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/sleekxmpp/plugins/google/__init__.py b/sleekxmpp/plugins/google/__init__.py new file mode 100644 index 00000000..bd7ca123 --- /dev/null +++ b/sleekxmpp/plugins/google/__init__.py @@ -0,0 +1,47 @@ +""" + SleekXMPP: The Sleek XMPP Library + Copyright (C) 2013 Nathanael C. Fritz, Lance J.T. Stout + This file is part of SleekXMPP. + + See the file LICENSE for copying permission. +""" + +from sleekxmpp.plugins.base import register_plugin, BasePlugin + +from sleekxmpp.plugins.google.gmail import Gmail +from sleekxmpp.plugins.google.auth import GoogleAuth +from sleekxmpp.plugins.google.settings import GoogleSettings +from sleekxmpp.plugins.google.nosave import GoogleNoSave + + +class Google(BasePlugin): + + """ + Google: Custom GTalk Features + + Also see: <https://developers.google.com/talk/jep_extensions/extensions> + """ + + name = 'google' + description = 'Google: Custom GTalk Features' + dependencies = set([ + 'gmail', + 'google_settings', + 'google_nosave', + 'google_auth' + ]) + + def __getitem__(self, attr): + if attr in ('settings', 'nosave', 'auth'): + return self.xmpp['google_%s' % attr] + elif attr == 'gmail': + return self.xmpp['gmail'] + else: + raise KeyError(attr) + + +register_plugin(Gmail) +register_plugin(GoogleAuth) +register_plugin(GoogleSettings) +register_plugin(GoogleNoSave) +register_plugin(Google) |