From 9b5184f4619dd1c2113a221931c5a06f5e3a1f79 Mon Sep 17 00:00:00 2001 From: Emmanuel Blot Date: Fri, 6 Sep 2019 11:15:42 +0200 Subject: [PATCH] Remove UTF8 explicit def --- pybootd/__init__.py | 4 +--- pybootd/daemons.py | 9 ++++----- pybootd/pxed.py | 2 -- pybootd/tftpd.py | 2 -- setup.py | 3 +-- 5 files changed, 6 insertions(+), 14 deletions(-) diff --git a/pybootd/__init__.py b/pybootd/__init__.py index 1e81d7e..415bfba 100644 --- a/pybootd/__init__.py +++ b/pybootd/__init__.py @@ -1,6 +1,4 @@ -# -*- coding: utf-8 -*- -# -# Copyright (c) 2010-2016 Emmanuel Blot +# Copyright (c) 2010-2019 Emmanuel Blot # Copyright (c) 2010-2011 Neotion # # This library is free software; you can redistribute it and/or diff --git a/pybootd/daemons.py b/pybootd/daemons.py index 457bd35..c6a7d64 100755 --- a/pybootd/daemons.py +++ b/pybootd/daemons.py @@ -1,5 +1,4 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- +#!/usr/bin/env python3 # # Copyright (c) 2010-2019 Emmanuel Blot # Copyright (c) 2010-2011 Neotion @@ -20,6 +19,7 @@ """Tiny BOOTP/DHCP/TFTP/PXE server""" +from argparse import ArgumentParser from os.path import isfile from threading import Thread from sys import exit as sysexit, modules, stderr @@ -68,7 +68,6 @@ class TftpDaemon(Thread): def main(): debug = False try: - from argparse import ArgumentParser argparser = ArgumentParser(description=modules[__name__].__doc__) argparser.add_argument('-c', '--config', dest='config', default='pybootd/etc/pybootd.ini', @@ -92,7 +91,7 @@ def main(): cfgparser = EasyConfigParser() with open(pybootd_path(args.config), 'rt') as config: - cfgparser.readfp(config) + cfgparser.read_file(config) logger = logger_factory(logtype=cfgparser.get('logger', 'type', 'stderr'), @@ -119,5 +118,5 @@ def main(): print(format_exc(chain=False), file=stderr) sysexit(1) except KeyboardInterrupt: - print("\nAborting...") + print("\nAborting...", file=stderr) sysexit(2) diff --git a/pybootd/pxed.py b/pybootd/pxed.py index ad4f5e9..7ae5c03 100644 --- a/pybootd/pxed.py +++ b/pybootd/pxed.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -# # Copyright (c) 2010-2019 Emmanuel Blot # Copyright (c) 2010-2011 Neotion # diff --git a/pybootd/tftpd.py b/pybootd/tftpd.py index fd189d5..03990ac 100644 --- a/pybootd/tftpd.py +++ b/pybootd/tftpd.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -# # Copyright (c) 2010-2019 Emmanuel Blot # Copyright (c) 2010-2011 Neotion # diff --git a/setup.py b/setup.py index 8acab9b..570321c 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,4 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- +#!/usr/bin/env python3 # # Copyright (c) 2010-2019 Emmanuel Blot # Copyright (c) 2010-2011 Neotion