Skip to content

Commit

Permalink
style: type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
shengchenyang committed Mar 4, 2024
1 parent 7620e87 commit 61ceb65
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
4 changes: 1 addition & 3 deletions ayugespidertools/scraper/middlewares/netlib/aiohttplib.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,7 @@ async def process_request(

# 设置 url
_url = self.aiohttp_args.get("url") or request.url
aiohttp_req_args = AiohttpRequestArgs(
url=_url,
)
aiohttp_req_args = AiohttpRequestArgs(url=_url)

# 设置请求方式
if _method := self.aiohttp_args.get("method"):
Expand Down
25 changes: 24 additions & 1 deletion ayugespidertools/scraper/spiders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,19 @@
from sqlalchemy.engine.base import Engine as SqlalchemyEngineT
from typing_extensions import Self

from ayugespidertools.common.typevars import slogT
from ayugespidertools.common.typevars import (
DynamicProxyConf,
ESConf,
ExclusiveProxyConf,
KafkaConf,
MongoDBConf,
MQConf,
MysqlConf,
OracleConf,
OssConf,
PostgreSQLConf,
slogT,
)


class AyuSpider(Spider):
Expand All @@ -46,6 +58,17 @@ class AyuSpider(Spider):
es_engine: "Elasticsearch"
es_engine_conn: "Elasticsearch"

mysql_conf: "MysqlConf"
mongodb_conf: "MongoDBConf"
postgres_conf: "PostgreSQLConf"
es_conf: "ESConf"
oracle_conf: "OracleConf"
rabbitmq_conf: "MQConf"
kafka_conf: "KafkaConf"
dynamicproxy_conf: "DynamicProxyConf"
exclusiveproxy_conf: "ExclusiveProxyConf"
oss_conf: "OssConf"

SPIDER_TIME: str = time.strftime("%Y-%m-%d", time.localtime())

@property
Expand Down

0 comments on commit 61ceb65

Please sign in to comment.