一个简单的python模块,用于从irc消息中应用和剥离格式。
ircmessage的Python项目详细描述
irc消息是一个简单的python模块,用于应用和剥离 从IRC消息格式化。它的主要用途是与python一起使用 基于IRC的机器人。
模块语法的灵感来自 Click自己的风格和 不固定的方法。
安装
您可以通过PIP安装IRC消息格式化程序模块,
pip install ircmessage
此模块提供两个主要方法,style和unstyle
风格
ircmessage.style(text,fg=None,bg=None,bold=False,italics=False,underline=False,reset=True):
此方法用于使用irc属性和/或颜色设置文本样式 代码。
示例:
ircmessage.style('Hello World!',fg='green')
ircmessage.style('ATTENTION!',bold=True,underline=True)
ircmessage.style('Some things',bg=ircmessage.colors.teal)
非风格
ircmessage.unstyle(text)
此方法用于从IRC中删除所有格式化控制代码 消息,以便您可以安全地显示和记录 可打印格式的IRC。
许可证
The MIT License (MIT) Copyright (c) 2015 Makoto Fujimoto Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.