1. Daniele Tricoli
  2. circuits


James Mills  committed 1778b83

Tidied up examples and removed unused imports

  • Participants
  • Parent commits 6f39b32
  • Branches default

Comments (0)

Files changed (8)

File examples/keyecho.py

View file
 #!/usr/bin/env python
 from circuits.io import File
-from circuits import Component, Debugger
+from circuits import Component
 import sys
 import tty

File examples/portforward.py

View file
 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__
         target = (opts.target, 8000)
-    (Server(bind) + Client(*target) + Debugger()).run()
+    (Server(bind) + Client(*target)).run()
 if __name__ == "__main__":

File examples/telnet.py

View file
 import os
 import optparse
-from socket import gethostname
 from circuits.io import stdin
 from circuits import handler, Component
     def error(self, *args):
         if len(args) == 3:
-            type, value, traceback = args
+            value = args[1]
             value = args[0]
-            type = type(value)
-            traceback = None
         print "ERROR: %s" % value

File examples/web/fileupload.py

View file
         if file is None:
             return UPLOAD_FORM
-            filename = file.filename
             return UPLOADED_FILE % (file.filename, desc, file.value)
 (Server(8000) + Debugger() + Root()).run()

File examples/web/shadowauth.py

View file
 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

File examples/web/ssl-forward-cert.py

View file
 # 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):

File examples/web/terminal/terminal.py

View file
 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

File examples/web/wiki/macros/__init__.py

View file
             name = name.replace("_", "-")
                 macros[name] = function
-            except Exception, e:
+            except Exception:
     return macros