How to create a new MIME type for a Sugar activity?

James Simmons jim.simmons at walgreens.com
Thu Feb 7 14:05:35 EST 2008


Tomeu,

I tried using the mimetypes.xml file in the activity directory with the 
Sugar Emulator in Xubuntu.  It ignored it.  I then tried packaging up 
the .xo file with setup.py dist and loading it on
my XO.  That didn't work either.  Today I opened the .xo file with 7-zip 
and found that setup.py did not put mimetypes.xml in the activity 
directory into the .xo file.  The activity.info file went in and so did 
my .svg icon.  I didn't have to make a MANIFEST entry to get either of 
those in there.  Do I need to do something special to get the 
mimetypes.xml file put in?

It is possible that the Sugar Emulator is out of date.  It is a very 
congenial development environment compared to the alternatives, so I'd 
like to stick with it if possible.

In a related note, I was able to get my activity working by setting the 
MIME to application/zip and being careful not to launch Etoys by 
mistake.  However, it doesn't work for larger files (35 megs or so).  It 
seems like that is a problem with the Journal application, not my app, 
because I cannot copy this file from a USB drive to the Journal either.  
In both cases log viewer shows nearly identical stack traces saying that 
the file name is undefined.  I had a similar problem trying to open a 38 
meg PDF in the Read activity.  The Read activity would start up but 
never finish.  I have posted a message on this bug to help at laptop.org.  
Smaller files open just fine, big ones don't.  That makes my ViewSlides 
activity kind of dubious.

James Simmons

>Ok, so what if your activity registers into the mime registry a new type
>like application/x-slide-activity associated to the *.slide glob? That
>can be done in the mimetypes.xml file. And then your activity should add
>this mime to the activity.info.
>
>In this way, the journal will recognize these files as that type, and
>will open them with you activity.
>  
>




More information about the Devel mailing list