2019-07-18 17:40:48 +00:00
|
|
|
import os
|
|
|
|
def read_static(file, ret_bin=False):
|
2019-07-20 00:01:16 +00:00
|
|
|
static_file = os.path.dirname(os.path.realpath(__file__)) + '/../static-data/' + file
|
2019-07-18 17:40:48 +00:00
|
|
|
|
|
|
|
if ret_bin:
|
|
|
|
mode = 'rb'
|
|
|
|
else:
|
|
|
|
mode = 'r'
|
|
|
|
with open(static_file, mode) as f:
|
|
|
|
return f.read()
|