* Move common code into Tab parent class
* The Tab init now accepts creation with name, child_widget and tab_label but
will still accept the 'oldstyle' contructor to keep backwards compatibility
with 3rd-party plugins.
* Create namedtuple TabWidget with widget, format func and status_keys. The
TabWidget are stored in a tab_widgets dict making it easier to create, save
and update large numbers of gtk widgets.
- Create new status entry `time_since_transfer` and getter that is
calculated from lt time_since_upload and time_since_download.
- Add/update all UIs and formatters.
- Included update to console layout to match other uis
- Preparation work for using six or future module for Py2/3 compat. The
code will be written in Python 3 with Python 2 fallbacks.
- Added some Py3 imports with Py2 fallbacks to make it easier to remove
Py2 code in future.
- Replace xrange with range (sort out import as top of files in future).
- Workaround Py2to3 basestring issue with inline if in instances. This means
every usage of basestring is more considered.
- Replace iteritems and itervalues for items and values. There might be a
performance penalty on Py2 so might need to revisit this change.
- An ImportError is raised if a module is listed in the entrypoint
but is not actually installed. The code will now catch this and
will de-list the ui module that failed.
There is a bug in Py2 setuptools where the build fails if unicode dict keys
are passed to package_data:
`package_data must be a dictionary mapping package names to lists of wildcard patterns`
The easiest workaround is to remove unicode_literals use in setup.py as it is not that important.
- Python 3 renames `unicode` type to `str` and introduces `bytes` type.
- Python 2.7 has `bytes` but is only an alias for `str` so restricted
to comparisons but helps keep compatibility.
- To test for unicode string on Py2 and Py3 uses the "''.__class__" type.
- Remove usage of utf8encode and just encode, problems with bytes being passed
in code will be picked up faster.
- Where possible refactor out isinstance for try..except duck-typing.
- Switch to using Python 3 naming convention where str now refers to unicode
and bytes are encoded strings.
- Cleanup docs and code
- Also rename convert_to_utf8 to utf8_encode_structure to clarify functionality.