Code Duplication    Length = 16-16 lines in 2 locations

opcua/common/node.py 2 locations

@@ 458-473 (lines=16) @@
455
            event_res.append(events.Event.from_event_fields(evfilter.SelectClauses, res.EventFields))
456
        return event_res
457
458
    def history_read_events(self, details):
459
        """
460
        Read event history of a node, low-level function
461
        result code from server is checked and an exception is raised in case of error
462
        """
463
        valueid = ua.HistoryReadValueId()
464
        valueid.NodeId = self.nodeid
465
        valueid.IndexRange = ''
466
467
        params = ua.HistoryReadParameters()
468
        params.HistoryReadDetails = details
469
        params.TimestampsToReturn = ua.TimestampsToReturn.Both
470
        params.ReleaseContinuationPoints = False
471
        params.NodesToRead.append(valueid)
472
        result = self.server.history_read(params)[0]
473
        return result
474
475
    # Hack for convenience methods
476
    # local import is ugly but necessary for python2 support
@@ 408-423 (lines=16) @@
405
        result = self.history_read(details)
406
        return result.HistoryData.DataValues
407
408
    def history_read(self, details):
409
        """
410
        Read raw history of a node, low-level function
411
        result code from server is checked and an exception is raised in case of error
412
        """
413
        valueid = ua.HistoryReadValueId()
414
        valueid.NodeId = self.nodeid
415
        valueid.IndexRange = ''
416
417
        params = ua.HistoryReadParameters()
418
        params.HistoryReadDetails = details
419
        params.TimestampsToReturn = ua.TimestampsToReturn.Both
420
        params.ReleaseContinuationPoints = False
421
        params.NodesToRead.append(valueid)
422
        result = self.server.history_read(params)[0]
423
        return result
424
425
    def read_event_history(self, starttime=None, endtime=None, numvalues=0, evtypes=ua.ObjectIds.BaseEventType):
426
        """