Archive for May, 2007

31

May

Idea: python for MacFUSE

As most of us know, MacFUSE is fairly popular, and has many different filesystems implemented to accompany it. From the website: MacFUSE implements a mechanism that makes it possible to implement a fully functional file system in a user-space program on Mac OS X (10.4 and above). It aims to be API-compliant with the FUSE (File-system in USErspace) mechanism that originated on Linux. Therefore, many existing FUSE file systems become readily usable on Mac OS X. The core of MacFUSE is in a dynamically loadable kernel extension. Read more about FUSE over at Wikipedia.

Idea!

Idea!

The thing about MacFUSE is that it does not have Python bindings, and therefore programmers cannot quikly and easily manipulate and interact with FUSE with python. However, it does have Objective-C bindings, so that means one could easily just code in python using PyObjC. Then, from the PyObjC code, one can just extend it to pure python. This, my friends and readers, what I intend to do. I would like to introduce you to Snakes In a Breaker: Python for FUSE. Snatch up the SVN, but there’s no promise that it will work, or on consistent checkins. Example checkout code:

svn co http://svn.dev.spontaneousdancing.net/snakesinabreaker/trunk SnakesInABreaker

Licensing issues: MacFUSE is under the Apache license, but I can license Snakes In a Breaker as LGPL (v. 2 only, since v3 introduces DRM stuff that may inhibit FUSE development), and so I will. You can link to the code as much as you want, but any core changes to the code must be released.

Python: serious business

Credit: thecia.com.au, Warner Bros. Pictures.

26

May

My Thoughts: Silverlight

Many people have probably heard of the new, Mircrosoft Technology calledSilverlight. It’s a technology to apparently replace Flash and utilize the Flash-like technology into the .Net Framework. As an added bonus, you can use this technology with languages like Python. They also mention that it will supply support for WMA and WMV on Mac OS X. Here are my thoughts on all this who-ha.

It’s an idea, but I’m not exactly sure how this would benefit Windows, and what exactly it’s suppose to do. It’s so unclear its hard to say. I’ve also yet to see WORKING support for Silverlight and WMA and WMV format on any Mac OS X browser. And truthfully, if I wanted ANYTHING to do with the .NET framework, I would use Mono. Mono is an open source multi platform framework for .NET server and client applications. It can be used with many languages, including Python, Java, Boo, Javascript, PHP, and much more. As I see it, MS is a little late on the code aspect of Silverlight, and visually, Flash still kills Silverlight. I don’t know Microsoft, I’ll guess we’ll have to see what happens in the near future.

23

May

NSTask versus subprocess module

    Apple’s NSTask is a class inherited from Foundation. It allows someone to create a new process under the currently running process in order to communicate with a commandline application, for instance. You just have to set up a delegate like so, in pyobjc fashion.


task = NSTask.new()

task = task.launchedTaskWithLaunchPath_arguments_("echo", "\"Hello, world\"")

And you’ll be done.

    Like the subclass module, NSTask allows for you to provide the process with STDIN and get it’s STDOUT, and if necessary, also obtain it’s STDERR. The issue with the subprocess module is that it expects the process to do nothing when invoked; it expects you to provide a command and appropriate flags for that command, which is expected, but the module expects only one form of STDOUT, and that’s after it’s been given STDIN. This is an issue for a sample script that a fink dev gave me to query it’s database. The script in question says this initially when invoked: "Information about 5810 packages read in 4 seconds." NSTask will allow you to gather that STDOUT when you need to, and so will the subprocess module. But a subprocess object handler will halt any STDOUT after that little informative blurb, and STDIN cannot be provided, nor will any further STDOUT be provided as well.

    The solution: I suggest that you use NSTask over subprocess, and get accurate data.

    P.S.: I still haven’t gotten NSTask to work in pyobjc. Here’s what I keep getting:


Traceback (most recent call last):

  File "fink-server.py", line 32, in     task.launchedTaskWithLaunchPath_arguments_("./fink-server.pl", '/sw')

AttributeError: 'NSConcreteTask' object has no attribute 'launchedTaskWithLaunchPath_arguments_'

  The file is in the subversion repo.

22

May

IRC Hangout

I’ve set up an IRC room for FinkCommander. Developers, users, etc., are all there. We also have a bot. You can use this room for Caffeinated Macs and Spontaneous Dancing devel discussion. I’m trying to get some of the fink devs to come into the room, and get their perspective of what FC needs. A couple of them noted that the email function did not have a body in it.
#finkcommander on irc.freenode.net.