Skip to content

Commit

Permalink
[update] 添加代理获取函数配置
Browse files Browse the repository at this point in the history
  • Loading branch information
jhao104 committed Dec 4, 2016
1 parent 86d7079 commit 67bbb08
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
16 changes: 12 additions & 4 deletions Config.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@

[DB]
type = SSDB
host = localhost
port = 8080
name = proxy
host = 42.123.99.64
port = 8889
name = proxy

[ProxyGetter]
;register the proxy getter function
freeProxyFirst = 1
freeProxySecond = 1
freeProxyThird = 1
freeProxyFourth = 1
freeProxyFifth = 1

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

* DB:

  用于存放代理IP,现在暂时只支持SSDB。至于为什么选择SSDB,大家可以参考这篇[文章](https://www.sdk.cn/news/2684),个人觉得SSDB是个不错的Redis替代方案;
  用于存放代理IP,现在暂时只支持SSDB。至于为什么选择SSDB,大家可以参考这篇[文章](https://www.sdk.cn/news/2684),个人觉得SSDB是个不错的Redis替代方案,如果你没有用过SSDB,安装起来也很简单,可以参考[这里](https://github.com/jhao104/memory-notes/blob/master/SSDB/SSDB%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE%E8%AE%B0%E5%BD%95.md)

* Schedule:

Expand Down
5 changes: 5 additions & 0 deletions Util/GetConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,15 @@ def db_host(self):
def db_port(self):
return int(self.config_file.get('DB', 'port'))

@LazyProperty
def proxy_getter_functions(self):
return self.config_file.options('ProxyGetter')


if __name__ == '__main__':
gg = GetConfig()
print gg.db_type
print gg.db_name
print gg.db_host
print gg.db_port
print gg.proxy_getter_functions

0 comments on commit 67bbb08

Please sign in to comment.