Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes
test.test_ftplib.DummyFTPServer Class Reference
Inheritance diagram for test.test_ftplib.DummyFTPServer:
Inheritance graph
[legend]
Collaboration diagram for test.test_ftplib.DummyFTPServer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def start
def run
def stop
def handle_accepted
def handle_connect
def writable
def handle_error
def __repr__
def add_channel
def del_channel
def create_socket
def set_socket
def daemon
def daemon
def name
def name
def __repr__
def join
def ident
def is_alive
def isDaemon
def setDaemon
def getName
def setName

Public Attributes

 active
 active_lock
 port
 handler_instance
 socket
 family_and_type
 daemon
 name
_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Static Public Attributes

 handler = DummyFTPHandler
 handle_read = handle_connect
 debug = False
 connected = False
 accepting = False
 closing = False
 addr = None
tuple ignore_log_types = frozenset(['warning'])
 isAlive = is_alive

Private Attributes

 __flag

Detailed Description

Definition at line 217 of file test_ftplib.py.


Constructor & Destructor Documentation

def test.test_ftplib.DummyFTPServer.__init__ (   self,
  address,
  af = socket.AF_INET 
)

Reimplemented from asyncore.dispatcher.

Definition at line 221 of file test_ftplib.py.

00221 
00222     def __init__(self, address, af=socket.AF_INET):
00223         threading.Thread.__init__(self)
00224         asyncore.dispatcher.__init__(self)
00225         self.create_socket(af, socket.SOCK_STREAM)
00226         self.bind(address)
00227         self.listen(5)
00228         self.active = False
00229         self.active_lock = threading.Lock()
00230         self.host, self.port = self.socket.getsockname()[:2]
00231         self.handler_instance = None

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

def asyncore.dispatcher.__repr__ (   self) [inherited]

Definition at line 264 of file asyncore.py.

00264 
00265     def __repr__(self):
00266         status = [self.__class__.__module__+"."+self.__class__.__name__]
00267         if self.accepting and self.addr:
00268             status.append('listening')
00269         elif self.connected:
00270             status.append('connected')
00271         if self.addr is not None:
00272             try:
00273                 status.append('%s:%d' % self.addr)
00274             except TypeError:
00275                 status.append(repr(self.addr))
00276         return '<%s at %#x>' % (' '.join(status), id(self))

def threading.Thread.__repr__ (   self) [inherited]

Definition at line 659 of file threading.py.

00659 
00660     def __repr__(self):
00661         assert self._initialized, "Thread.__init__() was not called"
00662         status = "initial"
00663         if self._started.is_set():
00664             status = "started"
00665         if self._stopped:
00666             status = "stopped"
00667         if self._daemonic:
00668             status += " daemon"
00669         if self._ident is not None:
00670             status += " %s" % self._ident
00671         return "<%s(%s, %s)>" % (self.__class__.__name__, self._name, status)

def asyncore.dispatcher.add_channel (   self,
  map = None 
) [inherited]

Definition at line 279 of file asyncore.py.

00279 
00280     def add_channel(self, map=None):
00281         #self.log_info('adding channel %s' % self)
00282         if map is None:
00283             map = self._map
00284         map[self._fileno] = self

Here is the caller graph for this function:

def asyncore.dispatcher.create_socket (   self,
  family,
  type 
) [inherited]

Definition at line 294 of file asyncore.py.

00294 
00295     def create_socket(self, family, type):
00296         self.family_and_type = family, type
00297         sock = socket.socket(family, type)
00298         sock.setblocking(0)
00299         self.set_socket(sock)

Here is the caller graph for this function:

def threading.Thread.daemon (   self) [inherited]

Definition at line 894 of file threading.py.

00894 
00895     def daemon(self):
00896         assert self._initialized, "Thread.__init__() not called"
00897         return self._daemonic

def threading.Thread.daemon (   self,
  daemonic 
) [inherited]

Definition at line 899 of file threading.py.

00899 
00900     def daemon(self, daemonic):
00901         if not self._initialized:
00902             raise RuntimeError("Thread.__init__() not called")
00903         if self._started.is_set():
00904             raise RuntimeError("cannot set daemon status of active thread");
00905         self._daemonic = daemonic

def asyncore.dispatcher.del_channel (   self,
  map = None 
) [inherited]

Definition at line 285 of file asyncore.py.

00285 
00286     def del_channel(self, map=None):
00287         fd = self._fileno
00288         if map is None:
00289             map = self._map
00290         if fd in map:
00291             #self.log_info('closing channel %d:%s' % (fd, self))
00292             del map[fd]
00293         self._fileno = None

Here is the caller graph for this function:

def threading.Thread.getName (   self) [inherited]

Definition at line 912 of file threading.py.

00912 
00913     def getName(self):
00914         return self.name

def test.test_ftplib.DummyFTPServer.handle_accepted (   self,
  conn,
  addr 
)

Definition at line 252 of file test_ftplib.py.

00252 
00253     def handle_accepted(self, conn, addr):
00254         self.handler_instance = self.handler(conn)

Definition at line 255 of file test_ftplib.py.

00255 
00256     def handle_connect(self):
        self.close()

Definition at line 262 of file test_ftplib.py.

00262 
00263     def handle_error(self):
00264         raise
00265 

Here is the caller graph for this function:

def threading.Thread.ident (   self) [inherited]

Definition at line 883 of file threading.py.

00883 
00884     def ident(self):
00885         assert self._initialized, "Thread.__init__() not called"
00886         return self._ident

