[sugar] path + emulator

Reinier Heeres reinier
Sat Apr 14 18:44:32 EDT 2007


Hi,

As for the moving of files: I transfer them to a server via ssh, and 
then get them from the server in the emulator again. Of course ftp (and 
wget to pull into the emulator) would work as well. I think it might 
also be possible to map a port on your machine into QEmu so that you can 
use the ssh server in the emulator, but I never tried that.

Reinier

Marco Pesenti Gritti wrote:
> On Sat, 2007-04-14 at 17:17 -0400, jjungcla at gsd.harvard.edu wrote:
>   
>> hi guys,
>> two really basic questions we couldn't resolve in class this week:
>> 1. Using Qemu as emulator on a PC, how do you move a file from Windows to
>> the emulated file structure?
>> 2. There is a problem with simply loading an image and displaying it on
>> the screen using this code below (the image.png file sits right next to
>> the application file). The application starts up but shows the
>> file-not-found icon in the middle of the screen. How does sugar actually
>> handle imgages?
>> Thanks guys!
>> Jan
>>
>>
>> class TouchTyperActivity(activity.Activity):
>>
>>     def hello(self, widget, data=None):
>>         logging.info('Image Load Activity')
>>     def __init__(self, handle):
>>         activity.Activity.__init__(self, handle)
>>         ROOT = os.path.dirname(os.path.abspath(__file__))
>>         self.image = gtk.Image()
>>         pixbuf = gtk.gdk.pixbuf_new_from_file(ROOT + "image.png")
>>     
>
> This looks wrong, ROOT will not have a leading / and the resulting path
> will be incorrect.
>
> This should work better:
>
> os.path.join(activity.get_bundle_path(), 'image.png')
>
> Marco
>
> _______________________________________________
> Sugar mailing list
> Sugar at laptop.org
> http://mailman.laptop.org/mailman/listinfo/sugar
>
>
>   



More information about the Sugar-devel mailing list