mgear.rigbits.six module
Utilities for writing code that runs on Python 2 and 3
- class mgear.rigbits.six.Module_six_moves_urllib(name, doc=None)
Bases:
ModuleType
Create a six.moves.urllib namespace that resembles the Python 3 namespace
- error = <module 'mgear.rigbits.six.moves.urllib.error'>
- parse = <module 'mgear.rigbits.six.moves.urllib_parse'>
- request = <module 'mgear.rigbits.six.moves.urllib.request'>
- response = <module 'mgear.rigbits.six.moves.urllib.response'>
- robotparser = <module 'mgear.rigbits.six.moves.urllib.robotparser'>
- class mgear.rigbits.six.Module_six_moves_urllib_error(name)
Bases:
_LazyModule
Lazy loading of moved objects in six.moves.urllib_error
- ContentTooShortError
- HTTPError
- URLError
- class mgear.rigbits.six.Module_six_moves_urllib_parse(name)
Bases:
_LazyModule
Lazy loading of moved objects in six.moves.urllib_parse
- ParseResult
- SplitResult
- parse_qs
- parse_qsl
- quote
- quote_plus
- splitquery
- splittag
- splituser
- splitvalue
- unquote
- unquote_plus
- unquote_to_bytes
- urldefrag
- urlencode
- urljoin
- urlparse
- urlsplit
- urlunparse
- urlunsplit
- uses_fragment
- uses_netloc
- uses_params
- uses_query
- uses_relative
- class mgear.rigbits.six.Module_six_moves_urllib_request(name)
Bases:
_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
- parse_http_list
- parse_keqv_list
- pathname2url
- proxy_bypass
- url2pathname
- urlcleanup
- urlopen
- urlretrieve
- class mgear.rigbits.six.Module_six_moves_urllib_response(name)
Bases:
_LazyModule
Lazy loading of moved objects in six.moves.urllib_response
- addbase
- addclosehook
- addinfo
- addinfourl
- class mgear.rigbits.six.Module_six_moves_urllib_robotparser(name)
Bases:
_LazyModule
Lazy loading of moved objects in six.moves.urllib_robotparser
- RobotFileParser
- class mgear.rigbits.six.MovedAttribute(name, old_mod, new_mod, old_attr=None, new_attr=None)
Bases:
_LazyDescr
- class mgear.rigbits.six.MovedModule(name, old, new=None)
Bases:
_LazyDescr
- mgear.rigbits.six.add_metaclass(metaclass)
Class decorator for creating a class with a metaclass.
- mgear.rigbits.six.add_move(move)
Add an item to six.moves.
- mgear.rigbits.six.assertCountEqual(self, *args, **kwargs)
- mgear.rigbits.six.assertNotRegex(self, *args, **kwargs)
- mgear.rigbits.six.assertRaisesRegex(self, *args, **kwargs)
- mgear.rigbits.six.assertRegex(self, *args, **kwargs)
- mgear.rigbits.six.b(s)
Byte literal
- mgear.rigbits.six.create_unbound_method(func, cls)
- mgear.rigbits.six.ensure_binary(s, encoding='utf-8', errors='strict')
Coerce s to six.binary_type.
- For Python 2:
unicode -> encoded to str
str -> str
- For Python 3:
str -> encoded to bytes
bytes -> bytes
- mgear.rigbits.six.ensure_str(s, encoding='utf-8', errors='strict')
Coerce s to str.
- For Python 2:
unicode -> encoded to str
str -> str
- For Python 3:
str -> str
bytes -> decoded to str
- mgear.rigbits.six.ensure_text(s, encoding='utf-8', errors='strict')
Coerce s to six.text_type.
- For Python 2:
unicode -> unicode
str -> unicode
- For Python 3:
str -> str
bytes -> decoded to str
- mgear.rigbits.six.get_unbound_function(unbound)
Get the function out of a possibly unbound function
- mgear.rigbits.six.int2byte()
S.pack(v1, v2, …) -> bytes
Return a bytes object containing values v1, v2, … packed according to the format string S.format. See help(struct) for more on format strings.
- mgear.rigbits.six.iteritems(d, **kw)
Return an iterator over the (key, value) pairs of a dictionary.
- mgear.rigbits.six.iterkeys(d, **kw)
Return an iterator over the keys of a dictionary.
- mgear.rigbits.six.iterlists(d, **kw)
Return an iterator over the (key, [values]) pairs of a dictionary.
- mgear.rigbits.six.itervalues(d, **kw)
Return an iterator over the values of a dictionary.
- mgear.rigbits.six.python_2_unicode_compatible(klass)
A class 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.
- mgear.rigbits.six.raise_from(value, from_value)
- mgear.rigbits.six.remove_move(name)
Remove item from six.moves.
- mgear.rigbits.six.reraise(tp, value, tb=None)
Reraise an exception.
- mgear.rigbits.six.u(s)
Text literal
- mgear.rigbits.six.with_metaclass(meta, *bases)
Create a base class with a metaclass.