[codecs] to read file

This commit is contained in:
mzwiessele 2015-10-12 08:51:10 +01:00
parent 6baf4e7449
commit c6efa62e36
2 changed files with 7 additions and 11 deletions

View file

@ -65,8 +65,8 @@ deploy:
password:
secure: "vMEOlP7DQhFJ7hQAKtKC5hrJXFl5BkUt4nXdosWWiw//Kg8E+PPLg88XPI2gqIosir9wwgtbSBBbbwCxkM6uxRNMpoNR8Ixyv9fmSXp4rLl7bbBY768W7IRXKIBjpuEy2brQjoT+CwDDSzUkckHvuUjJDNRvUv8ab4P/qYO1LG4="
on:
#tags: true
branch: plot_density
server: https://testpypi.python.org/pypi
tags: true
branch: master
#server: https://testpypi.python.org/pypi
distributions: "bdist_wheel sdist bdist_egg"
skip_cleanup: true

View file

@ -42,14 +42,10 @@ import numpy as np
def read(fname):
try:
with open(os.path.join(os.path.dirname(__file__), fname)) as f:
return unicode(f.read(), 'utf-8')
except NameError:
#python 3
with open(os.path.join(os.path.dirname(__file__), fname)) as f:
return f.read()
import codecs
with codecs.open('README.md', 'r', 'utf-8') as f:
print(f.read())
def read_to_rst(fname):
try:
import pypandoc