Skip to content

Commit

Permalink
Fix unused variables: flake8 --select=F841 (#623)
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss authored Oct 7, 2021
1 parent c75698e commit 06b4ca2
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ def fragment(self, message, fragment_size, mid=None):
if message_length <= fragment_size:
return [message]

msg_id = message.get("id", None)

expected_duration = int(
math.ceil(math.ceil(message_length / float(fragment_size)))
* self.protocol.delay_between_messages
Expand Down
2 changes: 1 addition & 1 deletion rosbridge_library/test/capabilities/test_call_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def cb(msg, cid=None):

def test_call_service_fail(self):
# Dummy service that instantly fails
service_server = rospy.Service("set_bool_fail", SetBool, lambda req: None)
_ = rospy.Service("set_bool_fail", SetBool, lambda req: None)

proto = Protocol("test_call_service_fail")
s = CallService(proto)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

def calculate_service_response(request):
request_object = json.loads(request) # parse string for service request
args = request_object["args"] # get parameter field (args)
# args = request_object["args"] # get parameter field (args) # unused variable
# count = int(args["count"] ) # get parameter(s) as described in corresponding ROS srv-file
#
# message = "" # calculate service response
Expand Down
2 changes: 1 addition & 1 deletion rosbridge_server/scripts/rosbridge_websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def __init__(self):
if "--unregister_timeout" in sys.argv:
idx = sys.argv.index("--unregister_timeout") + 1
if idx < len(sys.argv):
unregister_timeout = float(sys.argv[idx])
RosbridgeWebSocket.unregister_timeout = float(sys.argv[idx])
else:
print("--unregister_timeout argument provided without a value.")
sys.exit(-1)
Expand Down
2 changes: 0 additions & 2 deletions rosbridge_server/src/rosbridge_server/udp_handler.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import rospy
from rosbridge_library.rosbridge_protocol import RosbridgeProtocol
from rosbridge_library.util import bson
from twisted.internet.protocol import DatagramProtocol


Expand Down Expand Up @@ -70,7 +69,6 @@ def stopProtocol(self):
rospy.loginfo("Client disconnected. %d clients total.", cls.clients_connected)

def send_message(self, message):
binary = isinstance(message, bson.BSON)
self.write(message)

def check_origin(self, origin):
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ignore-words-list = miror
count = True
max-complexity = 36
max-line-length = 217
ignore = E203,F841,W503
ignore = E203,W503
show-source = True
statistics = True

Expand Down

0 comments on commit 06b4ca2

Please sign in to comment.