Skip to content

Sourcery refactored main branch#1

Open
sourcery-ai[bot] wants to merge 1 commit intomainfrom
sourcery/main
Open

Sourcery refactored main branch#1
sourcery-ai[bot] wants to merge 1 commit intomainfrom
sourcery/main

Conversation

@sourcery-ai
Copy link

@sourcery-ai sourcery-ai bot commented Apr 12, 2023

Branch main refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the main branch, then run:

git fetch origin sourcery/main
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from kticoder April 12, 2023 20:26
Comment on lines -21 to +22
fps_text = font.render(str(CAM_FPS_LIST[cam_fps_id]) + "fps", True, green, black)
fps_text = font.render(f"{str(CAM_FPS_LIST[cam_fps_id])}fps", True,
green, black)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function updateFpsText refactored with the following changes:

Comment on lines -74 to +96
else:
if (time.time() - funcButtonDownStartTime) >= POWER_DOWN_BUTTON_DUR:
os.system("sudo shutdown now -h")
else:
if funcButtonDownStartTime != 0:
#disable connections
splitter.connection.disable()
render_l.connection.disable()
render_r.connection.disable()
#change fps
cam_fps_id += 1
if cam_fps_id >= len(CAM_FPS_LIST):
cam_fps_id = 0
print(CAM_FPS_LIST[cam_fps_id])
updateFpsText()
camera.outputs[0].framerate = CAM_FPS_LIST[cam_fps_id]
camera.outputs[0].commit()
#enable connections
splitter.connection.enable()
render_l.connection.enable()
render_r.connection.enable()
###
print("Func button pressed")
funcButtonDownStartTime = 0
elif (time.time() - funcButtonDownStartTime) >= POWER_DOWN_BUTTON_DUR:
os.system("sudo shutdown now -h")
elif funcButtonDownStartTime != 0:
#disable connections
splitter.connection.disable()
render_l.connection.disable()
render_r.connection.disable()
#change fps
cam_fps_id += 1
if cam_fps_id >= len(CAM_FPS_LIST):
cam_fps_id = 0
print(CAM_FPS_LIST[cam_fps_id])
updateFpsText()
camera.outputs[0].framerate = CAM_FPS_LIST[cam_fps_id]
camera.outputs[0].commit()
#enable connections
splitter.connection.enable()
render_l.connection.enable()
render_r.connection.enable()
###
print("Func button pressed")
funcButtonDownStartTime = 0
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 74-97 refactored with the following changes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants