Change in osmocom-bb[master]: trx_toolkit/data_msg.py: decorate abstract methods as such

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

fixeria gerrit-no-reply at lists.osmocom.org
Fri Feb 26 21:28:18 UTC 2021


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/23131 )


Change subject: trx_toolkit/data_msg.py: decorate abstract methods as such
......................................................................

trx_toolkit/data_msg.py: decorate abstract methods as such

Change-Id: I27fdcfdabc2b5318ab3e958d2e5446e670fe9035
Related: OS#4006, SYS#4895
---
M src/target/trx_toolkit/data_msg.py
1 file changed, 12 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/31/23131/1

diff --git a/src/target/trx_toolkit/data_msg.py b/src/target/trx_toolkit/data_msg.py
index 86670fc..22818a4 100644
--- a/src/target/trx_toolkit/data_msg.py
+++ b/src/target/trx_toolkit/data_msg.py
@@ -23,6 +23,7 @@
 
 import random
 import struct
+import abc
 
 from enum import Enum
 from gsm_shared import *
@@ -55,7 +56,7 @@
 				return mod
 		return None
 
-class DATAMSG:
+class DATAMSG(abc.ABC):
 	""" TRXD (DATA) message codec (common part).
 
 	The DATA messages are used to carry bursts in both directions
@@ -135,24 +136,29 @@
 		# (VER + TN) + FN
 		return 1 + 4
 
-	# Generates message specific header
+	@abc.abstractmethod
 	def gen_hdr(self):
+		''' Generate message specific header. '''
 		raise NotImplementedError
 
-	# Parses message specific header
+	@abc.abstractmethod
 	def parse_hdr(self, hdr):
+		''' Parse message specific header. '''
 		raise NotImplementedError
 
-	# Generates message specific burst
+	@abc.abstractmethod
 	def gen_burst(self):
+		''' Generate message specific burst. '''
 		raise NotImplementedError
 
-	# Parses message specific burst
+	@abc.abstractmethod
 	def parse_burst(self, burst):
+		''' Parse message specific burst. '''
 		raise NotImplementedError
 
-	# Generate a random message specific burst
+	@abc.abstractmethod
 	def rand_burst(self):
+		''' Generate a random message specific burst. '''
 		raise NotImplementedError
 
 	# Generates a random frame number

-- 
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/23131
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I27fdcfdabc2b5318ab3e958d2e5446e670fe9035
Gerrit-Change-Number: 23131
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210226/776dce48/attachment.htm>


More information about the gerrit-log mailing list