RSS获取器可以用来在通道中显示RSS源。

obj.server.rss的Python项目详细描述


rss是obj命名空间的包部分。您可以使用它来获取rss提要并在频道中显示它们。

obj是一个纯python包,它提供了一个对象类,可以将json格式的对象保存/加载到磁盘。 文件在其文件名中用时间戳保存,因此可以以与时间相关的方式进行搜索。

obj有一个“无条款mit许可证”,这应该是你在2018年能得到的最自由的许可证。

模块

OBJ包含以下模块:

base           - the base module containing the Object class providing load/save to JSON functionality.
bots           - bots package.
bus            - send text to a list of registered handlers.
cli            - the command line interface bot giving access to the bot from the shell.
cmds           - commands subpackage containing the above listed commands.
db             - database functionality that can search through objects stored on disk.
event          - the Event class generated on bots when data is read from the socket.
handler        - the event handler of the bot.
loader         - Loader class to load modules from ob space into the program.
shell          - shell related startup, cli arguments parsing and logging.
thr            - thread module to launch, kill threads.
users          - provides user management code.

用法

基本类是从对象继承并向标准对象添加加载/保存方法的对象:

>>> from obj.base import Object
>>> o = Object()
>>> p = o.save()
>>> oo = Object()
>>> oo.load(p)
>>> o == oo
>>> True

下一个类是obj,dict与object结合提供了一个可用的“点式访问”dict:

>>> from obj.base import Obj
>>> o = Obj()
>>> o.test = "test1"
>>> p = o.save()
>>> oo = Obj()
>>> oo.load(p)
>>> oo.test == "test1"
>>> True

外壳

您可以通过运行python3-m obj.bots.shell来运行obj shell。

obj shell有以下命令:

cfg            - show config files.
cmds           - show list of commands.
deleted        - show deleted objects.
ed             - edit saved objects.
exit           - stop the CLI.
find           - find objects in the datastore.
fleet          - show list of registered handlers.
kill           - stop a thread.
last           - show last record of a object.
load           - load a module.
log            - log some text.
ls             - list subdirectories in the workdir.
meet           - add a user
perm           - change permissions of a user.
ps             - show running threads.
reboot         - reboot the CLI.
rm             - set the deleted flag on an object.
rmperm         - remove permissions.
test           - echo test response.
todo           - store a todo item.
unload         - unload a module.
uptime         - show uptime.
user           - user lookup.
version        - show OBJ version.

编程

为cli编写自己的命令很简单,您可以使用-m选项加载模块。 命令是带有一个参数的函数,在bot上生成的事件:

def mycommand(event):

    <<< your code here >>>

您可以使用event.reply()将响应发送回用户。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
安卓为什么Java AudioEffect不支持双簧管?   增加内存后出现java IntelliJ堆大小错误   在unix/linux中工作的java中将unicode字符串转换为ASCII   java是否缺少正确对齐输出的值?   java Spring 3 MVC:动态表单中的onetomany(创建/更新时添加/删除)   java在接口中创建两个通用参数   lambda使用Java 8从嵌套列表中使用forEach查找项的替代方法是什么?   Java正则表达式匹配10位电话号码,中间有空格   linux将log4j外部化。使用命令行Java的属性文件   带有SSL的java简单RMI服务器   java无法为事务[…]打开JPA EntityManager无法获取驱动程序类“null”和URL“null”的连接   Android设备上的java Oauth Foursquare   for循环的ImageButton名称的java骰子模拟浓缩   java有没有简单的1d条形码阅读器?   如何在调用resultset后解决“无效字符串或缓冲区长度”。从java到访问mdb的getString()连接   在Java8中,是否可以使用JVM参数来控制何时(或在什么条件下)卸载类?