nate-parrott / Flashlight

The missing Spotlight plugin system
http://flashlight.nateparrott.com
Other
5.39k stars 411 forks source link

Compile .py to .pyc files during build. #472

Closed cHemingway closed 9 years ago

cHemingway commented 9 years ago

Previously discussed on issue #400, I thought it better to give it a go myself and move the discussion here to avoid cluttering the issue.

This removes the compiled run/invoke_plugin.pyc files from source control, and instead compiles them at build time using pythons compileall module.

This has (imo) the benefit that you can now edit the .py files and have Xcode compile them for you, rather than hand compiling, as well as keeping consistency in not having .pyc files in the source.

I have tested this commit by removing all traces of Flashlight and .pyc files, rebooting, building from source, running Flashlight and testing a few plugins results() and run() methods.

It appears to work fine, but I understand that this is a delicate area, so no worries if you prefer things as they are.