コード例 #1
0
 def incr_push_version(self):
     """Called by /_bump to increment the push_version number"""
     # should probably apply locking here
     new_version = cherrypy.config['_push_version'] = util.push_version() + 1
     f = open(util.make_absolute('var/run/splunk/push-version.txt'), 'w')
     f.write(str(new_version))
     f.close()
     return new_version
コード例 #2
0
 def setup_mako(self):
     # init mako_lookup after the cherrypy config has been setup
     global mako_lookup
     if not mako_lookup:
         mako_lookup = TemplateLookup(
             input_encoding='utf-8',
             directories=[
                 util.make_absolute(cherrypy.config.get('templates', 'share/splunk/search_mrsparkle/templates')),
                 util.make_absolute(cherrypy.config.get('module_dir'))
             ],
             imports=[
                 'import splunk',
                 'import cherrypy',
                 'from lib import i18n',
                 'from lib.util import json_html_safe as jsonify',#legacy
                 'from lib.util import json_decode',#replacement
                 'from lib.util import is_xhr, generateSelfHelpLink, extract_help_links'
             ]#,
             #module_directory=cherrypy.config.get('mako_cache_path', '/tmp/mako_cache')
         )
コード例 #3
0
ファイル: __init__.py プロジェクト: nagyist/splunk-shuttl
 def setup_mako(self):
     # init mako_lookup after the cherrypy config has been setup
     global mako_lookup
     if not mako_lookup:
         mako_lookup = TemplateLookup(
             input_encoding="utf-8",
             directories=[
                 util.make_absolute(cherrypy.config.get("templates", "share/splunk/search_mrsparkle/templates")),
                 util.make_absolute(cherrypy.config.get("module_dir")),
             ],
             imports=[
                 "import splunk",
                 "import cherrypy",
                 "from lib import i18n",
                 "from lib.util import json_html_safe as jsonify",  # legacy
                 "from lib.util import json_decode",  # replacement
                 "from lib.util import is_xhr, generateSelfHelpLink, extract_help_links",
             ]  # ,
             # module_directory=cherrypy.config.get('mako_cache_path', '/tmp/mako_cache')
         )