文件操作 - _convenience.py
返回文件管理
返回主菜单
删除本文件
文件: /usr/lib/python3/dist-packages/twisted/_threads/_convenience.py
编辑文件内容
# -*- test-case-name: twisted._threads.test.test_convenience -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Common functionality used within the implementation of various workers. """ from ._ithreads import AlreadyQuit class Quit: """ A flag representing whether a worker has been quit. @ivar isSet: Whether this flag is set. @type isSet: L{bool} """ def __init__(self): """ Create a L{Quit} un-set. """ self.isSet = False def set(self): """ Set the flag if it has not been set. @raise AlreadyQuit: If it has been set. """ self.check() self.isSet = True def check(self): """ Check if the flag has been set. @raise AlreadyQuit: If it has been set. """ if self.isSet: raise AlreadyQuit()
修改文件时间
将文件时间修改为当前时间的前一年
删除文件