Skip to content

Commit

Permalink
fix(w2lk): Attempt to get w2lk working (#140)
Browse files Browse the repository at this point in the history
The w2lk stuff depends a bit on e-mail, which has not yet been
verified as working on python3.

d_rats/agw.py:
  Remove extra diagnostic logging message
  Whitespace fix

d_rats/sessions/rpc.py:
d_rats/sessions/sniff.py:
  Fix deprecated GObject.SIGNAL_RUN_LAST

d_rats/version.py:
  Add DRATS_VERSION_NUM to comply with w2lk restrictions on
  version numbering.

d_rats/wl2k.py:
  Convert to python3.
  Improve Docstrings.
  Add simple test server.

Co-authored-by: John E. Malmberg <wb8tyw@gmail.com>
  • Loading branch information
JohnMalmberg authored and wb8tyw committed Sep 5, 2022
1 parent a6dd0f7 commit 8af1672
Show file tree
Hide file tree
Showing 5 changed files with 164 additions and 99 deletions.
2 changes: 1 addition & 1 deletion d_rats/agw.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,6 @@ def recv(self, length=0):
def consume(count):
buffer = self._inbuf[:count]
self._inbuf = self._inbuf[count:]
self.logger.info("recv:consume: buffer %s", type(buffer))
return buffer

if length and length < len(self._inbuf):
Expand Down Expand Up @@ -766,6 +765,7 @@ def test_server(host="127.0.0.1", port=8000):
except (ConnectionError, OSError):
global_logger.info("test_server: failed", exc_info=True)


def main():
'''Unit Test.'''

Expand Down
4 changes: 2 additions & 2 deletions d_rats/sessions/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# pylint: disable=too-many-lines
#
# Copyright 2008 Dan Smith <dsmith@danplanet.com>
# Python3 update Copyright 2021 John Malmberg <wb8tyw@qsl.net>
# Python3 update Copyright 2021-2022 John Malmberg <wb8tyw@qsl.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -177,7 +177,7 @@ class RPCJob(GObject.GObject):
:type desc: str
'''
__gsignals__ = {
"state-change" : (GObject.SIGNAL_RUN_LAST,
"state-change" : (GObject.SignalFlags.RUN_LAST,
GObject.TYPE_NONE,
(GObject.TYPE_STRING, GObject.TYPE_PYOBJECT)),
}
Expand Down
4 changes: 2 additions & 2 deletions d_rats/sessions/sniff.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'''Sniff Packets'''
#
# Copyright 2009 Dan Smith <dsmith@danplanet.com>
# Python3 update Copyright 2021 John Malmberg <wb8tyw@qsl.net>
# Python3 update Copyright 2021-2022 John Malmberg <wb8tyw@qsl.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -51,7 +51,7 @@ class SniffSession(stateless.StatelessSession, GObject.GObject):
:param k: key word arguments
'''
__gsignals__ = {
"incoming_frame" : (GObject.SIGNAL_RUN_LAST,
"incoming_frame" : (GObject.SignalFlags.RUN_LAST,
GObject.TYPE_NONE,
(GObject.TYPE_STRING, # Src
GObject.TYPE_STRING, # Dst
Expand Down
12 changes: 6 additions & 6 deletions d_rats/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
lang.install()
_ = lang.gettext


import sys

DRATS_VERSION = "0.4.00 Alpha"
DRATS_NAME="d-rats"
DRATS_DESCRIPTION="D-RATS"
# DRATS_VERSION_NUM can not have "-" characters in it.
# That will break w2lk
DRATS_VERSION_NUM = "0.4.00 Alpha"
DRATS_VERSION = DRATS_VERSION_NUM + " pre-release1"
DRATS_NAME = "d-rats"
DRATS_DESCRIPTION = "D-RATS"
DRATS_LONG_DESCRIPTION = "A communications tool for D-STAR"
AUTHORS = "Dan Smith, KK7DS" \
" Maurizio Andreotti, IZ2LXI" \
Expand Down

0 comments on commit 8af1672

Please sign in to comment.