Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar/p2p
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2006-05-31 22:01:24 (GMT)
committer Marco Pesenti Gritti <mpg@redhat.com>2006-05-31 22:01:24 (GMT)
commitf96fbfc10b1db374c1ce3ec7cf727711c5161bf1 (patch)
tree75bf4b1bfc309562f841c20318c23b9da3557c3e /sugar/p2p
parentb4ebdfa5af05da701eee3a68b89ee77dc47b002f (diff)
Split up the browser, some cleanups and
Diffstat (limited to 'sugar/p2p')
-rw-r--r--sugar/p2p/Buddy.py2
-rw-r--r--sugar/p2p/MostlyReliablePipe.py10
-rw-r--r--sugar/p2p/Stream.py5
-rw-r--r--sugar/p2p/network.py13
4 files changed, 17 insertions, 13 deletions
diff --git a/sugar/p2p/Buddy.py b/sugar/p2p/Buddy.py
index c98ce96..ecbcb4a 100644
--- a/sugar/p2p/Buddy.py
+++ b/sugar/p2p/Buddy.py
@@ -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."):
diff --git a/sugar/p2p/MostlyReliablePipe.py b/sugar/p2p/MostlyReliablePipe.py
index f63a8b1..5aee04c 100644
--- a/sugar/p2p/MostlyReliablePipe.py
+++ b/sugar/p2p/MostlyReliablePipe.py
@@ -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__":
diff --git a/sugar/p2p/Stream.py b/sugar/p2p/Stream.py
index 7f00c57..3d0914d 100644
--- a/sugar/p2p/Stream.py
+++ b/sugar/p2p/Stream.py
@@ -2,11 +2,6 @@ import xmlrpclib
import socket
import traceback
-import pygtk
-pygtk.require('2.0')
-import gobject
-
-
import network
from MostlyReliablePipe import MostlyReliablePipe
diff --git a/sugar/p2p/network.py b/sugar/p2p/network.py
index b6241a9..8ba5ad9 100644
--- a/sugar/p2p/network.py
+++ b/sugar/p2p/network.py
@@ -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__":