It also gave me a chance to put something up on Google code. I had worked with SourceForge way back in the day, and being a rather Google-centric guy of late, Google code seemed like the place to go.
You'd think there would already be a module like this about, but in my searching the best thing I could find was the code for the iremoted 'daemon'. Converting it to a Python extension was relatively straightforward. The only part that caused pain was determining how to get distutils to link in the IOKit and Carbon frameworks. I found a blog post by somebody who'd already dealt with that pain, so that was the end of that.
Anyhow the setup.py file is super simple, and (once you know the quirks) way preferable to mucking about with a makefile.
from distutils.core import setup, ExtensionNeedless to say, this won't build on Windows (or Linux either, or Plan 9, or Solaris, or whatever).
setup(name='ircontroller',
version='1.0',
ext_modules=[Extension('ircontroller', ['ircontroller.c'],
extra_link_args=['-framework', 'IOKit', '-framework','Carbon'])])
Here ya go.
No comments:
Post a Comment