Ejemplo n.º 1
0
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")

    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()
Ejemplo n.º 2
0
Archivo: main.py Proyecto: msahin/gagar
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")

    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()
Ejemplo n.º 3
0
 def on_key_pressed(self, val, char):
     if char == 'q' or val == Gdk.KEY_Escape:
         self.client.disconnect()
         Gtk.main_quit()
     elif char == 's':
         self.client.send_spectate()
     elif char == 'r' or val == Gdk.KEY_Return:
         self.client.send_respawn()
     elif char == 'c':  # reconnect to any server
         self.client.disconnect()
         address, token, *_ = find_server()
         self.client.connect(address, token)
         self.world_viewer.focus_player(self.client.player)
Ejemplo n.º 4
0
Archivo: main.py Proyecto: msahin/gagar
 def on_key_pressed(self, val, char):
     if char == 'q' or val == Gdk.KEY_Escape:
         self.client.disconnect()
         Gtk.main_quit()
     elif char == 's':
         self.client.send_spectate()
     elif char == 'r' or val == Gdk.KEY_Return:
         self.client.send_respawn()
     elif char == 'c':  # reconnect to any server
         self.client.disconnect()
         address, token, *_ = find_server()
         self.client.connect(address, token)
         self.world_viewer.focus_player(self.client.player)
Ejemplo n.º 5
0
 def donate_thread():
     while 1:
         gcommer_donate(*find_server(region, mode))
         time.sleep(interval)