Skip to content

[STYLE] Mass Refactoring of triple double quotes #327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ import random # for random port

# set up some stuff
_fixture_PORT_arg = int(random.SystemRandom().randint(49152, 65535))
_fixture_mcast_GRP_arg = """224.0.0.1""" # only use dotted notation for multicast group addresses
_fixture_host_BIND_arg = """224.0.0.1"""
_fixture_mcast_GRP_arg = "224.0.0.1" # only use dotted notation for multicast group addresses
_fixture_host_BIND_arg = "224.0.0.1"

# spawn a listening proc

Expand All @@ -107,15 +107,15 @@ inputHandler()
from multiprocessing import Process as Process

_fixture_HEAR_kwargs = {
"""is_daemon""": True,
"""port""": _fixture_PORT_arg,
"""group""": _fixture_host_BIND_arg
"is_daemon": True,
"port": _fixture_PORT_arg,
"group": _fixture_host_BIND_arg
}
p = Process(
target=multicast.hear.McastHEAR().doStep,
name="HEAR", kwargs=_fixture_HEAR_kwargs
)
p.daemon = _fixture_HEAR_kwargs["""is_daemon"""]
p.daemon = _fixture_HEAR_kwargs["is_daemon"]
p.start()

# ... use CTL+C (or signal 2) to shutdown the server 'p'
Expand All @@ -128,9 +128,9 @@ _and elsewhere (like another function or even module) for the sender:_
# assuming already did 'import multicast as multicast'

_fixture_SAY_args = [
"""--port""", _fixture_PORT_arg,
"""--group""", _fixture_mcast_GRP_arg,
"""--message""", """'test message'"""
"--port", _fixture_PORT_arg,
"--group", _fixture_mcast_GRP_arg,
"--message", "'test message'"
]
try:
multicast.__main__.McastDispatch().doStep(["SAY", _fixture_SAY_args])
Expand Down
12 changes: 6 additions & 6 deletions docs/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ from multiprocessing import Process
# set up some stuff
_fixture_PORT_arg = int(59595)
# Valid multicast addresses range from 224.0.0.0 to 239.255.255.255
_fixture_mcast_GRP_arg = """224.0.0.1""" # only use dotted notation for multicast group addresses
_fixture_host_BIND_arg = """224.0.0.1""" # only use dotted notation for multicast group addresses
_fixture_mcast_GRP_arg = "224.0.0.1" # only use dotted notation for multicast group addresses
_fixture_host_BIND_arg = "224.0.0.1" # only use dotted notation for multicast group addresses
_fixture_host_IFACE_arg = None # Initial value representing no specific interface
_fixture_HEAR_args = [
"--port", _fixture_PORT_arg,
Expand All @@ -38,7 +38,7 @@ def print_loop_stub(func, iterations=5):
@print_loop_stub
def inputHandle():
test_RCEV = multicast.recv.McastRECV()
buffer_string = str("""""")
buffer_string = str()
(didWork, result) = test_RCEV.doStep(
groups=[_fixture_mcast_GRP_arg],
port=_fixture_PORT_arg,
Expand Down Expand Up @@ -69,9 +69,9 @@ _and elsewhere (like another function or even module) for the sender:_
# assuming already did 'import multicast'

_fixture_SAY_args = [
"""--port""", _fixture_PORT_arg,
"""--group""", _fixture_mcast_GRP_arg,
"""--message""", """'test message'"""
"--port", _fixture_PORT_arg,
"--group", _fixture_mcast_GRP_arg,
"--message", "'test message'"
]
try:
multicast.__main__.McastDispatch().doStep("SAY", _fixture_SAY_args)
Expand Down
50 changes: 25 additions & 25 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath(""".."""))
sys.path.insert(0, os.path.abspath(".."))
from docs.utils import _validate_git_ref # noqa
from docs.utils import slugify_header # noqa

Expand All @@ -58,8 +58,8 @@
variable is not set.
"""

sys.path.insert(1, os.path.abspath("""multicast"""))
sys.path.insert(1, os.path.abspath("""tests"""))
sys.path.insert(1, os.path.abspath("multicast"))
sys.path.insert(1, os.path.abspath("tests"))

# -- General configuration -----------------------------------------------------

Expand All @@ -71,18 +71,18 @@
# for md us 'autodoc2' (pip install sphinx-autodoc2)
# for rst use 'sphinx.ext.autodoc'
extensions = [
"""sphinx.ext.napoleon""",
"""autodoc2""",
"""sphinx.ext.autosectionlabel""",
"""sphinx.ext.githubpages""",
"""myst_parser""",
"""sphinx_design""",
"""sphinx.ext.autosummary""",
"""sphinx.ext.doctest""",
"""sphinx.ext.todo""",
"""sphinx.ext.linkcode""",
"""sphinx.ext.viewcode""",
"""sphinx.ext.intersphinx""",
"sphinx.ext.napoleon",
"autodoc2",
"sphinx.ext.autosectionlabel",
"sphinx.ext.githubpages",
"myst_parser",
"sphinx_design",
"sphinx.ext.autosummary",
"sphinx.ext.doctest",
"sphinx.ext.todo",
"sphinx.ext.linkcode",
"sphinx.ext.viewcode",
"sphinx.ext.intersphinx",
]

# for md auto-docs
Expand Down Expand Up @@ -179,15 +179,15 @@
pygments_style_dark = "github-dark"

pygments_options = {
"""tabsize""": 4,
"""stripall""": False,
"""encoding""": "utf-8",
"tabsize": 4,
"stripall": False,
"encoding": "utf-8",
}

pygments_yaml_options = {
"""tabsize""": 2,
"""stripall""": True,
"""encoding""": "utf-8",
"tabsize": 2,
"stripall": True,
"encoding": "utf-8",
}

highlight_options = {
Expand Down Expand Up @@ -421,19 +421,19 @@

linkcode_url_prefix: str = f"https://github.com/reactive-firewall/{project}"

suffix = """/issues/%s"""
suffix = "/issues/%s"

extlinks = {
"""issue""": (
"issue": (
f"{linkcode_url_prefix}/{suffix}",
"""issue #%s"""
"issue #%s"
)
}

