Scrapy 源代码分析系列-2 signals, signalmanager, project, conf

1. 模块: signals.py signalmanager.py project.py conf.py

1.1 conf.py project.py

conf.py 是废弃的模块。她的功能由crawler.settings代替。 来自conf.py的代码如下:

 if 'scrapy.cmdline' not in sys.modules:
from scrapy.utils.project import get_project_settings
settings = get_project_settings() import warnings
from scrapy.exceptions import ScrapyDeprecationWarning
warnings.warn("Module `scrapy.conf` is deprecated, use `crawler.settings` attribute instead",
ScrapyDeprecationWarning, stacklevel=2)

project.py 也是被废弃的模块。

1.2 interfaces.py

interfaces.py 定义了接口ISpiderManager, 接口方法如下:

def create(spider_name, **spider_args): 创建一个新的Spider对象。

def list(): 返回project中所有的spider。

def find_by_request(request): 处理request的sipder列表

该模块依赖: zope.interface (zope.interface), 关于该库另外进行分析。

1.3 signals.py signalmanager.py

signals.py 定义了一系列object类型的对象。

signalmanager.py 定义类SignalManager来管理signal。该类依赖 dispatcher 和 signal:

 from scrapy.xlib.pydispatch import dispatcher
from scrapy.utils import signal

那么需要分析子包: scrapy.xlib

To Be Continued:

接下来分析模块: item.py link.py linkextractor.py log.py logformatter.py exceptions.py extension.py

Python.Scrapy.12-scrapy-source-code-analysis-part-2的更多相关文章

  1. Memcached source code analysis (threading model)--reference

    Look under the start memcahced threading process memcached multi-threaded mainly by instantiating mu ...

  2. Golang Template source code analysis(Parse)

    This blog was written at go 1.3.1 version. We know that we use template thought by followed way: fun ...

  3. Memcached source code analysis -- Analysis of change of state--reference

    This article mainly introduces the process of Memcached, libevent structure of the main thread and w ...

  4. Apache Commons Pool2 源码分析 | Apache Commons Pool2 Source Code Analysis

    Apache Commons Pool实现了对象池的功能.定义了对象的生成.销毁.激活.钝化等操作及其状态转换,并提供几个默认的对象池实现.在讲述其实现原理前,先提一下其中有几个重要的对象: Pool ...

  5. Redis source code analysis

    http://zhangtielei.com/posts/blog-redis-dict.html http://zhangtielei.com/assets/photos_redis/redis_d ...

  6. linux kernel & source code analysis& hacking

    https://kernelnewbies.org/ http://www.tldp.org/LDP/lki/index.html https://kernelnewbies.org/ML https ...

  7. 2018.6.21 HOLTEK HT49R70A-1 Source Code analysis

    Cange note: “Reading TMR1H will latch the contents of TMR1H and TMR1L counter to the destination”? F ...

  8. The Ultimate List of Open Source Static Code Analysis Security Tools

    https://www.checkmarx.com/2014/11/13/the-ultimate-list-of-open-source-static-code-analysis-security- ...

  9. Top 40 Static Code Analysis Tools

    https://www.softwaretestinghelp.com/tools/top-40-static-code-analysis-tools/ In this article, I have ...

  10. Source Code Reading for Vue 3: How does `hasChanged` work?

    Hey, guys! The next generation of Vue has released already. There are not only the brand new composi ...

随机推荐

  1. 【转】C# 使用消息队列,包括远程访问

    出处:http://www.cnblogs.com/80X86/p/5557801.html 近期做一个小的功能需求,用到了队列,用的时候出了很多问题,现在总结一下,希望能对有需要的人提供帮助. 我的 ...

  2. [ActionScript 3.0] AS3.0 对象在矩形范围随机运动

    package com.views { import flash.display.Bitmap; import flash.display.MovieClip; import flash.displa ...

  3. Quartus II中FPGA的管脚分配保存方法

    一.摘要 将Quartus II中FPGA管脚的分配及保存方法做一个汇总. 二.管脚分配方法 FPGA 的管脚分配,除了在QII软件中,选择“Assignments ->Pin”标签(或者点击按 ...

  4. Android Studio JNI/NDK 编程(二) Windows 下环境搭建 demo 开发

    环境 windows 8  (注:其实 Linux 开发可能更方便) Android Studio 2.1; 一 . 下载 安装android-ndk开发包 地址:链接:http://pan.baid ...

  5. sql 2008 R2添加对MySql的远程服务器链接

    (1).我的sql 2008 R2所在的系统为Windows server 2008 *64 (2).MySQL所在的系统为Windows server 2003 *86 我想要实现的是在sql 20 ...

  6. 简单实用的Windows命令(一)

    前几天新买了一台笔记本电脑,使用了一下几个简单的查看电脑配置的命令,觉得非常的不错,在此记录一下 一:运行命令的方式有两种 1:使用快捷键WIN+R,然后在弹出的“运行”对话框中输入对应的命令 2:在 ...

  7. Excel_常用快捷键

    Ctrl+B        粗体Ctrl+U         下划线Ctrl+I         斜体Ctrl+5      删除线Ctrl+9      隐藏选中的行Ctrl+0      隐藏选中 ...

  8. angularjs发送delete请求传参数的方法

    angularjs使用$http.delete()发送请求,默认是没法通过变量来传参数

  9. python面向对象个人总结

    基础概念:面向对象其实就是类与对象的使用. 类是模板,对象是实例.模板创建实例,实例去类里面去执行类的方法.类的例子: class Foo:           def Bar(self):      ...

  10. System.ArgumentOutOfRangeException: 指定的参数已超出有效值的范围

    GridView指定的参数已超出有效值的范围GridView在更新过程中异常详细信息: System.ArgumentOutOfRangeException: 指定的参数已超出有效值的范围.参数名:v ...