选择文件名文件大小最后修改时间操作
[📄] 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
#!/usr/bin/env python # -*- coding: utf-8 -*- # TOMUSS: The Online Multi User Simple Spreadsheet # Copyright (C) 2010 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 from .. import plugin from .. import utilities import os def favorite_student(server): """Toggle the favorite state of a student""" login = utilities.the_login(server.ticket.user_name) d = utilities.manage_key('LOGINS', os.path.join(login, 'favstu')) if d is False: d = [] else: d = [utilities.the_login(i) for i in eval(d)] student = utilities.the_login(server.something) if student in d: d.remove(student) if student in d: # Remove duplicate (correct old bug) d.remove(student) else: d.append(student) utilities.manage_key('LOGINS', os.path.join(login, 'favstu'), content = repr(d)) return 'ok' plugin.Plugin('favorite_student', '/favorite_student/{?}', function=favorite_student, group='staff')