aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Goes <[email protected]>2019-04-29 21:12:58 -0600
committerGravatar GitHub <[email protected]>2019-04-29 21:12:58 -0600
commit40d4972a3420a1f772a9d0464a4369575c11cb5f (patch)
treed30421204a84a104da5411981e5b49c63ede5f18
parentMerge pull request #19 from python-discord/urllib3-vuln-fix (diff)
parentRemove space between ignored flake8 rules (diff)
Merge pull request #21 from python-discord/docstring-lint-change
Docstring lint change
-rw-r--r--.flake82
-rw-r--r--config.py1
-rw-r--r--rmq.py2
-rw-r--r--snekbox.py3
-rw-r--r--snekweb.py2
5 files changed, 1 insertions, 9 deletions
diff --git a/.flake8 b/.flake8
index cc5f423..e3a35a8 100644
--- a/.flake8
+++ b/.flake8
@@ -6,7 +6,7 @@ ignore=
# Missing Docstrings
D100,D104,D107,
# Docstring Whitespace
- D202,D203,D204,D212,D214,D215,
+ D203,D212,D214,D215,
# Docstring Quotes
D301,D302,
# Docstring Content
diff --git a/config.py b/config.py
index 5e4f648..5ca23bb 100644
--- a/config.py
+++ b/config.py
@@ -6,7 +6,6 @@ from docker.errors import NotFound
def autodiscover():
"""Search for the snekbox container and return its IPv4 address."""
-
container_names = ["rmq", "pdrmq", "snekbox_pdrmq_1"]
client = docker.from_env()
diff --git a/rmq.py b/rmq.py
index 919ef19..29fc448 100644
--- a/rmq.py
+++ b/rmq.py
@@ -25,7 +25,6 @@ class Rmq:
def consume(self, queue=QUEUE, callback=None, thread_ws=None, run_once=False):
"""Subscribe to read from a RMQ channel."""
-
while True:
try:
connection = pika.BlockingConnection(self.con_params)
@@ -72,7 +71,6 @@ class Rmq:
def publish(self, message, queue=QUEUE, routingkey=ROUTING_KEY, exchange=EXCHANGE):
"""Open a connection to publish (write) to a RMQ channel."""
-
try:
connection = pika.BlockingConnection(self.con_params)
diff --git a/snekbox.py b/snekbox.py
index f8d7c31..7491672 100644
--- a/snekbox.py
+++ b/snekbox.py
@@ -45,7 +45,6 @@ class Snekbox:
Returns the output of executing the command (stdout) if
successful, or a error message if the execution failed.
"""
-
args = [self.nsjail_binary, '-Mo',
'--rlimit_as', '700',
'--chroot', '/',
@@ -108,7 +107,6 @@ class Snekbox:
to RMQ. Once published, the system exits, since the snekboxes
are created and disposed of per-execution.
"""
-
msg = body.decode('utf-8')
result = ''
snek_msg = json.loads(msg)
@@ -125,7 +123,6 @@ class Snekbox:
def message_handler(self, ch, method, properties, body, thread_ws=None):
"""Spawns a daemon process that handles RMQ messages."""
-
p = multiprocessing.Process(target=self.execute, args=(body,))
p.daemon = True
p.start()
diff --git a/snekweb.py b/snekweb.py
index ff1a72c..3e20fda 100644
--- a/snekweb.py
+++ b/snekweb.py
@@ -22,14 +22,12 @@ log = app.logger
@app.route('/')
def index():
"""Root path returns standard index.html."""
-
return render_template('index.html')
@sockets.route('/ws/<snekboxid>')
def websocket_route(ws, snekboxid):
"""Opens a websocket that spawns and connects to a snekbox daemon."""
-
localdata = threading.local()
localdata.thread_ws = ws