Split up the browser, some cleanups and

This commit is contained in:
Marco Pesenti Gritti
2006-05-31 18:01:24 -04:00
parent b4ebdfa5af
commit f96fbfc10b
17 changed files with 409 additions and 392 deletions
+1 -1
View File
@@ -97,7 +97,7 @@ class Owner(Buddy):
try:
os.makedirs(user_dir)
except OSError:
pass
print 'Could not create user directory.'
for fname in os.listdir(user_dir):
if not fname.startswith("buddy-icon."):
+7 -3
View File
@@ -1,3 +1,7 @@
# FIXME tests use initialized variables, any better
# what to shut up pylint for those?
# pylint: disable-msg = W0612
import socket
import time
import sha
@@ -11,9 +15,9 @@ pygtk.require('2.0')
import gtk, gobject
def _stringify_sha(sha):
def _stringify_sha(sha_hash):
print_sha = ""
for char in sha:
for char in sha_hash:
print_sha = print_sha + binascii.b2a_hex(char)
return print_sha
@@ -1089,7 +1093,7 @@ franker, more natural, as it were -- she really must exclude me from privileges
try:
gtk.main()
except KeyboardInterrupt:
pass
print 'Ctrl+C pressed, exiting...'
if __name__ == "__main__":
-5
View File
@@ -2,11 +2,6 @@ import xmlrpclib
import socket
import traceback
import pygtk
pygtk.require('2.0')
import gobject
import network
from MostlyReliablePipe import MostlyReliablePipe
+9 -4
View File
@@ -1,3 +1,5 @@
# pylint: disable-msg = W0221
import socket
import threading
import traceback
@@ -132,6 +134,9 @@ class GlibXMLRPCTransport(xmlrpclib.Transport):
# @param host Target host.
# @return A connection handle.
def __init__(self):
pass
def make_connection(self, host):
"""Use our own connection object so we can get its socket."""
# create a HTTP connection object from a host descriptor
@@ -224,8 +229,8 @@ class GlibServerProxy(xmlrpclib.ServerProxy):
# get the url
import urllib
type, uri = urllib.splittype(uri)
if type not in ("http", "https"):
urltype, uri = urllib.splittype(uri)
if urltype not in ("http", "https"):
raise IOError, "unsupported XML-RPC protocol"
self._host, self._handler = urllib.splithost(uri)
if not self._handler:
@@ -330,7 +335,7 @@ def xmlrpc_test():
def main():
import gtk, gobject
import gtk
server = GlibXMLRPCServer(("", 8888))
inst = Test()
server.register_instance(inst)
@@ -340,7 +345,7 @@ def main():
try:
gtk.main()
except KeyboardInterrupt:
pass
print 'Ctrl+C pressed, exiting...'
print "Done."
if __name__ == "__main__":