文件操作 - xsl.py
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/bluefish/plugins/zencoding/filters/xsl.py
编辑文件内容
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Filter for trimming "select" attributes from some tags that contains child elements @author Sergey Chikuyonok (serge.che@gmail.com) @link http://chikuyonok.ru ''' import re import zencoding tags = { 'xsl:variable': 1, 'xsl:with-param': 1 } re_attr = re.compile(r'\s+select\s*=\s*([\'"]).*?\1') def trim_attribute(node): """ Removes "select" attribute from node @type node: ZenNode """ node.start = re_attr.sub('', node.start) @zencoding.filter('xsl') def process(tree, profile): for item in tree.children: if item.type == 'tag' and item.name.lower() in tags and item.children: trim_attribute(item) process(item, profile)
修改文件时间
将文件时间修改为当前时间的前一年
删除文件