1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-08-01 18:18:31 +00:00

Test internal server

This commit is contained in:
Unrud 2018-09-04 03:33:45 +02:00
parent 49d35cf618
commit 5a433f5476
6 changed files with 176 additions and 34 deletions

View file

@ -29,10 +29,13 @@ import os
EXAMPLES_FOLDER = os.path.join(os.path.dirname(__file__), "static")
def get_file_path(file_name):
return os.path.join(EXAMPLES_FOLDER, file_name)
def get_file_content(file_name):
try:
with open(os.path.join(EXAMPLES_FOLDER, file_name),
encoding="utf-8") as fd:
with open(get_file_path(file_name), encoding="utf-8") as fd:
return fd.read()
except IOError:
print("Couldn't open the file %s" % file_name)