Use PackageLoader for templates.

This commit is contained in:
tecnovert 2019-07-26 12:36:44 +02:00
parent 1ce87bb58d
commit 900358e7c3
No known key found for this signature in database
GPG key ID: 8ED6D8750C4E3F93
3 changed files with 5 additions and 3 deletions

View file

@ -5,3 +5,4 @@ include *.md
include LICENSE.txt include LICENSE.txt
recursive-include doc * recursive-include doc *
recursive-include basicswap/templates *

View file

@ -13,7 +13,7 @@ import threading
import http.client import http.client
import urllib.parse import urllib.parse
from http.server import BaseHTTPRequestHandler, HTTPServer from http.server import BaseHTTPRequestHandler, HTTPServer
from jinja2 import Environment, FileSystemLoader from jinja2 import Environment, PackageLoader
from . import __version__ from . import __version__
from .util import ( from .util import (
@ -36,8 +36,8 @@ from .basicswap import (
ABS_LOCK_TIME, ABS_LOCK_TIME,
) )
file_loader = FileSystemLoader('basicswap/templates')
env = Environment(loader=file_loader) env = Environment(loader=PackageLoader('basicswap', 'templates'))
def getCoinName(c): def getCoinName(c):

View file

@ -17,6 +17,7 @@ setuptools.setup(
long_description_content_type="text/markdown", long_description_content_type="text/markdown",
url="https://github.com/tecnovert/basicswap", url="https://github.com/tecnovert/basicswap",
packages=setuptools.find_packages(), packages=setuptools.find_packages(),
include_package_data=True,
classifiers=[ classifiers=[
"Programming Language :: Python :: 3", "Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License", "License :: OSI Approved :: MIT License",