Code Duplication    Length = 16-16 lines in 2 locations

opcua/common/node.py 2 locations

@@ 442-457 (lines=16) @@
439
            event_res.append(events.Event.from_event_fields(evfilter.SelectClauses, res.EventFields))
440
        return event_res
441
442
    def history_read_events(self, details):
443
        """
444
        Read event history of a node, low-level function
445
        result code from server is checked and an exception is raised in case of error
446
        """
447
        valueid = ua.HistoryReadValueId()
448
        valueid.NodeId = self.nodeid
449
        valueid.IndexRange = ''
450
451
        params = ua.HistoryReadParameters()
452
        params.HistoryReadDetails = details
453
        params.TimestampsToReturn = ua.TimestampsToReturn.Both
454
        params.ReleaseContinuationPoints = False
455
        params.NodesToRead.append(valueid)
456
        result = self.server.history_read(params)[0]
457
        return result
458
459
    # Hack for convenience methods
460
    # local import is ugly but necessary for python2 support
@@ 392-407 (lines=16) @@
389
        result = self.history_read(details)
390
        return result.HistoryData.DataValues
391
392
    def history_read(self, details):
393
        """
394
        Read raw history of a node, low-level function
395
        result code from server is checked and an exception is raised in case of error
396
        """
397
        valueid = ua.HistoryReadValueId()
398
        valueid.NodeId = self.nodeid
399
        valueid.IndexRange = ''
400
401
        params = ua.HistoryReadParameters()
402
        params.HistoryReadDetails = details
403
        params.TimestampsToReturn = ua.TimestampsToReturn.Both
404
        params.ReleaseContinuationPoints = False
405
        params.NodesToRead.append(valueid)
406
        result = self.server.history_read(params)[0]
407
        return result
408
409
    def read_event_history(self, starttime=None, endtime=None, numvalues=0, evtypes=ua.ObjectIds.BaseEventType):
410
        """