projects
/
SaveMySugar
/
python3-savemysugar.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
CallDistanceTransceiver.py: clarify the use of a transceiver in DummyModem
[SaveMySugar/python3-savemysugar.git]
/
src
/
savemysugar
/
CallDistanceTransceiver.py
diff --git
a/src/savemysugar/CallDistanceTransceiver.py
b/src/savemysugar/CallDistanceTransceiver.py
index
15fcdae
..
01414a2
100755
(executable)
--- a/
src/savemysugar/CallDistanceTransceiver.py
+++ b/
src/savemysugar/CallDistanceTransceiver.py
@@
-17,6
+17,8
@@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+import logging
+import time
# This hack allows importing local modules also when
# __name__ == "__main__"
# This hack allows importing local modules also when
# __name__ == "__main__"
@@
-27,9
+29,6
@@
except SystemError:
from MorseDistanceModulator import MorseDistanceModulator
from MorseTranslator import MorseTranslator
from MorseDistanceModulator import MorseDistanceModulator
from MorseTranslator import MorseTranslator
-import logging
-import time
-
def log_symbol(distance, symbol, extra_info=""):
logging.info("distance: %.2f Received \"%s\"%s", distance, symbol,
def log_symbol(distance, symbol, extra_info=""):
logging.info("distance: %.2f Received \"%s\"%s", distance, symbol,
@@
-297,7
+296,12
@@
def test_transmit_receive():
def __init__(self):
self.ring_count = 0
def __init__(self):
self.ring_count = 0
- # Take trasmission times from a transceiver
+ # A transceiver will be used to get the symbol distance to fake in
+ # get_response, but it will only be assigned _after_ DummyModem has
+ # been instantiated.
+ #
+ # This placeholder here avoids an attribute-defined-outside-init
+ # warning from pylint.
self.transceiver = None
random.seed(None)
self.transceiver = None
random.seed(None)