# try to link with official python3 documentation.
# see https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html for more
intersphinx_mapping = {
"""python""": ("""https://docs.python.org/3""", (None, """python-inv.txt"""))
"python": ("https://docs.python.org/3", (None, "python-inv.txt"))
}


Expand Down
52 changes: 26 additions & 26 deletions multicast/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"""hear.McastHEAR""",
]

__package__ = """multicast""" # skipcq: PYL-W0622
__package__ = "multicast" # skipcq: PYL-W0622
"""The package of this program.

Minimal Acceptance Testing:
Expand All @@ -80,7 +80,7 @@

"""

__module__ = """multicast"""
__module__ = "multicast"
"""The module of this program.

Minimal Acceptance Testing:
Expand All @@ -96,7 +96,7 @@

"""

__name__ = """multicast""" # skipcq: PYL-W0622
__name__ = "multicast" # skipcq: PYL-W0622
"""The name of this program.

Minimal Acceptance Testing:
Expand All @@ -114,7 +114,7 @@

global __version__ # skipcq: PYL-W0604

__version__ = """2.0.4"""
__version__ = "2.0.4"
"""The version of this program.

Minimal Acceptance Testing:
Expand Down Expand Up @@ -265,7 +265,7 @@

global _MCAST_DEFAULT_GROUP # skipcq: PYL-W0604

_MCAST_DEFAULT_GROUP = """224.0.0.1"""
_MCAST_DEFAULT_GROUP = "224.0.0.1"
"""Arbitrary group to use by default, though any mcst grp would work.

The Value of "224.0.0.1" is chosen as a default multicast group as per RFC-5771
Expand Down Expand Up @@ -378,7 +378,7 @@
from . import exceptions # pylint: disable=cyclic-import - skipcq: PYL-R0401, PYL-C0414
else: # pragma: no branch
global exceptions # skipcq: PYL-W0604
exceptions = sys.modules["""multicast.exceptions"""]
exceptions = sys.modules["multicast.exceptions"]

EXIT_CODES = exceptions.EXIT_CODES
"""See multicast.exceptions.EXIT_CODES."""
Expand All @@ -395,12 +395,12 @@
exit_on_exception = exceptions.exit_on_exception
"""See multicast.exceptions.exit_on_exception function."""

if 'multicast.env' not in sys.modules:
if "multicast.env" not in sys.modules:
# pylint: disable=cyclic-import - skipcq: PYL-R0401, PYL-C0414
from . import env # pylint: disable=cyclic-import - skipcq: PYL-R0401, PYL-C0414
else: # pragma: no branch
global env # skipcq: PYL-W0604
env = sys.modules["""multicast.env"""]
env = sys.modules["multicast.env"]

_config = env.load_config()

Expand Down Expand Up @@ -439,13 +439,13 @@ class mtool(abc.ABC):

"""

