def main(): print("Copyright (C) 2015 Gjum <*****@*****.**>\n" "This program comes with ABSOLUTELY NO WARRANTY.\n" "This is free software, and you are welcome to redistribute it\n" "under certain conditions; see LICENSE.txt for details.\n" "Project homepage: https://github.com/Gjum/gagar\n" "Version: 0.1.4\n") if len(sys.argv) > 1 and sys.argv[1] in ('-h', '--help'): print("Usage: %s [nick]" % sys.argv[0]) print(" %s party <token> [nick]" % sys.argv[0]) print(" %s <IP:port> <token> [nick]" % sys.argv[0]) return address, token, nick, *_ = sys.argv[1:] + ([None] * 3) if token is None: nick = address address = None if address and address[0] in 'Pp': address = get_party_address(token) if not address: address, token = find_server() GtkControl(address, token, nick) gtk_main_loop()
def main(): print("Copyright (C) 2015 Gjum <*****@*****.**>\n" "This program comes with ABSOLUTELY NO WARRANTY.\n" "This is free software, and you are welcome to redistribute it\n" "under certain conditions; see LICENSE.txt for details.\n" "Project homepage: https://github.com/Gjum/gagar\n" "Version: 0.1.1\n") if len(sys.argv) > 1 and sys.argv[1] in ('-h', '--help'): print("Usage: %s [nick]" % sys.argv[0]) print(" %s party <token> [nick]" % sys.argv[0]) print(" %s <IP:port> <token> [nick]" % sys.argv[0]) return address, token, nick, *_ = sys.argv[1:] + ([None] * 3) if token is None: nick = address address = None if address and address[0] in 'Pp': address = get_party_address(token) if not address: address, token, *_ = find_server() GtkControl(address, token, nick) gtk_main_loop()
def on_button_pressed(self, button, pos): player = button.id if player.party_token == 'FFA': return print("Joining player", player.nick) self.tagar_client.agar_client.disconnect() token = player.party_token address = get_party_address(token) self.tagar_client.agar_client.connect(address, token)
def test_get_party_address(self): address, token = find_server(mode='party') party_address = get_party_address(token) self.assertEqual(address, party_address, 'party mode broke')