文件操作 - escape.py
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/bluefish/plugins/zencoding/filters/escape.py
编辑文件内容
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Filter for escaping unsafe XML characters: <, >, & @author Sergey Chikuyonok (serge.che@gmail.com) @link http://chikuyonok.ru ''' import re import zencoding char_map = { '<': '<', '>': '>', '&': '&' } re_chars = re.compile(r'[<>&]') def escape_chars(text): return re_chars.sub(lambda m: char_map[m.group(0)], text) @zencoding.filter('e') def process(tree, profile=None): for item in tree.children: item.start = escape_chars(item.start) item.end = escape_chars(item.end) process(item) return tree
修改文件时间
将文件时间修改为当前时间的前一年
删除文件