chore: 添加虚拟环境到仓库
- 添加 backend_service/venv 虚拟环境 - 包含所有Python依赖包 - 注意:虚拟环境约393MB,包含12655个文件
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
"""Encoding parameter handling and default."""
|
||||
|
||||
import typing
|
||||
|
||||
import codecs
|
||||
import locale
|
||||
|
||||
from . import copying
|
||||
|
||||
__all__ = ['DEFAULT_ENCODING', 'Encoding']
|
||||
|
||||
DEFAULT_ENCODING = 'utf-8'
|
||||
|
||||
|
||||
class Encoding(copying.CopyBase):
|
||||
"""Encoding used for input and output with ``'utf-8'`` default."""
|
||||
|
||||
_encoding = DEFAULT_ENCODING
|
||||
|
||||
def __init__(self, *, encoding: typing.Optional[str] = DEFAULT_ENCODING,
|
||||
**kwargs) -> None:
|
||||
super().__init__(**kwargs)
|
||||
|
||||
self.encoding = encoding
|
||||
|
||||
def _copy_kwargs(self, **kwargs):
|
||||
"""Return the kwargs to create a copy of the instance."""
|
||||
return super()._copy_kwargs(encoding=self._encoding, **kwargs)
|
||||
|
||||
@property
|
||||
def encoding(self) -> str:
|
||||
"""The encoding for the saved source file."""
|
||||
return self._encoding
|
||||
|
||||
@encoding.setter
|
||||
def encoding(self, encoding: typing.Optional[str]) -> None:
|
||||
if encoding is None:
|
||||
encoding = locale.getpreferredencoding()
|
||||
|
||||
codecs.lookup(encoding) # raise early
|
||||
self._encoding = encoding
|
||||
Reference in New Issue
Block a user