# HG changeset patch # User prologic # Date 1321819601 -36000 # Node ID 1778b83029e7f35a5654989dc33cca0cdb50b437 # Parent 6f39b32463d878a5f4c25d4bba8dd41da85f3544 Tidied up examples and removed unused imports diff -r 6f39b32463d878a5f4c25d4bba8dd41da85f3544 -r 1778b83029e7f35a5654989dc33cca0cdb50b437 examples/keyecho.py --- a/examples/keyecho.py Sat Aug 13 08:23:42 2011 +1000 +++ b/examples/keyecho.py Mon Nov 21 06:06:41 2011 +1000 @@ -1,7 +1,7 @@ #!/usr/bin/env python from circuits.io import File -from circuits import Component, Debugger +from circuits import Component import sys import tty diff -r 6f39b32463d878a5f4c25d4bba8dd41da85f3544 -r 1778b83029e7f35a5654989dc33cca0cdb50b437 examples/portforward.py --- a/examples/portforward.py Sat Aug 13 08:23:42 2011 +1000 +++ b/examples/portforward.py Mon Nov 21 06:06:41 2011 +1000 @@ -2,11 +2,12 @@ import optparse -from circuits import __version__ -from circuits import Event, Component, Debugger +from circuits import Event from circuits.net.sockets import TCPClient, TCPServer from circuits.net.sockets import Close, Connect, Write +__version__ = "0.1" + USAGE = "%prog [options]" VERSION = "%prog v" + __version__ @@ -97,7 +98,7 @@ else: target = (opts.target, 8000) - (Server(bind) + Client(*target) + Debugger()).run() + (Server(bind) + Client(*target)).run() if __name__ == "__main__": main() diff -r 6f39b32463d878a5f4c25d4bba8dd41da85f3544 -r 1778b83029e7f35a5654989dc33cca0cdb50b437 examples/telnet.py --- a/examples/telnet.py Sat Aug 13 08:23:42 2011 +1000 +++ b/examples/telnet.py Mon Nov 21 06:06:41 2011 +1000 @@ -22,7 +22,6 @@ import os import optparse -from socket import gethostname from circuits.io import stdin from circuits import handler, Component @@ -89,11 +88,9 @@ def error(self, *args): if len(args) == 3: - type, value, traceback = args + value = args[1] else: value = args[0] - type = type(value) - traceback = None print "ERROR: %s" % value diff -r 6f39b32463d878a5f4c25d4bba8dd41da85f3544 -r 1778b83029e7f35a5654989dc33cca0cdb50b437 examples/web/fileupload.py --- a/examples/web/fileupload.py Sat Aug 13 08:23:42 2011 +1000 +++ b/examples/web/fileupload.py Mon Nov 21 06:06:41 2011 +1000 @@ -44,7 +44,6 @@ if file is None: return UPLOAD_FORM else: - filename = file.filename return UPLOADED_FILE % (file.filename, desc, file.value) (Server(8000) + Debugger() + Root()).run() diff -r 6f39b32463d878a5f4c25d4bba8dd41da85f3544 -r 1778b83029e7f35a5654989dc33cca0cdb50b437 examples/web/shadowauth.py --- a/examples/web/shadowauth.py Sat Aug 13 08:23:42 2011 +1000 +++ b/examples/web/shadowauth.py Mon Nov 21 06:06:41 2011 +1000 @@ -5,7 +5,6 @@ against /etc/passwd and /etc/shadow before letting them into the web site.""" import os, re -from commands import getstatusoutput from circuits import handler, Component from circuits.web import _httpauth, Server, Controller from circuits.web.errors import HTTPError, Unauthorized diff -r 6f39b32463d878a5f4c25d4bba8dd41da85f3544 -r 1778b83029e7f35a5654989dc33cca0cdb50b437 examples/web/ssl-forward-cert.py --- a/examples/web/ssl-forward-cert.py Sat Aug 13 08:23:42 2011 +1000 +++ b/examples/web/ssl-forward-cert.py Mon Nov 21 06:06:41 2011 +1000 @@ -3,8 +3,7 @@ # stdlib import ssl -from circuits import Event, Component, Debugger -from circuits.net.sockets import TCPClient +from circuits import Debugger from circuits.web import Server, Controller class Root(Controller): diff -r 6f39b32463d878a5f4c25d4bba8dd41da85f3544 -r 1778b83029e7f35a5654989dc33cca0cdb50b437 examples/web/terminal/terminal.py --- a/examples/web/terminal/terminal.py Sat Aug 13 08:23:42 2011 +1000 +++ b/examples/web/terminal/terminal.py Mon Nov 21 06:06:41 2011 +1000 @@ -6,9 +6,9 @@ from StringIO import StringIO from subprocess import Popen, PIPE -from circuits.io import File -from circuits.tools import kill +from circuits.io import File, Write from circuits.web.events import Stream +from circuits.tools import inspect, kill from circuits import handler, Event, Component from circuits.web import Server, Controller, Logger, Static, Sessions diff -r 6f39b32463d878a5f4c25d4bba8dd41da85f3544 -r 1778b83029e7f35a5654989dc33cca0cdb50b437 examples/web/wiki/macros/__init__.py --- a/examples/web/wiki/macros/__init__.py Sat Aug 13 08:23:42 2011 +1000 +++ b/examples/web/wiki/macros/__init__.py Mon Nov 21 06:06:41 2011 +1000 @@ -47,7 +47,7 @@ name = name.replace("_", "-") try: macros[name] = function - except Exception, e: + except Exception: continue return macros