文件操作 - pager.py
返回文件管理
返回主菜单
删除本文件
文件: /opt/alt/python313/lib/python3.13/site-packages/pip/_vendor/rich/pager.py
编辑文件内容
from abc import ABC, abstractmethod from typing import Any class Pager(ABC): """Base class for a pager.""" @abstractmethod def show(self, content: str) -> None: """Show content in pager. Args: content (str): Content to be displayed. """ class SystemPager(Pager): """Uses the pager installed on the system.""" def _pager(self, content: str) -> Any: # pragma: no cover return __import__("pydoc").pager(content) def show(self, content: str) -> None: """Use the same pager used by pydoc.""" self._pager(content) if __name__ == "__main__": # pragma: no cover from .__main__ import make_test_card from .console import Console console = Console() with console.pager(styles=True): console.print(make_test_card())
修改文件时间
将文件时间修改为当前时间的前一年
删除文件