Skip to content

Commit

Permalink
flynt
Browse files Browse the repository at this point in the history
  • Loading branch information
prusnak committed Oct 7, 2024
1 parent 7316fdf commit 6947166
Show file tree
Hide file tree
Showing 77 changed files with 710 additions and 760 deletions.
4 changes: 2 additions & 2 deletions docs/example_plugins/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ def stop(self):
super().stop()

def handle_command(self, arguments, lxm):
response_content = "Hello "+RNS.prettyhexrep(lxm.source_hash)+". "
response_content = f"Hello {RNS.prettyhexrep(lxm.source_hash)}. "
response_content += "This is a response from the basic command example. It doesn't do much, but here is a list of the arguments you included:\n"

for argument in arguments:
response_content += "\n"+str(argument)
response_content += f"\n{argument)}"

# Let the Sideband core send a reply.
self.get_sideband().send_message(
Expand Down
2 changes: 1 addition & 1 deletion docs/example_plugins/comic.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def handle_command(self, arguments, lxm):
except Exception as e:
# Send an error message
self.get_sideband().send_message(
"An error occurred while trying to fetch the specified comic:\n\n"+str(e),
f"An error occurred while trying to fetch the specified comic:\n\n{e)}",
lxm.source_hash,
False, # Don't use propagation by default, try direct first
skip_fields = True, # Don't include any additional fields automatically
Expand Down
4 changes: 2 additions & 2 deletions docs/example_plugins/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ class BasicServicePlugin(SidebandServicePlugin):
def service_jobs(self):
while self.should_run:
time.sleep(5)
RNS.log("Service ping from "+str(self))
RNS.log(f"Service ping from {self)}")

RNS.log("Jobs stopped running for "+str(self))
RNS.log(f"Jobs stopped running for {self)}")

def start(self):
# Do any initialisation work here
Expand Down
10 changes: 5 additions & 5 deletions docs/example_plugins/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def read_frames(self):
self.frame_queue.put(frame)

except Exception as e:
RNS.log("An error occurred while reading frames from the camera: "+str(e), RNS.LOG_ERROR)
RNS.log(f"An error occurred while reading frames from the camera: {e)}", RNS.LOG_ERROR)

self.release_camera()

Expand Down Expand Up @@ -195,10 +195,10 @@ def read_frames(self):

self.frame_queue.put(frame)

RNS.log(str(self)+" idled", RNS.LOG_DEBUG)
RNS.log(f"{self)} idled", RNS.LOG_DEBUG)

except Exception as e:
RNS.log("An error occurred while reading frames from the stream: "+str(e), RNS.LOG_ERROR)
RNS.log(f"An error occurred while reading frames from the stream: {e)}", RNS.LOG_ERROR)

self.release_stream()

Expand Down Expand Up @@ -236,7 +236,7 @@ def update(self):
self.source_data = image_file.read()

except Exception as e:
RNS.log("Could not read image at \"{self.path}\": "+str(e), RNS.LOG_ERROR)
RNS.log(f"Could not read image at \"{{self.path}}\": {e)}", RNS.LOG_ERROR)
self.source_data = None

class ViewCommandPlugin(SidebandCommandPlugin):
Expand Down Expand Up @@ -292,7 +292,7 @@ def handle_command(self, arguments, lxm):
else:
response = "Available Sources:\n"
for source in self.sources:
response += "\n - "+str(source)
response += f"\n - {source)}"

self.message_response(response, requestor)
return
Expand Down
2 changes: 1 addition & 1 deletion docs/utilities/rns_audio_call_calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def simulate(link_speed=9600, audio_slot_ms=70, codec_rate=1200, method="msgpack
print(f" On-air length : {PACKET_LEN} bytes")
print(f" Packet airtime : {PACKET_AIRTIME}ms")

print( "\n===== Results for "+RNS.prettyspeed(LINK_SPEED)+" Link Speed ===\n")
print( f"\n===== Results for {RNS.prettyspeed(LINK_SPEED)} Link Speed ===\n")
print(f" Final latency : {TOTAL_LATENCY}ms")
print(f" Recording latency : contributes {TARGET_MS}ms")
print(f" Packet transport : contributes {PACKET_LATENCY}ms")
Expand Down
4 changes: 2 additions & 2 deletions recipes/codec2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ class Codec2Recipe(Recipe):
def include_flags(self, arch):
'''Returns a string with the include folders'''
codec2_includes = join(self.get_build_dir(arch.arch), 'build_android')
return (' -I' + codec2_includes)
return (f" -I{codec2_includes}")

def link_dirs_flags(self, arch):
'''Returns a string with the appropriate `-L<lib directory>` to link
with the libs. This string is usually added to the environment
variable `LDFLAGS`'''
return ' -L' + self.get_build_dir(arch.arch)
return f" -L{self.get_build_dir(arch.arch)}"

# def link_libs_flags(self):
# '''Returns a string with the appropriate `-l<lib>` flags to link with
Expand Down
Loading

0 comments on commit 6947166

Please sign in to comment.