Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #142

Closed
wants to merge 17 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions glue.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import StringIO
import hashlib
import subprocess
import traceback
import codecs
import ConfigParser
from optparse import OptionParser, OptionGroup

Expand Down Expand Up @@ -867,7 +869,8 @@ def save_css(self):
# Process the sprite if necessary.
self.process()

css_file = open(css_filename, 'w')
# write css in UTF8-encoded file
css_file = codecs.open(css_filename, 'w', 'utf-8-sig')

# Write the hash line to the file.
css_file.write(hash_line)
Expand All @@ -882,7 +885,7 @@ def save_css(self):
class_names = ',\n'.join(class_names)

# add the global style for all the sprites for less bloat
template = self.config.global_template.decode('unicode-escape')
template = self.config.global_template.decode(sys.getfilesystemencoding())
css_file.write(template % {'all_classes': class_names,
'sprite_url': self.image_url()})

Expand Down Expand Up @@ -1556,6 +1559,7 @@ def main():
except Exception:
if config.debug:
import platform
sys.stderr.write("Exception:\n%s\n" % traceback.format_exc())
sys.stderr.write("Glue version: %s\n" % __version__)
sys.stderr.write("PIL version: %s\n" % PImage.VERSION)
sys.stderr.write("Platform: %s\n" % platform.platform())
Expand Down