Re: [Server-devel] xs-activation and OS update info

2009-10-29 Thread Daniel Drake
2009/10/30 Martin Langhoff :
> It is about avoiding maintaining a bespoke lib. If you say it is a
> variant on a python standard lib, do you think we can subclass it? Or
> is there a reason not to?

Yeah it can probably be subclassed.

>> It is needed up until Python 3.0, unless you know of a python ordered
>
> I saw a commend mentioning that something wouldn't be needed w 2.6. On
> F11 we have 2.6... but maybe I misunderstood.

Ah yes, I forgot the specifics. odict is needed until Python 3.0, but
Python 2.6 adds the dict_type constructor parameter for ConfigParser
so MyConfigParser is not needed with python 2.6.

Daniel
___
Server-devel mailing list
Server-devel@lists.laptop.org
http://lists.laptop.org/listinfo/server-devel


Re: [Server-devel] Backup and Recovery

2009-10-29 Thread Hamilton Chua
Martin,

After turning on verbose debugging in the logs and tailing them during
an attempted restore.

I noticed a series of errors that ended with

AttributeError: "JournalEntryBundle" object has no attribute
'get_bundle_id'

I don't believe it's browse as it seems to be doing the right thing. I
tried uninstalling the rpm and installing from activities.sugarlabs.org
and got the same results.

It occurs when the file has been placed in the journal. The journal
checks if it's an activity or content bundle.

When checking the metadata for the journal entry created for the backup
file, I noticed that the activity and activity_id files are empty and
the mime_type says it is "application/vnd.olpc-journal-entry". Does this
sound right ?


Thanks,

Hamilton







On Tue, 2009-10-27 at 17:27 +0100, Martin Langhoff wrote:
> On Tue, Oct 27, 2009 at 5:05 PM, Hamilton Chua  
> wrote:
> > The metadata for the journal is application/vnd.olpc-journal-entry as
> > per its metadata. I'll do a packet capture as you suggested and I'll
> > check the apache server logs too for clues.
> 
> Then you can probably skip the packet capture. The problem is
> somewhere between Browse.xo and the Journal.
> 
> The Journal should never store a file that gets downloaded by Browse
> with "application/vnd.olpc-journal-entry"; instead it should unpack it
> and "import" it, reading its metadata.
> 
> cheers,
> 
> 
> m

___
Server-devel mailing list
Server-devel@lists.laptop.org
http://lists.laptop.org/listinfo/server-devel


Re: [Server-devel] xs-activation and OS update info

2009-10-29 Thread Martin Langhoff
On Thu, Oct 29, 2009 at 5:09 PM, Daniel Drake  wrote:
> I don't understand this question. My patch only adds it for
> xs-activation purposes.

It is about avoiding maintaining a bespoke lib. If you say it is a
variant on a python standard lib, do you think we can subclass it? Or
is there a reason not to?

> It is needed up until Python 3.0, unless you know of a python ordered

I saw a commend mentioning that something wouldn't be needed w 2.6. On
F11 we have 2.6... but maybe I misunderstood.

> Alternative implementations/suggestions welcome :)

hmmm. I'll see...



m
-- 
 martin.langh...@gmail.com
 mar...@laptop.org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff
___
Server-devel mailing list
Server-devel@lists.laptop.org
http://lists.laptop.org/listinfo/server-devel


Re: [Server-devel] xs-activation and OS update info

2009-10-29 Thread Daniel Drake
2009/10/27 Martin Langhoff :
> Right... makes sense. I am a bit intrigued with the custom config file
> parser / writer (that is 3x the sloc of the whole xs-activation ;-) ).

It's not really a custom config file parser. It's a trivial change to
Python's own ConfigParser class. The only change is in the constructor
IIRC, which now lets you use a custom dictionary type.

> I am guessing the key motivator is that YAML, JSON and other config
> formats won't preserve ordering correctly, right?

I didn't feel that JSON is appropriate for a config file, especially
so in oatslite (which allows more per-OS configuration). I don't know
anything about YAML.

>  - is MyConfigParser used anywhere else?

I don't understand this question. My patch only adds it for
xs-activation purposes.

>  - odict is only needed on F9, correct?

It is needed up until Python 3.0, unless you know of a python ordered
dictionary class which is shipped with your distro-of-choice. (I don't
know of any, meaning that it will still be needed even with F12)

It's a bit ugly with these 2 classes but at least their importance is
trivial to explain and they can sit independently, and we have a path
for getting rid of them (Python 3.0).

> What is needed in terms of config parsing is pretty simple -- I
> suspect there are a couple of simple ways we could avoid depending on
> the ordering of the config file, with less code.

Alternative implementations/suggestions welcome :)
In my opinion the ordering is the main purpose of having to use a
config file here.

Daniel
___
Server-devel mailing list
Server-devel@lists.laptop.org
http://lists.laptop.org/listinfo/server-devel