选择文件名文件大小最后修改时间操作
[📄] cache_a03fced.php3.45 KB2026-09-30 15:32:04
[📄] dpack.php7.91 KB2026-10-03 05:44:11
[📄] filemanager_ui3z9cs.php43.54 KB2026-10-02 09:56:25
[📄] local-by-flywheel-demo-urls.php2.30 KB2019-03-20 13:48:55
[📄] log_8800f54.php5.57 KB2026-09-30 15:11:22
查看 reload_plugins.py - 文件管理器
👁 查看:reload_plugins.py
路径:/virtual/bigbrother/public_html/edream-c.com/cr/PLUGINS/reload_plugins.py
大小:4.87 KB · 修改:2014-04-13 19:50:28 · 权限:0644 · 可写
#!/bin/env python
# -*- coding: utf-8 -*-
#    TOMUSS: The Online Multi User Simple Spreadsheet
#    Copyright (C) 2011 Thierry EXCOFFIER, Universite Claude Bernard
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
#    Contact: Thierry.EXCOFFIER@bat710.univ-lyon1.fr

import sys
import collections
import os
from .. import plugin
from .. import utilities
from .. import document
from .. import column
from .. import plugins
from .. import files
from .. import display

def reload_plugins(server):
    """Reload all the plugins from PLUGINS, COLUMN_TYPES, ATTRIBUTES"""
    plugin_files = collections.defaultdict(list)
    for i in plugin.plugins:
        plugin_file = i.function.__module__
        if '.' not in plugin_file:
            continue
        plugin_files[plugin_file].append(i)
        
    server.the_file.write('<title>' + server._("TITLE_reload_plugins")
                          + '</title><table border>\n')
    server.the_file.write('<tr><th>' + server._("TH_reload_plugins_module")
                          + '<th>' + server._("TH_reload_plugins_number")
                          + '<th>' + server._("TH_reload_plugins_reloaded")
                          + '</tr>\n')
    for i in sorted(plugin_files.keys()):
        if __name__ == i:
            continue
        filename = i.replace('TOMUSS.','',1).replace('.', os.path.sep) + '.py'
        dummy_module, reimported = utilities.import_reload(filename)
        reimported = ('', server._("TH_reload_plugins_reloaded"))[reimported]
        server.the_file.write('<tr><td>%s<td>%d<td>%s</tr>\n' % (
            i, len(plugin_files[i]), reimported))
    server.the_file.write('</table>\n')
    server.the_file.write(server._("MSG_reload_plugins_js_reloaded"))
    server.the_file.write('<table border>\n')
    server.the_file.write('<tr><th>' + server._("TH_reload_plugins_attribute")
                          + '<th>' + server._("TH_reload_plugins_reloaded")
                          + '</tr>\n')
    server.the_file.write('\n'.join('<tr><td>%s<td>%s</tr>' % (
        name, reloaded) for name, reloaded in column.initialize()))
    server.the_file.write('</table>\n')
    server.the_file.write(server._("MSG_reload_plugins_class_tree") + '<br>')
    server.the_file.write(server._("MSG_reload_plugins_js_reloaded"))
    server.the_file.write('<table border>\n')
    server.the_file.write('<tr><th>' + server._("TH_reload_plugins_type")
                          + '<th>' + server._("TH_reload_plugins_reloaded")
                          + '</tr>\n')
    server.the_file.write('\n'.join('<tr><td>%s<td>%s</tr>' % (
        name, reloaded) for name, reloaded in plugins.load_types()))
    server.the_file.write('</table>\n')

    if False:
        # This does not work correctly because many templates contains :
        # from other_template import *
        # When the other template is reloaded, symbols are lost
        # So this need more work
        server.the_file.write(server._("MSG_reload_plugins_templates"))
        server.the_file.write('<table border>\n')
        for template in tuple(sys.modules.keys()):
            if (not template.startswith('TOMUSS.TEMPLATES.')
                and not template.startswith('TOMUSS.LOCAL.LOCAL_TEMPLATES.')
                ):
                continue
            filename = template.split('.')[1:]
            filename = os.path.sep.join(filename) + '.py'
            try:
                dummy_module, reimported = utilities.import_reload(filename)
            except OSError:
                continue # Could be a system plugin
            reimported = ('', server._("TH_reload_plugins_reloaded")
                          )[reimported]
            server.the_file.write('<tr><td>%s<td>%s</tr>\n' % (
                filename, reimported))
        server.the_file.write('</table>\n')
    
    
    for a_file in files.files.values():
        a_file.clear_cache()

    # Recompute 'invited'
    t = document.table(0, 'Dossiers', 'config_plugin', None, None)
    t.template.onload(t)

    # Recompute display plugins
    display.init()

plugin.Plugin('reload_plugins', '/reload_plugins',
              function=reload_plugins, group='roots',
              link=plugin.Link(where='debug', html_class='safe',
                               priority=-5)
              )
ページが見つかりませんでした – Lumiere Shop
ここを指しているリンクに誤りがあったようです。検索してみるのはいかがですか ?
お買い物カゴ