Custom Query (13436 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (28 - 30 of 13436)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Ticket Resolution Summary Owner Reporter
#13622 fixed Python Bindings: traceback in datetime.timestamp() rcrdnalor rcrdnalor
Description

Using Python3.6, the following sequence works:

$ python3
Python 3.6.9 (default, Apr 18 2020, 01:56:04) 
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from MythTV import datetime
>>> t = datetime.now()
>>> t.timestamp()
1590160731.214045

In contrast, on Python3.8, this gives an error:

$ python3
Python 3.8.2 (default, Apr 27 2020, 15:53:34) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from MythTV import datetime
>>> t = datetime.now()
>>> t.timestamp()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/local-admin/MythTV/mythservices/MythTV/utility/dt.py", line 483, in timestamp
    return ((utc_naive - utc_epoch).total_seconds())
TypeError: can't subtract offset-naive and offset-aware datetimes

Error reported on the MythTV forum: https://forum.mythtv.org/viewtopic.php?f=6&t=3793

#13621 fixed Convert from Qt foreach() macro to standard C++ range-for. David Hampton David Hampton
Description

The use of foreach has caused some unexpected problems in the scheduler, which were chased down to containers detaching in the call to get the last item of the range. This detach guarantees that the current iterator is now invalid and the operation will eventually run off the end of the range.

The Qt company is also planning to remove the foreach/Q_FOREACH macro in an (as yet unspecified) upcoming release.

Replace all instances of the foreach macro with a standard C++ range-for iteration, and (in almost all cases) use the qAsConst macro mark to the ranges as constant to prevent detaching of the data. There are a couple of places where adding the qAsConst macro throws a compiler error, so omit qAsConst in those instances. These cases all appear to occur with temporary lists, and this behavior is intentional on Qt's part (see https://doc.qt.io/qt-5/qtglobal.html#qAsConst-1).

#13619 fixed Python services-api enhancements Bill Meek rcrdnalor
Description

1) Python's lxml module works best if fed with raw data from a 'Request.session.get' response.

A new option provided by this patch allows returning data as raw data i.e.: returning the recieved 'response.content'. This can be easily handled by the lxml.etree.fromstring() method.

An example how to use this feature:

$ python3
>>> from MythTV.services_api import send as API
>>> from lxml import etree
>>> host = "localhost"
>>> mythrequest = API.Send(host)
>>> endpoint = "/Dvr/GetRecordedList"
>>> restdata = "Descending=True&Count=3"
>>> opts     = {'rawxml': True}                ### < --- new option
>>> response = mythrequest.send(endpoint=endpoint, rest=restdata, opts=opts)
>>> eroot = etree.fromstring(response)
>>> print(etree.tostring(eroot, pretty_print=True, encoding='unicode')) 

Verified also with python2.

Attached a patch adding this additional option.

2) The mythservices-api requires the 'post' data to be passed as dictionary. For classes derived from dictionary (dict), it is not mandatory to provide an attribute 'keys', but the methods 'keys()', 'values()', 'items()' must always be implemented.

Using the latter methods, allows logging of a 'post' operation for those classes derived from 'dict'.

Otherwise, on get a traceback showing an 'AttributeError' or a 'KeyError'. The class 'OrdDict' from the python bindings is such an example.

Attached a patch that improves logging for 'post' operations.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Note: See TracQuery for help on using queries.