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/>.
25 # The information below is needed by libpurple
26 __NAME__ = "nullclient"
29 __DEV_WEBSITE__ = "N/A"
31 if __name__ == '__main__':
32 # Sets initial parameters
33 core = purple.Purple(__NAME__, __VERSION__, __WEBSITE__, __DEV_WEBSITE__, \
34 debug_enabled=True, default_path="/tmp")
36 # Initializes libpurple
39 # Get username from user
40 sys.stdout.write("Enter GTalk account: ")
41 username = sys.stdin.readline()[:-1]
43 # Initialize protocol class
44 protocol = purple.Protocol('prpl-jabber')
46 # Creates new account inside libpurple
47 account = purple.Account(username, protocol, core)
50 # Get password from user
51 account.set_password(getpass.getpass())
53 # Set account protocol options
55 info['connect_server'] = 'talk.google.com'
57 info['old_ssl'] = True
58 account.set_protocol_options(info)
60 # Enable account (connects automatically)
61 account.set_enabled(True)
64 core.iterate_main_loop()