Compare commits

...

2 Commits

Author SHA1 Message Date
d729d69ea3 adjust line endings depending on invocation
All checks were successful
Test / Test (push) Successful in 1m45s
2023-08-31 12:41:23 -05:00
498defc003 flush output from stdout so that it transmits 2023-05-29 10:56:04 -05:00

View File

@ -16,6 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
import io
import logging
import sys
@ -42,6 +43,15 @@ class Console():
self.pluginloader = PluginLoader(self)
self.pluginloader.load_plugins()
# Configure stdin and stdout newlines and encoding
# when invoked by ax25:
if not sys.stdin.isatty():
sys.stdout = io.TextIOWrapper(sys.stdout.detach(),
newline=None)
sys.stdin = io.TextIOWrapper(sys.stdin.detach(),
newline=None)
#
# Input and output
#
@ -102,6 +112,7 @@ class Console():
"""
sys.stdout.write(output + '\r\n')
sys.stdout.flush()
def print_configuration(self) -> None:
"""Print the current running configuration.