def enumerate_themes(self):
"""
Returns a JSON-encoded object containing the installed themes and text
color schemes.
"""
#themes = resource_listdir('gateone', '/templates/themes')
themes = os.listdir(os.path.join(getsettings('BASE_DIR'), 'templates/themes'))
# Just in case other junk wound up in that directory:
themes = [a for a in themes if a.endswith('.css')]
themes = [a.replace('.css', '') for a in themes] # Just need the names
message = {'go:themes_list': {'themes': themes}}
self.write_message(message)
评论列表
文章目录