Re: [Sugar-devel] [PATCH sugar] Removed hardcoded server url (SL #1976)

2010-10-14 Thread Dipankar Patro
Glad I could clarify my modifications. :)
I will send the corrected e-mail as soon as possible.


On Thu, Oct 14, 2010 at 4:29 AM, James Cameron qu...@laptop.org wrote:

 On Wed, Oct 13, 2010 at 04:31:00PM +0530, Dipankar Patro wrote:
  Thanks for reviewing it, James.

 Sorry, it was late, and I misunderstood the code you had written ... I
 withdraw my comment You are effectively repeating the previous if
 statement but using the output ... seems a bit obscure.



Apart from the lack of text wrap in the commit message, I've no issues
 with the patch.

 Reviewed-by: James Cameron qu...@laptop.org

 --
 James Cameron
 http://quozl.linux.org.au/

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar] Removed hardcoded server url (SL #1976)

2010-10-13 Thread James Cameron
On Wed, Oct 13, 2010 at 03:53:22PM +0530, Dipankar Patro wrote:
 Previously registration url was set hardcoded for XO device.
 Modififed the code for same behavior on all devices. Register url is taken 
 from gconf prop.
 If the gconf is empty or unset, registration url falls back to 'schoolserver'.

Please text wrap your commit message.

 --- a/src/jarabe/desktop/schoolserver.py
 +++ b/src/jarabe/desktop/schoolserver.py
 @@ -89,9 +89,12 @@ def register_laptop(url=REGISTER_URL):

if have_ofw_tree():
sn = read_ofw('mfg-data/SN')
uuid_ = read_ofw('mfg-data/U#')
sn = sn or 'SHF'
uuid_ = uuid_ or '----'

  else:
  sn = generate_serial_number()
  uuid_ = str(uuid.uuid1())
 -setting_name = '/desktop/sugar/collaboration/jabber_server'
 -jabber_server = client.get_string(setting_name)
 -store_identifiers(sn, uuid_, jabber_server)
 +
 +setting_name = '/desktop/sugar/collaboration/jabber_server'
 +jabber_server = client.get_string(setting_name)
 +store_identifiers(sn, uuid_, jabber_server)
 +
 +if jabber_server:
  url = 'http://' + jabber_server + ':8080/'

You are effectively repeating the previous if statement but using the
output ... seems a bit obscure.

-- 
James Cameron
http://quozl.linux.org.au/
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar] Removed hardcoded server url (SL #1976)

2010-10-13 Thread Dipankar Patro
Thanks for reviewing it, James.

   if have_ofw_tree():
sn = read_ofw('mfg-data/SN')
uuid_ = read_ofw('mfg-data/U#')
sn = sn or 'SHF'
uuid_ = uuid_ or '----'

   else:
   sn = generate_serial_number()
   uuid_ = str(uuid.uuid1())
  -setting_name = '/desktop/sugar/collaboration/jabber_server'
  -jabber_server = client.get_string(setting_name)
  -store_identifiers(sn, uuid_, jabber_server)
  +
  +setting_name = '/desktop/sugar/collaboration/jabber_server'
  +jabber_server = client.get_string(setting_name)
  +store_identifiers(sn, uuid_, jabber_server)
  +
  +if jabber_server:
   url = 'http://' + jabber_server + ':8080/'

 You are effectively repeating the previous if statement but using the
 output ... seems a bit obscure.


 ^^ Before applying this : The url (url for registration) was set from gconf
only for non-XO devices.
I moved that outside the first if..else you have quoted, so that on all
devices the url is taken from the gconf property
(/desktop/sugar/collaboration/jabber_server)

the second 'if jabber_server:' is put there to check whether the
jabber_server retrieved from the gcnof property is empty or unset. If
jabber_server is a valid one, then change url, other wise keep the url =
initialized one.

I actually went with the above modification due to the chain of mails here :
http://lists.sugarlabs.org/archive/sugar-devel/2010-July/025265.html

Regards,
Dipankar
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar] Removed hardcoded server url (SL #1976)

2010-10-13 Thread James Cameron
On Wed, Oct 13, 2010 at 04:31:00PM +0530, Dipankar Patro wrote:
 Thanks for reviewing it, James.

Sorry, it was late, and I misunderstood the code you had written ... I
withdraw my comment You are effectively repeating the previous if
statement but using the output ... seems a bit obscure.

Apart from the lack of text wrap in the commit message, I've no issues
with the patch.

Reviewed-by: James Cameron qu...@laptop.org

-- 
James Cameron
http://quozl.linux.org.au/
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel