Please find the diff below, which got sync for freeciv-img-extract to work
for me.
This looks pretty weird, but does work., Let me know you think.


Otherwise, PNG Crush fails not finding : pre-freeciv-web-tileset-1.png

Could not find file: pre-freeciv-web-tileset-1.png
Could not find file: freeciv-web-tileset-1.png
   CPU time decoding 0.000, encoding 0.000, other 0.000, total 0.000 seconds

cp: freeciv-web-tileset-1.png: No such file or directory


Can you suggest on what should be done about the missing png file ?


-Chaitanya






diff --git i/freeciv-img-extract/img-extract.py
w/freeciv-img-extract/img-extract.py
index 9a7b9c9..bba0d75 100755
--- i/freeciv-img-extract/img-extract.py
+++ w/freeciv-img-extract/img-extract.py
@@ -14,6 +14,7 @@
 '''

 import os, sys
+import io

 import ConfigParser
 import Image
@@ -112,7 +113,11 @@ def increment_tileset_image():
 for file in files:
   config = ConfigParser.ConfigParser()
   print("Parsing " + file );
-  config.read(file);
+  data = open(file, "r").readlines()
+  data = ("".join(data)).replace("\n", "")
+  data = io.BytesIO(data)
+
+  config.readfp(data)
   print(config.sections());

   if "extra" in config.sections():





On Mon, May 20, 2013 at 6:06 PM, Chaitanya Sharma <gopi.dai...@gmail.com>wrote:

> Thank You!
>
> I just did that, but I think I also have some file encoding issues.,
> for example a simple attempt to read the config file throws a lot of
> errors.
>
> >>> config.read("../freeciv/freeciv/data/misc/colors.tilespec")
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>    File
> "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ConfigParser.py",
> line 305, in read
>     self._read(fp, filename)
>   File
> "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ConfigParser.py",
> line 546, in _read
>     raise e
> ConfigParser.ParsingError: File contains parsing errors:
> ../freeciv/freeciv/data/misc/colors.tilespec
> [line  6]: '}\n'
>  [line 10]: '}\n'
> [line 13]: '}\n'
> [line 16]: '}\n'
>  [line 19]: '}\n'
> [line 22]: '}\n'
> [line 25]: '}\n'
>  [line 28]: '}\n'
> [line 31]: '}\n'
> [line 34]: '}\n'
>  [line 37]: '}\n'
> [line 40]: '}\n'
> [line 45]: '}\n'
>
>
> -Chaitanya
>
>
>
> On Mon, May 20, 2013 at 5:21 PM, Andreas Røsdal <andre...@pvv.ntnu.no>wrote:
>
>> On Mon, 20 May 2013, Chaitanya Sharma wrote:
>>
>>> Hi,
>>> I've been trying to build / setup a local development environment for
>>> freeciv, but am running into a lot of issues during
>>> the process.
>>>
>>> I'm following the README,  and while running sync for freeciv image
>>> extract, this is the below error I get.
>>>
>>> Any suggestions to fix this would be greatly appreciated. Thanks!
>>>
>>
>> Hi Chaitanya!
>>
>> Take a look at this README:
>> https://github.com/**andreasrosdal/freeciv-web/<https://github.com/andreasrosdal/freeciv-web/>
>>
>> I think you have to run these scripts to get it working:
>>
>> /freeciv-img-extract/setup_**links.sh
>> /freeciv/apply_patches.sh
>>
>> Feel free to ask me any more questions if you are stuck.
>>
>>
>> Regards,
>> Andreas
>
>
>
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to