console/SWSCloudCore/controllers/kb/__init__.py

19 lines
398 B
Python

# coding: utf-8
import os
class ControllerKB:
def __init__(self):
pass
def is_exists(self, document):
if os.path.exists('kb/%s.md' % document):
return True
return False
def get(self, document):
kb_markdown = u''
for ss in file('kb/%s.md' % document, 'r'):
kb_markdown += ss.decode('UTF-8')
return kb_markdown