2 # Copyright (c) 2008 INdT - Instituto Nokia de Tecnologia
4 # This file is part of python-purple.
6 # python-purple is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # python-purple is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
24 sys.setdlopenflags(dl.RTLD_NOW | dl.RTLD_GLOBAL)
28 # The information below is needed by libpurple
29 __NAME__ = "nullclient"
32 __DEV_WEBSITE__ = "N/A"
34 if __name__ == '__main__':
35 # Sets initial parameters
36 core = purple.Purple(__NAME__, __VERSION__, __WEBSITE__, __DEV_WEBSITE__, \
37 debug_enabled=True, default_path="/tmp")
39 # Initializes libpurple
42 # Get username from user
43 sys.stdout.write("Enter GTalk account: ")
44 username = sys.stdin.readline()[:-1]
46 # Initialize protocol class
47 protocol = purple.Protocol('prpl-jabber')
49 # Creates new account inside libpurple
50 account = purple.Account(username, protocol, core)
53 # Get password from user
54 account.set_password(getpass.getpass())
56 # Set account protocol options
58 info['connect_server'] = 'talk.google.com'
60 info['old_ssl'] = True
61 account.set_protocol_options(info)
63 # Enable account (connects automatically)
64 account.set_enabled(True)
67 core.iterate_main_loop()