[Sugar-devel] [PATCH] webactivity: seed the XS cookie at startup

Simon Schampijer simon at schampijer.de
Fri Feb 13 15:11:17 EST 2009


Martin Langhoff wrote:
> On Fri, Feb 13, 2009 at 12:19 AM, Simon Schampijer <simon at schampijer.de> wrote:
>> When thinking about it a bit more - the big plus with your approach that
>> it's only affects Browse - code wise, which is when back porting to 0.82 a
>> big plus, actually maybe the only way.
> 
> Bingo! I think you're starting to read my mind...
> 
> 
> 
> m

Please find attached the patch against master.

- i use the backup_url to see if we are associated with a schoolserver

- why did you use the jabber server for this 'xs_fqdn = prof.jabber_server'?

- c.execute('''CREATE TABLE IF NOT EXISTS 

+                         moz_cookies 

+                         (id INTEGER PRIMARY KEY, 

+                          name TEXT, 

+                          value TEXT, 

+                          host TEXT, 

+                          path TEXT, 

+                          expiry INTEGER, 

+                          lastAccessed INTEGER, 

+                          isSecure INTEGER, 

+                          isHttpOnly INTEGER);''')

- is the ';' correct here or a typo?

- i only except for sqlite3.Error

- what bothers me a bit is that you don't get an error when the database 
does not exist - sqlite creates a new one actually - so we might return 
as well on 'if not os.path.exists(os.path.join(_profile_path,
'cookies.sqlite'))'

- the method could even be a function as it does not interact at all 
with the class itself, not sure what is nicer

Best,
    Simon

-------------- next part --------------
A non-text attachment was scrubbed...
Name: cookie.patch
Type: text/x-diff
Size: 2969 bytes
Desc: not available
Url : http://lists.sugarlabs.org/archive/sugar-devel/attachments/20090213/183b7f4e/attachment.patch 


More information about the Sugar-devel mailing list