def threading.Thread.is_alive (   self) [inherited]

Definition at line 887 of file threading.py.

00887 
00888     def is_alive(self):
00889         assert self._initialized, "Thread.__init__() not called"
00890         return self._started.is_set() and not self._stopped

Here is the caller graph for this function:

def threading.Thread.isDaemon (   self) [inherited]

Definition at line 906 of file threading.py.

00906 
00907     def isDaemon(self):
00908         return self.daemon

def threading.Thread.join (   self,
  timeout = None 
) [inherited]

Reimplemented in threading._DummyThread.

Definition at line 838 of file threading.py.

00838 
00839     def join(self, timeout=None):
00840         if not self._initialized:
00841             raise RuntimeError("Thread.__init__() not called")
00842         if not self._started.is_set():
00843             raise RuntimeError("cannot join thread before it is started")
00844         if self is current_thread():
00845             raise RuntimeError("cannot join current thread")
00846 
00847         if __debug__:
00848             if not self._stopped:
00849                 self._note("%s.join(): waiting until thread stops", self)
00850 
00851         self._block.acquire()
00852         try:
00853             if timeout is None:
00854                 while not self._stopped:
00855                     self._block.wait()
00856                 if __debug__:
00857                     self._note("%s.join(): thread stopped", self)
00858             else:
00859                 deadline = _time() + timeout
00860                 while not self._stopped:
00861                     delay = deadline - _time()
00862                     if delay <= 0:
00863                         if __debug__:
00864                             self._note("%s.join(): timed out", self)
00865                         break
00866                     self._block.wait(delay)
00867                 else:
00868                     if __debug__:
00869                         self._note("%s.join(): thread stopped", self)
00870         finally:
00871             self._block.release()

Here is the call graph for this function:

Here is the caller graph for this function:

def threading.Thread.name (   self) [inherited]

Definition at line 873 of file threading.py.

00873 
00874     def name(self):
00875         assert self._initialized, "Thread.__init__() not called"
00876         return self._name

Here is the caller graph for this function:

def threading.Thread.name (   self,
  name 
) [inherited]

Definition at line 878 of file threading.py.

00878 
00879     def name(self, name):
00880         assert self._initialized, "Thread.__init__() not called"
00881         self._name = str(name)

Here is the caller graph for this function:

Reimplemented from threading.Thread.

Definition at line 238 of file test_ftplib.py.

00238 
00239     def run(self):
00240         self.active = True
00241         self.__flag.set()
00242         while self.active and asyncore.socket_map:
00243             self.active_lock.acquire()
00244             asyncore.loop(timeout=0.1, count=1)
00245             self.active_lock.release()
00246         asyncore.close_all(ignore_all=True)

Here is the call graph for this function:

Here is the caller graph for this function:

def asyncore.dispatcher.set_socket (   self,
  sock,
  map = None 
) [inherited]

Definition at line 300 of file asyncore.py.

00300 
00301     def set_socket(self, sock, map=None):
        self.socket = sock

Here is the call graph for this function:

Here is the caller graph for this function:

def threading.Thread.setDaemon (   self,
  daemonic 
) [inherited]

Definition at line 909 of file threading.py.

00909 
00910     def setDaemon(self, daemonic):
00911         self.daemon = daemonic

def threading.Thread.setName (   self,
  name 
) [inherited]

Definition at line 915 of file threading.py.

00915 
00916     def setName(self, name):
00917         self.name = name
00918 
00919 # The timer class was contributed by Itamar Shtull-Trauring

Reimplemented from threading.Thread.

Definition at line 232 of file test_ftplib.py.

00232 
00233     def start(self):
00234         assert not self.active
00235         self.__flag = threading.Event()
00236         threading.Thread.start(self)
00237         self.__flag.wait()

Here is the caller graph for this function:

Definition at line 247 of file test_ftplib.py.

00247 
00248     def stop(self):
00249         assert self.active
00250         self.active = False
00251         self.join()

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 259 of file test_ftplib.py.

00259 
00260     def writable(self):
00261         return 0


Member Data Documentation

Definition at line 234 of file test_ftplib.py.

asyncore.dispatcher.accepting = False [static, inherited]

Definition at line 227 of file asyncore.py.

Definition at line 227 of file test_ftplib.py.

Definition at line 228 of file test_ftplib.py.

asyncore.dispatcher.addr = None [static, inherited]

Reimplemented in smtpd.SMTPChannel.

Definition at line 229 of file asyncore.py.

asyncore.dispatcher.closing = False [static, inherited]

Definition at line 228 of file asyncore.py.

asyncore.dispatcher.connected = False [static, inherited]

Reimplemented in asyncore.file_dispatcher.

Definition at line 226 of file asyncore.py.

asyncore.dispatcher.debug = False [static, inherited]

Definition at line 225 of file asyncore.py.

Definition at line 295 of file asyncore.py.

Definition at line 257 of file test_ftplib.py.

Reimplemented in test.test_ftplib.DummyTLS_FTPServer.

Definition at line 219 of file test_ftplib.py.

Definition at line 230 of file test_ftplib.py.

tuple asyncore.dispatcher.ignore_log_types = frozenset(['warning']) [static, inherited]

Definition at line 230 of file asyncore.py.

threading.Thread.isAlive = is_alive [static, inherited]

Definition at line 891 of file threading.py.

threading.Thread.name [inherited]

Definition at line 916 of file threading.py.

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.

Definition at line 229 of file test_ftplib.py.


The documentation for this class was generated from the following file: