parmed.utils.six module

Utilities for writing code that runs on Python 2 and 3

class parmed.utils.six.Module_six_moves_urllib(name, doc=None)[source]

Bases: module

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

error = <module 'parmed.utils.six.moves.urllib.error' (<parmed.utils.six._SixMetaPathImporter object>)>
parse = <module 'parmed.utils.six.moves.urllib_parse'>
request = <module 'parmed.utils.six.moves.urllib.request' (<parmed.utils.six._SixMetaPathImporter object>)>
response = <module 'parmed.utils.six.moves.urllib.response'>
robotparser = <module 'parmed.utils.six.moves.urllib.robotparser'>
class parmed.utils.six.Module_six_moves_urllib_error(name)[source]

Bases: parmed.utils.six._LazyModule

Lazy loading of moved objects in six.moves.urllib_error

ContentTooShortError
class parmed.utils.six.Module_six_moves_urllib_parse(name)[source]

Bases: parmed.utils.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 parmed.utils.six.Module_six_moves_urllib_request(name)[source]

Bases: parmed.utils.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
urlretrieve
class parmed.utils.six.Module_six_moves_urllib_response(name)[source]

Bases: parmed.utils.six._LazyModule

Lazy loading of moved objects in six.moves.urllib_response

addbase
addclosehook
addinfo
addinfourl
class parmed.utils.six.Module_six_moves_urllib_robotparser(name)[source]

Bases: parmed.utils.six._LazyModule

Lazy loading of moved objects in six.moves.urllib_robotparser

RobotFileParser
class parmed.utils.six.MovedAttribute(name, old_mod, new_mod, old_attr=None, new_attr=None)[source]

Bases: parmed.utils.six._LazyDescr

class parmed.utils.six.MovedModule(name, old, new=None)[source]

Bases: parmed.utils.six._LazyDescr

parmed.utils.six.add_metaclass(metaclass)[source]

Class decorator for creating a class with a metaclass.

parmed.utils.six.add_move(move)[source]

Add an item to six.moves.

parmed.utils.six.assertCountEqual(self, *args, **kwargs)[source]
parmed.utils.six.assertRaisesRegex(self, *args, **kwargs)[source]
parmed.utils.six.assertRegex(self, *args, **kwargs)[source]
parmed.utils.six.b(s)[source]

Byte literal

parmed.utils.six.get_unbound_function(unbound)[source]

Get the function out of a possibly unbound function

parmed.utils.six.iteritems(d, **kw)[source]

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

parmed.utils.six.iterkeys(d, **kw)[source]

Return an iterator over the keys of a dictionary.

parmed.utils.six.iterlists(d, **kw)[source]

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

parmed.utils.six.itervalues(d, **kw)[source]

Return an iterator over the values of a dictionary.

parmed.utils.six.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.

parmed.utils.six.raise_from(value, from_value)[source]
parmed.utils.six.remove_move(name)[source]

Remove item from six.moves.

parmed.utils.six.reraise(tp, value, tb=None)[source]

Reraise an exception.

parmed.utils.six.u(s)[source]

Text literal

parmed.utils.six.with_metaclass(meta, *bases)[source]

Create a base class with a metaclass.