Recent Updates to Sugar Almanac

James Simmons jim.simmons at walgreens.com
Mon Jun 16 10:13:42 EDT 2008


Faisal,

What you wrote looks good, but I did see a possible error in it.  You say:

"The following simple write_file() method shows how both metadata and
files are written. Currently, write_file() will throw an error unless
somewhere you actually write an actual file to the file_path that is
passed to write_file. The code below writes a dummy file within the
body of write_file itself (you can do this elsewhere as long as you
have a handle on the file_path variable used by write_file)."

I think this is not always true.  Now if you're creating a new Journal entry for your app and have implemented write_file it *might* be true.  However, if your application is like Read, Read Etexts, or View Slides, which are always resumed from existing Journal entries, there is no need to write a file.  You can still save metadata, even if you don't write a file.

Another thing worth pointing out is that metadata doesn't work very well right now.  If I was in the position where I needed to write a file but didn't have anything that needed to go into it I wouldn't use metadata at all.  Instead I would put any saved options, etc. in the file, because *that* would persist across reboots but metadata currently does not.  I think several activities already do this.

I wrote a wiki page titled "Beyond Hello World" that covers much the same ground as yours, but I like yours better.

Thanks,

James Simmons



Date: Fri, 13 Jun 2008 17:34:43 -0400
From: "Faisal Anwar" <fanwar at mediamods.com>
Subject: Recent Updates to Sugar Almanac
To: devel at lists.laptop.org, sugar at laptop.org
Message-ID:
	<1d23499d0806131434q3602061dj7401bf71a12b0c52 at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hello All,

As many of you know, I'm writing up a sugar almanac to help new sugar/python
developers get up and running with creating useful activities. I will try to
send frequent updates in terms of what has been added. In addition to using
the documentation, I'd appreciate it if people familiar with the different
modules I am writing can send any better or alternative code examples to the
ones that I have written. Review and feedback is ALWAYS appreciated.






More information about the Devel mailing list