- Jul 09, 2017
-
-
hydrargyrum authored
-
- Jul 08, 2017
-
-
hydrargyrum authored
-
hydrargyrum authored
-
hydrargyrum authored
Backend.fillobj sets a field to NotAvailable if it's not complete. Always returning False in __iscomplete__ prevents the field from ever working with fillobj. Since the StreamInfo is volatile, it's not just the StreamInfo's fields which should be reloaded with fillobj, it should rather be the whole StreamInfo object (or its container, e.g. Radio).
-
object.__new__ only takes one argument: the class to construct. It accepts more arguments only if __init__ is not overloaded, but it is overloaded in Abstract*'s parent classes, so don't pass more args. In Python 2, it was just deprecated, in Python 3, it doesn't work.
-
When using dir() to find URL fields, we also checked @properties, which can access other fields that are not defined yet. Exclude them since they probably won't be URLs anyway.
-
Creating a new type on-the-fly prevents from using isinstance, super and more. We can get rid of this by changing the class hierarchy dynamically. Also, the modules should now pass the Ouiboube instance as a keyword-argument to the Browser, so the arguments do not have to be modified between __new__ and __init__.
-
The use of metaclass is not required for constructing the dict of URLs. Plus, it prevents changing the class hierarchy at runtime, which could be an improvement for AbstractBrowser.
-
-
Romain Bignon authored
-
-
Many modules do not have the "$" in Values regexps, and it's almost always a mistake.
-
An internal method was used, which was removed in Python 3. And a wrong comparison was made.
-
python3's httplib uses readinto and flush which are not implemented by nss.
-
This reverts commit d0a2a6bbe3054a4cb34cf8d5b0bac7e93ac3d509.
-
- Jun 26, 2017
-
-
hydrargyrum authored
literal_eval returns str in python 3, not bytes
-
hydrargyrum authored
-
- Jun 23, 2017
-
-
hydrargyrum authored
-
hydrargyrum authored
-
hydrargyrum authored
In python3, when passing bytes, it did not try to decode.
-
hydrargyrum authored
-
Florent Fourcot authored
We sometimes raises a SkipItem exception in attributes parsing, instead to use filters like "condition" of "validate" methods. Even it was not designed for that before, it's sometimes useful and easier to do so. Since we accept it as a valid behavior (upper levels handle this exception), we should not flood our users with a warning
-
- Jun 19, 2017
-
-
hydrargyrum authored
Since those classes store some class-level declared fields (Field and URL) in a dictionary and are not present as attributes, those fields are not present in dir() even though __getattr__ will find them. By reimplementing __dir__, they can be discovered as ordinary attributes.
-
hydrargyrum authored
raise_from wraps the Python3 syntax "raise exc from cause" which is useful when an exception is raised to wrap a lower-level exception.
-
hydrargyrum authored
-
hydrargyrum authored
By default, PyYAML dumps all fields, giving poor results for BaseObject and its fields: !!python/unicode paris: !!python/object:weboob.capabilities.calendar.Query _fields: !!python/object/apply:collections.OrderedDict - - - url - !!python/object:weboob.capabilities.base.StringField _creation_counter: 0 doc: url types: !!python/tuple - &id003 !!python/name:__builtin__.unicode value: !!python/object:weboob.capabilities.base.NotLoadedType {} etc. When pickle methods are provided, PyYAML uses them. In this case, a BaseObject will be dumped as a plain old dict.
-
hydrargyrum authored
-
hydrargyrum authored
-
hydrargyrum authored
-
hydrargyrum authored
PyYAML tries to write strs, so the file must be opened with an encoding.
-
hydrargyrum authored
In Python2 anyway, bytes is an alias for str.
-
hydrargyrum authored
-
hydrargyrum authored
__str__ is reimplemented in terms of __unicode__ and __repr__ else.
-
hydrargyrum authored
Most command-line applications should only work with unicode, without needing to encode/decode everytime. On Python 2, try harder to find a proper encoding when stdio is not a TTY.
-
hydrargyrum authored
This way, we can just write unicode objects without having to encode
-
hydrargyrum authored
Python 3 does not support sorting by cmp function. TODO: fix ordering with None/NotLoaded/NotAvailable?
-
hydrargyrum authored
exc_clear does not exist in python3 use str() conversion for python3
-
hydrargyrum authored
-
hydrargyrum authored
These methods seem to be reimplementation of similar methods and seem incompatible with python3
-
hydrargyrum authored
The syntax for using a metaclass is different in python2 and python3, and there are existing helpers. Add six as a dependency in setup.py.
-