pds4_tools.extern.six module

Utilities for writing code that runs on Python 2 and 3

class MovedModule(name, old, new=None)[source]

Bases: pds4_tools.extern.six._LazyDescr

class MovedAttribute(name, old_mod, new_mod, old_attr=None, new_attr=None)[source]

Bases: pds4_tools.extern.six._LazyDescr

class Module_six_moves_urllib_parse(name)[source]

Bases: pds4_tools.extern.six._LazyModule

Lazy loading of moved objects in six.moves.urllib_parse

ParseResult
SplitResult
parse_qs
parse_qsl
quote
quote_plus
splitquery
splittag
splituser
unquote
unquote_plus
urldefrag
urlencode
urljoin
urlparse
urlsplit
urlunparse
urlunsplit
uses_fragment
uses_netloc
uses_params
uses_query
uses_relative
class Module_six_moves_urllib_error(name)[source]

Bases: pds4_tools.extern.six._LazyModule

Lazy loading of moved objects in six.moves.urllib_error

ContentTooShortError
HTTPError
URLError
class Module_six_moves_urllib_request(name)[source]

Bases: pds4_tools.extern.six._LazyModule

Lazy loading of moved objects in six.moves.urllib_request

AbstractBasicAuthHandler
AbstractDigestAuthHandler
BaseHandler
CacheFTPHandler
FTPHandler
FancyURLopener
FileHandler
HTTPBasicAuthHandler
HTTPCookieProcessor
HTTPDefaultErrorHandler
HTTPDigestAuthHandler
HTTPErrorProcessor
HTTPHandler
HTTPPasswordMgr
HTTPPasswordMgrWithDefaultRealm
HTTPRedirectHandler
HTTPSHandler
OpenerDirector
ProxyBasicAuthHandler
ProxyDigestAuthHandler
ProxyHandler
Request
URLopener
UnknownHandler
build_opener
getproxies
install_opener
pathname2url
proxy_bypass
url2pathname
urlcleanup
urlopen
urlretrieve
class Module_six_moves_urllib_response(name)[source]

Bases: pds4_tools.extern.six._LazyModule

Lazy loading of moved objects in six.moves.urllib_response

addbase
addclosehook
addinfo
addinfourl
class Module_six_moves_urllib_robotparser(name)[source]

Bases: pds4_tools.extern.six._LazyModule

Lazy loading of moved objects in six.moves.urllib_robotparser

RobotFileParser
class Module_six_moves_urllib[source]

Bases: module

Create a six.moves.urllib namespace that resembles the Python 3 namespace

parse = <module 'pds4_tools.extern.six.moves.urllib_parse' (built-in)>
error = <module 'pds4_tools.extern.six.moves.urllib.error' (built-in)>
request = <module 'pds4_tools.extern.six.moves.urllib.request' (built-in)>
response = <module 'pds4_tools.extern.six.moves.urllib.response' (built-in)>
robotparser = <module 'pds4_tools.extern.six.moves.urllib.robotparser' (built-in)>
add_move(move)[source]

Add an item to six.moves.

remove_move(name)[source]

Remove item from six.moves.

get_unbound_function(unbound)[source]

Get the function out of a possibly unbound function

create_bound_method(func, obj)[source]
create_unbound_method(func, cls)[source]
class Iterator[source]

Bases: object

next()[source]
iterkeys(d, **kw)[source]

Return an iterator over the keys of a dictionary.

itervalues(d, **kw)[source]

Return an iterator over the values of a dictionary.

iteritems(d, **kw)[source]

Return an iterator over the (key, value) pairs of a dictionary.

iterlists(d, **kw)[source]

Return an iterator over the (key, [values]) pairs of a dictionary.

b(s)[source]

Byte literal

u(s)[source]

Text literal

byte2int(bs)[source]
indexbytes(buf, i)[source]
assertCountEqual(self, *args, **kwargs)[source]
assertRaisesRegex(self, *args, **kwargs)[source]
assertRegex(self, *args, **kwargs)[source]
reraise(tp, value, tb=None)[source]

Reraise an exception.

exec_(_code_, _globs_=None, _locs_=None)[source]

Execute code in a namespace.

raise_from(value, from_value)[source]
print_(*args, **kwargs)[source]
wraps(wrapped, assigned=('__module__', '__name__', '__doc__'), updated=('__dict__', ))[source]
with_metaclass(meta, *bases)[source]

Create a base class with a metaclass.

add_metaclass(metaclass)[source]

Class decorator for creating a class with a metaclass.

python_2_unicode_compatible(klass)[source]

A decorator that defines __unicode__ and __str__ methods under Python 2. Under Python 3 it does nothing.

To support Python 2 and 3 with a single code base, define a __str__ method returning text and apply this decorator to the class.