Hi I had a problem when use pygal with cx_freeze. I noticed in svg.py or utils.py, there are many codes related to access resource files like css or worldmap.svg like:
the problem is when cx_freeze freeze the whole app, all dependencies will be packed into a single library.zip. os.path.join(os.path.dirname(file)) will give sth like xxx/library.zip/pygal/css/base.css which is an invalid path (library.zip is not a directory).
My work around is to use os.getcwd() instead and copy resource files.
Is it possible to provide a method to configure the path in Config class or sth like that? Thanks.
BTW: I just realized I could use zipfile.ZipFile to read files in a zip file and it worked; however We still need to modify the code quite a bit.
Hi I had a problem when use pygal with cx_freeze. I noticed in svg.py or utils.py, there are many codes related to access resource files like css or worldmap.svg like:
css = os.path.join(os.path.dirname(file), 'css', css)
the problem is when cx_freeze freeze the whole app, all dependencies will be packed into a single library.zip. os.path.join(os.path.dirname(file)) will give sth like xxx/library.zip/pygal/css/base.css which is an invalid path (library.zip is not a directory). My work around is to use os.getcwd() instead and copy resource files.
Is it possible to provide a method to configure the path in Config class or sth like that? Thanks.
BTW: I just realized I could use zipfile.ZipFile to read files in a zip file and it worked; however We still need to modify the code quite a bit.