__module__ = """multicast"""
__module__ = "multicast"

__proc__ = None

__prologue__ = """Add a prologue here."""
__prologue__ = "Add a prologue here."

__epilogue__ = """Add an epilogue here."""
__epilogue__ = "Add an epilogue here."

@classmethod
def buildArgs(cls, calling_parser_group):
Expand Down Expand Up @@ -498,21 +498,21 @@ def buildArgs(cls, calling_parser_group):
add_help=False
)
group = calling_parser_group.add_mutually_exclusive_group(required=False)
group.add_argument('-h', '--help', action='help')
group.add_argument("-h", "--help", action="help")
group.add_argument(
"-v",
"--version",
action="version",
version=str("%(prog)s {version}").format(version=str(__version__))
)
calling_parser_group.add_argument(
"""--use-std""", dest='is_std', default=False, action='store_true'
"--use-std", dest="is_std", default=False, action="store_true"
)
calling_parser_group.add_argument(
"""--daemon""", dest='is_daemon', default=False, action='store_true'
"--daemon", dest="is_daemon", default=False, action="store_true"
)
subparsers = calling_parser_group.add_subparsers(
title="Tools", dest="cmd_tool", help=str("""Sub-Commands."""), metavar="CMD"
title="Tools", dest="cmd_tool", help=str("Sub-Commands."), metavar="CMD"
)
if mtool.__class__.__subclasscheck__(mtool, cls): # pragma: no branch
cls.setupArgs(subparsers)
Expand Down Expand Up @@ -662,44 +662,44 @@ def doStep(self, *args, **kwargs): # pragma: no cover
raise NotImplementedError("Subclasses must implement this method.")


if 'multicast.skt' not in sys.modules:
if "multicast.skt" not in sys.modules:
from . import skt as skt # pylint: disable=cyclic-import - skipcq: PYL-R0401, PYL-C0414
else: # pragma: no branch
global skt # skipcq: PYL-W0604
skt = sys.modules["""multicast.skt"""]
skt = sys.modules["multicast.skt"]

genSocket = skt.genSocket
"""See multicast.skt.genSocket."""

endSocket = skt.endSocket
"""See multicast.skt.endSocket."""

if 'multicast.recv' not in sys.modules:
if "multicast.recv" not in sys.modules:
from . import recv as recv # pylint: disable=cyclic-import - skipcq: PYL-R0401, PYL-C0414
else: # pragma: no branch
global recv # skipcq: PYL-W0604
recv = sys.modules["""multicast.recv"""]
recv = sys.modules["multicast.recv"]

if 'multicast.send' not in sys.modules:
if "multicast.send" not in sys.modules:
from . import send as send # pylint: disable=cyclic-import - skipcq: PYL-R0401, PYL-C0414
else: # pragma: no branch
global send # skipcq: PYL-W0604
send = sys.modules["""multicast.send"""]
send = sys.modules["multicast.send"]

if 'multicast.hear' not in sys.modules:
if "multicast.hear" not in sys.modules:
from . import hear as hear # pylint: disable=cyclic-import - skipcq: PYL-R0401, PYL-C0414
else: # pragma: no branch
global hear # skipcq: PYL-W0604
hear = sys.modules["""multicast.hear"""]
hear = sys.modules["multicast.hear"]

try:
if """multicast.__main__""" in sys.modules: # pragma: no cover
if "multicast.__main__" in sys.modules: # pragma: no cover
global __main__ # skipcq: PYL-W0604
__main__ = sys.modules["""multicast.__main__"""]
__main__ = sys.modules["multicast.__main__"]
except Exception:
import multicast.__main__ as __main__ # pylint: disable=cyclic-import - skipcq: PYL-R0401

if __name__ in u'__main__':
if __name__ in u"__main__":
__EXIT_CODE = 2
if __main__.main is not None:
__EXIT_CODE = __main__.main(sys.argv[1:])
Expand Down
Loading
Loading