pythonverse

Python-based client for OpenVerse with extra features
git clone https://code.literati.org/pythonverse.git
Log | Files | Refs | README | LICENSE

commit 962f62fdaf4f3afd665e425ff9b1c423ae748f00
parent a8a6dec18ec8b6dabefb0f7534983588be438c5b
Author: seanl <seanl>
Date:   Thu,  7 Mar 2002 23:25:33 +0000

Removed openurl function from OpenVerse.py because it's a UI function.
Changed pvui_pygame.py to call webbrowser.open directly (forking)

Diffstat:
MOpenVerse.py | 4----
Mpvui_pygame.py | 8++++----
2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/OpenVerse.py b/OpenVerse.py @@ -17,7 +17,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # import sys, os, asyncore, asynchat, socket, string, struct, stat -import thread, webbrowser import transutil # Global constants are all caps; global variables start with _ @@ -287,9 +286,6 @@ class ServerConnection(transutil.Connection): for n in nicks: self.write('URL %s %s\r\n' % (n, url)) - def openurl(self, url): - thread.start_new_thread(webbrowser.open, (url, 1)) - def chat(self, text): self.write('CHAT %s\r\n' % text) diff --git a/pvui_pygame.py b/pvui_pygame.py @@ -19,7 +19,7 @@ # # vim:syntax=python -import sys, bisect, string, random +import sys, bisect, string, random, webbrowser import pygame, pygame.font, pygame.image, pygame.time, pygame.draw from math import * from pygame.locals import * @@ -1103,12 +1103,12 @@ class Client: except: self.server.move(event.pos) else: if port == -1: - self.server.openurl(host) + if os.fork() == -1: webbrowser.open(host) if port == -2: realhost, realport, filename, filesize = host # TODO: file transfers - if port > 0: - self.cmd_connect(host, port) + if port > 0: + self.cmd_connect(host, port) # Transport-called functions