Re: [Sugar-devel] [PATCH sugar-datastore] Use json as included in Python SL #3142

2012-08-08 Thread Simon Schampijer

On 08/08/2012 03:48 PM, Manuel Quiñones wrote:

This one is OK too.  Please push.

2012/8/8 Simon Schampijer :

We use json as included in Python. This will make Sugar dependent on
Python 2.6 and Python 2.7 to have the highest JSON performance.

Remove as well the requirement in sweets.recipe

Signed-off-by: Simon Schampijer 


Acked-by: Manuel Quiñones 


Thanks Aleksey did review as well, pushed as:

http://git.sugarlabs.org/sugar-datastore/mainline/commit/998fc519cc9b7a054b6c0067a6c8333d7f77012c

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


Re: [Sugar-devel] [PATCH sugar-datastore] Use json as included in Python SL #3142

2012-08-08 Thread Manuel Quiñones
This one is OK too.  Please push.

2012/8/8 Simon Schampijer :
> We use json as included in Python. This will make Sugar dependent on
> Python 2.6 and Python 2.7 to have the highest JSON performance.
>
> Remove as well the requirement in sweets.recipe
>
> Signed-off-by: Simon Schampijer 

Acked-by: Manuel Quiñones 

> ---
>  src/carquinyol/migration.py | 5 ++---
>  sweets.recipe   | 2 +-
>  2 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/src/carquinyol/migration.py b/src/carquinyol/migration.py
> index 1745f2c..699552f 100644
> --- a/src/carquinyol/migration.py
> +++ b/src/carquinyol/migration.py
> @@ -21,8 +21,7 @@ import os
>  import logging
>  import shutil
>  import time
> -
> -import cjson
> +import json
>
>  from carquinyol import layoutmanager
>
> @@ -65,7 +64,7 @@ def migrate_from_0():
>  def _migrate_metadata(root_path, old_root_path, uid):
>  metadata_path = layoutmanager.get_instance().get_metadata_path(uid)
>  old_metadata_path = os.path.join(old_root_path, uid + '.metadata')
> -metadata = cjson.decode(open(old_metadata_path, 'r').read())
> +metadata = json.loads(open(old_metadata_path, 'r').read())
>
>  if 'uid' not in metadata:
>  metadata['uid'] = uid
> diff --git a/sweets.recipe b/sweets.recipe
> index b861c35..5b76e87 100644
> --- a/sweets.recipe
> +++ b/sweets.recipe
> @@ -11,7 +11,7 @@ exec  = %(BUILDDIR)s/bin/datastore-service
>  binding   = PATH %(BUILDDIR)s/bin
>  PYTHONPATH %(BUILDDIR)s/src
>  XDG_DATA_DIRS share
> -requires  = sugar-toolkit; python-cjson; xapian-bindings-python
> +requires  = sugar-toolkit; xapian-bindings-python
>
>  [Archive]
>  arch  = any
> --
> 1.7.11.2
>
> ___
> Sugar-devel mailing list
> Sugar-devel@lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel



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


[Sugar-devel] [PATCH sugar-datastore] Use json as included in Python SL #3142

2012-08-08 Thread Simon Schampijer
We use json as included in Python. This will make Sugar dependent on
Python 2.6 and Python 2.7 to have the highest JSON performance.

Remove as well the requirement in sweets.recipe

Signed-off-by: Simon Schampijer 
---
 src/carquinyol/migration.py | 5 ++---
 sweets.recipe   | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/carquinyol/migration.py b/src/carquinyol/migration.py
index 1745f2c..699552f 100644
--- a/src/carquinyol/migration.py
+++ b/src/carquinyol/migration.py
@@ -21,8 +21,7 @@ import os
 import logging
 import shutil
 import time
-
-import cjson
+import json
 
 from carquinyol import layoutmanager
 
@@ -65,7 +64,7 @@ def migrate_from_0():
 def _migrate_metadata(root_path, old_root_path, uid):
 metadata_path = layoutmanager.get_instance().get_metadata_path(uid)
 old_metadata_path = os.path.join(old_root_path, uid + '.metadata')
-metadata = cjson.decode(open(old_metadata_path, 'r').read())
+metadata = json.loads(open(old_metadata_path, 'r').read())
 
 if 'uid' not in metadata:
 metadata['uid'] = uid
diff --git a/sweets.recipe b/sweets.recipe
index b861c35..5b76e87 100644
--- a/sweets.recipe
+++ b/sweets.recipe
@@ -11,7 +11,7 @@ exec  = %(BUILDDIR)s/bin/datastore-service
 binding   = PATH %(BUILDDIR)s/bin
 PYTHONPATH %(BUILDDIR)s/src
 XDG_DATA_DIRS share
-requires  = sugar-toolkit; python-cjson; xapian-bindings-python
+requires  = sugar-toolkit; xapian-bindings-python
 
 [Archive]
 arch  = any
-- 
1.7.11.2

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