CedArctic / ducky2python

Convert DuckyScript (USB Rubber Ducky) to Python Applications :snake:
https://cedarctic.github.io/ducky2python
GNU Affero General Public License v3.0
120 stars 34 forks source link

Fixed empty line issues #7

Closed ParzivalAFK closed 3 days ago

ParzivalAFK commented 9 months ago

Many code and script files end with an empty line.

When your .js version comes across an empty line either in the script or at the end of a file like this beautiful MonaLisa it throws a pyautogui.hotkey(UNDEFINED_KEY) into the script.

This breaks execution due to the fact the variable UNDEFINED_KEY is not defined and python will not run it.

This pull request is a fix skips over blank lines as intended.

ParzivalAFK commented 9 months ago

This will be my last change for today. I just added basically the same change to the python.

Though the python did handle the empty line at the end of the ducky file if there were any blank whitespace lines it threw pyautogui.hotkey) in instead of just skipping over it.

These tweaks should make your app a little more robust.