diff options
Diffstat (limited to 'presentty/presentty.py')
-rw-r--r-- | presentty/presentty.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/presentty/presentty.py b/presentty/presentty.py index d54d640..0b9cdac 100644 --- a/presentty/presentty.py +++ b/presentty/presentty.py @@ -13,17 +13,20 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +from __future__ import absolute_import, division, print_function + import argparse import os import sys import time +import six import urwid -import slide -import server -import rst -import palette +from . import slide +from . import server +from . import rst +from . import palette class Presenter(object): @@ -152,11 +155,13 @@ def main(): plt = palette.DARK_PALETTE hinter = slide.ScreenHinter() parser = rst.PresentationParser(plt, hinter) - program = parser.parse(unicode(open(args.file).read(), 'utf-8'), args.file) + args_data = open(args.file, 'rb').read() + args_data = six.text_type(args_data, 'utf-8') + program = parser.parse(args_data, args.file) if args.warnings: w = parser.warnings.getvalue() if w: - print w + print(w) sys.exit(1) p = Presenter(plt) p.setProgram(program) |