Changeset 1488:6feef85c45b2


Ignore:
Timestamp:
Apr 20, 2014, 11:38:52 AM (5 years ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
Message:
Support debug level when creating session factories.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/session.py

    r1487 r1488  
    1818
    1919def session_factory(base_class=ftplib.FTP, port=21, use_passive_mode=None,
    20                     encrypt_data_channel=None):
     20                    encrypt_data_channel=None, debug_level=None):
    2121    """
    2222    Create and return a session factory according to the keyword
     
    3939    base class. If `False` or `None` (`None` is the default), don't
    4040    call the method.
     41
     42    debug_level: Debug level (integer) to be set on a session
     43    instance. The default is `None`, meaning no debugging output.
    4144
    4245    This function should work the base classes for `ftplib.FTP`,
     
    6467                self.auth_tls()
    6568                self._fix_socket()
     69            if debug_level is not None:
     70                self.set_debuglevel(debug_level)
    6671            self.login(user, password)
    6772            if use_passive_mode is not None:
Note: See TracChangeset for help on using the changeset viewer.