commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 02/13: grc: made flow graph python files th


From: git
Subject: [Commit-gnuradio] [gnuradio] 02/13: grc: made flow graph python files the UTF-8 they always should have been
Date: Sat, 17 Oct 2015 17:26:53 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch master
in repository gnuradio.

commit 820bd052810f5fe821f2ceaf70f1cd45451127ed
Author: Marcus Müller <address@hidden>
Date:   Wed Oct 14 19:56:36 2015 +0200

    grc: made flow graph python files the UTF-8 they always should have been
---
 grc/python/Generator.py    | 3 ++-
 grc/python/flow_graph.tmpl | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/grc/python/Generator.py b/grc/python/Generator.py
index d48be2f..d60befe 100644
--- a/grc/python/Generator.py
+++ b/grc/python/Generator.py
@@ -22,6 +22,7 @@ import sys
 import subprocess
 import tempfile
 import shlex
+import codecs
 from distutils.spawn import find_executable
 from Cheetah.Template import Template
 
@@ -107,7 +108,7 @@ class TopBlockGenerator(object):
                                       "This is usually undesired. Consider "
                                       "removing the throttle block.")
         # generate
-        with open(self.get_file_path(), 'w') as fp:
+        with codecs.open(self.get_file_path(), 'w', encoding = 'utf-8') as fp:
             fp.write(self._build_python_code_from_template())
         try:
             os.chmod(self.get_file_path(), self._mode)
diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl
index 35d9239..9939006 100644
--- a/grc/python/flow_graph.tmpl
+++ b/grc/python/flow_graph.tmpl
@@ -1,6 +1,7 @@
 #if not $generate_options.startswith('hb')
 #!/usr/bin/env python2
 #end if
+# -*- coding: utf-8 -*-
 ########################################################
 ##Cheetah template - gnuradio_python
 ##



reply via email to

[Prev in Thread] Current Thread [Next in Thread]