def _add_resource(cls, path, name):
'''Add a Fanstatic resource library to CKAN.
Fanstatic libraries are directories containing static resource files
(e.g. CSS, JavaScript or image files) that can be accessed from CKAN.
See :doc:`/theming/index` for more details.
'''
import inspect
import os
# we want the filename that of the function caller but they will
# have used one of the available helper functions
frame, filename, line_number, function_name, lines, index =\
inspect.getouterframes(inspect.currentframe())[1]
this_dir = os.path.dirname(filename)
absolute_path = os.path.join(this_dir, path)
import ckan.lib.fanstatic_resources
ckan.lib.fanstatic_resources.create_library(name, absolute_path)
评论列表
文章目录