rpms/snowballz/devel snowballz-json.patch, NONE, 1.1 snowballz.spec, 1.3, 1.4

Orcan Ogetbil oget at rpmfusion.org
Fri Jun 5 22:48:38 CEST 2009


Author: oget

Update of /cvs/free/rpms/snowballz/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv1730

Modified Files:
	snowballz.spec 
Added Files:
	snowballz-json.patch 
Log Message:
* Mon Jun 01 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 1.0-0.8.beta1.20090512hg
- Use simplejson (natively available in python2.6+) instead of cjson
- Add missing Requires: python-imaging


snowballz-json.patch:

--- NEW FILE snowballz-json.patch ---
diff -rupN snowballz.old/lib/map/model.py snowballz/lib/map/model.py
--- snowballz.old/lib/map/model.py	2009-05-12 14:35:02.000000000 -0400
+++ snowballz/lib/map/model.py	2009-05-24 23:23:05.000000000 -0400
@@ -1,11 +1,14 @@
 from __future__ import division
 import sys
 try:
-    import cjson as json
+    import json
 except ImportError:
-    print "Install cjson"
-    print "(easy_install python-cjson)"
-    sys.exit(0)
+    try:
+        import simplejson as json
+    except ImportError:
+        print "Install simplejson"
+        print "(easy_install python-simplejson)"
+        sys.exit(0)
 
 import Image
 import os, rabbyt
@@ -49,7 +52,7 @@ class MapModel(object):
 
         # Load map
         assert p.push("Decode settings")
-        self.config = config = json.decode(open(os.path.join("data", "maps", name,
+        self.config = config = json.loads(open(os.path.join("data", "maps", name,
                 "settings.json")).read())
         self.use_day_night = int(config["map"]["use_day_night"])
         self.day_cycle_time = int(config["map"]["day_cycle_time"])
diff -rupN snowballz.old/map_editor.py snowballz/map_editor.py
--- snowballz.old/map_editor.py	2009-05-12 14:35:02.000000000 -0400
+++ snowballz/map_editor.py	2009-05-24 23:30:28.000000000 -0400
@@ -28,8 +28,15 @@ from lib.map.model import StaticMapObjec
 from lib.map.display import StaticMapObjectView
 from lib.building import BUILDINGS
 
-import cjson as json
-
+try:
+    import json
+except ImportError:
+    try:
+        import simplejson as json
+    except ImportError:
+        print "Install simplejson"
+        print "(easy_install python-simplejson)"
+        sys.exit(0)
 
 def create_resource(map, tile, type, rot=0, id=None):
     t = TYPES[type]
@@ -252,7 +259,7 @@ class DummyCtrl(GameControl):
 
         # Write settings file
         fp = file(os.path.join("data", "maps", map.name, "settings.json"), "w")
-        fp.write(json.encode(map.config))
+        fp.write(json.dumps(map.config))
 
         # Paths
         f = open(os.path.join("data", "maps", map.name, "paths.txt"), "w")


Index: snowballz.spec
===================================================================
RCS file: /cvs/free/rpms/snowballz/devel/snowballz.spec,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- snowballz.spec	12 May 2009 20:44:42 -0000	1.3
+++ snowballz.spec	5 Jun 2009 20:48:38 -0000	1.4
@@ -2,7 +2,7 @@
 
 Name:           snowballz
 Version:        1.0
-Release:        0.7.%{hgver}%{?dist}
+Release:        0.8.%{hgver}%{?dist}
 Summary:        A Fun Real Time Strategy Game Featuring Snowball Fights with Penguins
 Group:          Amusements/Games
 License:        MIT
@@ -21,6 +21,9 @@
 Source99:       %{name}-snapshot.sh
 # Don't create a cache file in %%{_datadir}
 Patch0:         %{name}-dontcache.patch
+# Use simplejson instead of cjson which is not available in F-12+
+# Patch sent upstream via email
+Patch1:         %{name}-json.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildArch:      noarch
@@ -29,7 +32,10 @@
 BuildRequires:  desktop-file-utils
 
 Requires:       pyglet
-Requires:       python-cjson
+%if 0%{?fedora} < 11
+Requires:       python-simplejson
+%endif
+Requires:       python-imaging
 Requires:       python-iniparse
 Requires:       python-rabbyt
 
@@ -49,6 +55,7 @@
 %prep
 %setup -q -n %{name}
 %patch0 -p1 -b .dontcache
+%patch1 -p1 -b .json
 cp %{SOURCE1} setup.py
 
 # Change the hardcoded path with a macro:
@@ -104,6 +111,10 @@
 %{_mandir}/man6/%{name}.*
 
 %changelog
+* Mon Jun 01 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 1.0-0.8.beta1.20090512hg
+- Use simplejson (natively available in python2.6+) instead of cjson
+- Add missing Requires: python-imaging
+
 * Tue May 12 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 1.0-0.7.beta1.20090512hg
 - New snapshot
 



More information about the rpmfusion-commits mailing list