Code Duplication    Length = 16-16 lines in 2 locations

opcua/common/node.py 2 locations

@@ 472-487 (lines=16) @@
469
            event_res.append(events.Event.from_event_fields(evfilter.SelectClauses, res.EventFields))
470
        return event_res
471
472
    def history_read_events(self, details):
473
        """
474
        Read event history of a node, low-level function
475
        result code from server is checked and an exception is raised in case of error
476
        """
477
        valueid = ua.HistoryReadValueId()
478
        valueid.NodeId = self.nodeid
479
        valueid.IndexRange = ''
480
481
        params = ua.HistoryReadParameters()
482
        params.HistoryReadDetails = details
483
        params.TimestampsToReturn = ua.TimestampsToReturn.Both
484
        params.ReleaseContinuationPoints = False
485
        params.NodesToRead.append(valueid)
486
        result = self.server.history_read(params)[0]
487
        return result
488
489
    # Hack for convenience methods
490
    # local import is ugly but necessary for python2 support
@@ 422-437 (lines=16) @@
419
        result = self.history_read(details)
420
        return result.HistoryData.DataValues
421
422
    def history_read(self, details):
423
        """
424
        Read raw history of a node, low-level function
425
        result code from server is checked and an exception is raised in case of error
426
        """
427
        valueid = ua.HistoryReadValueId()
428
        valueid.NodeId = self.nodeid
429
        valueid.IndexRange = ''
430
431
        params = ua.HistoryReadParameters()
432
        params.HistoryReadDetails = details
433
        params.TimestampsToReturn = ua.TimestampsToReturn.Both
434
        params.ReleaseContinuationPoints = False
435
        params.NodesToRead.append(valueid)
436
        result = self.server.history_read(params)[0]
437
        return result
438
439
    def read_event_history(self, starttime=None, endtime=None, numvalues=0, evtypes=ua.ObjectIds.BaseEventType):
440
        """