This repository was archived by the owner on Jun 10, 2024. It is now read-only.
-
Couldn't load subscription status.
- Fork 3.7k
Develop #982
Open
lusi1990
wants to merge
68
commits into
binux:master
Choose a base branch
from
lusi1990:develop
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Develop #982
Changes from 59 commits
Commits
Show all changes
68 commits
Select commit
Hold shift + click to select a range
49bdadf
Changes pycurl version
6068992
update
858b92a
修复 express 等没有安装的问题
3da32f7
isort pyspider
7a8f586
isort pyspider
6fa962c
review
0838460
review
2f39bc3
update python version
1fcdb9a
update elasticsearch version
32a2d01
add requirements for company
b0c48a5
update seadaka requirements
fec39cf
Merge branch 'release/v0.3.11'
6f7e50f
Merge tag 'v0.3.11' into develop
41029d6
update click version
fe0cd4f
update lxml version
ddfe171
update psycopg2 version
436c5e6
修改 gcd 过时方法
34a2896
Merge remote-tracking branch 'origin/develop' into develop
05bca89
update getargspec to getfullargspec
55a0a72
pprint 使用 buildin
3ff7f85
review
d2dc41b
review
397dff4
update
c0126f8
update
a84149e
raname list_io
90a98eb
remove "encoding: utf-8" line
4e421a0
review libs
3e77df5
review
4178546
review
eb4c3b7
sort import
1212cad
review
297aa32
update
9512717
update requirements
2a9b2d8
Merge branch 'develop' into bugfix/fix_3.9
0bceaf9
update
7b783b2
update
906cc6f
update
e246a9a
update
08c2f0a
update
a241037
Merge branch 'develop' into bugfix/fix_3.9
7d52a7d
update flask flask-login Werkzeug version
9b03abc
update
08e2228
update dependents
7b2cf03
update dependents
e82c1f3
update dependents
59ed77e
fix bugs
cc7db5c
update
0a7b95d
update
9270501
remove unused import
20b65ad
remove xmlrpclib
d7d24f9
review
b80f497
Merge branch 'bugfix/fix_3.9' into develop
522632c
update
b7deb5e
Merge branch '0.4.0release'
913a0a2
Merge tag '0.4.0release' into develop
97ec8bb
rename LICENSE file name
cf1e1eb
update
348c003
update
4940ece
Merge branch 'fix_readme' into develop
22db274
update
500b2cf
update
ec1f8e9
update pika,kombu, amqp, vine versions
lusi1990 4be7a96
upgrade elasticsearch version
lusi1990 18808be
upgrade elasticsearch version
lusi1990 3c0cad6
update Dockerfile
lusi1990 7181538
review
d42be29
downgrade es version
c74b1a1
downgrade es version
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,4 +36,4 @@ nosetests.xml | |
| .mr.developer.cfg | ||
| .project | ||
| .pydevproject | ||
| .idea | ||
| config.json | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| FROM python:3.6 | ||
| FROM python:3.7 | ||
| MAINTAINER binux <[email protected]> | ||
|
|
||
| # install phantomjs | ||
|
|
@@ -26,6 +26,8 @@ RUN pip install -r /opt/pyspider/requirements.txt | |
|
|
||
| # add all repo | ||
| ADD ./ /opt/pyspider | ||
| # install seadaka requ | ||
| RUN pip install -r /opt/pyspider/requirements-seadaka.txt | ||
|
|
||
| # run test | ||
| WORKDIR /opt/pyspider | ||
|
|
||
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| version: "3.7" | ||
| version: "3.3" | ||
|
|
||
| # replace /path/to/dir/ to point to config.json | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,25 @@ | ||
| #!/usr/bin/env python | ||
| # -*- encoding: utf-8 -*- | ||
| # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: | ||
| # Author: Binux<[email protected]> | ||
| # http://binux.me | ||
| # Created on 2015-11-10 01:31:54 | ||
|
|
||
| import sys | ||
| from unittest.mock import MagicMock | ||
|
|
||
| from recommonmark.parser import CommonMarkParser | ||
|
|
||
|
|
||
| class Mock(MagicMock): | ||
| @classmethod | ||
| def __getattr__(cls, name): | ||
| return Mock() | ||
| return Mock() | ||
|
|
||
| MOCK_MODULES = ['pycurl', 'lxml', 'psycopg2'] | ||
| sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES) | ||
|
|
||
| source_parsers = { | ||
| '.md': CommonMarkParser, | ||
| '.md': CommonMarkParser, | ||
| } | ||
|
|
||
| source_suffix = ['.rst', '.md'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| #!/usr/bin/env python | ||
| # -*- encoding: utf-8 -*- | ||
| # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: | ||
| # Author: Binux<[email protected]> | ||
| # http://binux.me | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,14 @@ | ||
| #!/usr/bin/env python | ||
| # -*- encoding: utf-8 -*- | ||
| # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: | ||
| # Author: Binux<[email protected]> | ||
| # http://binux.me | ||
| # Created on 2014-10-08 15:04:08 | ||
|
|
||
| import os, requests, json | ||
| from six.moves.urllib.parse import urlparse, parse_qs | ||
| import json | ||
| import os | ||
|
|
||
| import requests | ||
| from six.moves.urllib.parse import parse_qs, urlparse | ||
|
|
||
|
|
||
| def connect_database(url): | ||
|
|
@@ -60,16 +62,15 @@ def _connect_database(url): # NOQA | |
| other_scheme = "+".join(scheme[1:-1]) | ||
|
|
||
| if dbtype not in ('taskdb', 'projectdb', 'resultdb'): | ||
| raise LookupError('unknown database type: %s, ' | ||
| 'type should be one of ["taskdb", "projectdb", "resultdb"]', dbtype) | ||
| raise LookupError(f'unknown database type: {dbtype}, type should be one of ["taskdb", "projectdb", "resultdb"]') | ||
|
|
||
| if engine == 'mysql': | ||
| return _connect_mysql(parsed,dbtype) | ||
| return _connect_mysql(parsed, dbtype) | ||
|
|
||
| elif engine == 'sqlite': | ||
| return _connect_sqlite(parsed,dbtype) | ||
| return _connect_sqlite(parsed, dbtype) | ||
| elif engine == 'mongodb': | ||
| return _connect_mongodb(parsed,dbtype,url) | ||
| return _connect_mongodb(parsed, dbtype, url) | ||
|
|
||
| elif engine == 'sqlalchemy': | ||
| return _connect_sqlalchemy(parsed, dbtype, url, other_scheme) | ||
|
|
@@ -88,44 +89,44 @@ def _connect_database(url): # NOQA | |
| from .local.projectdb import ProjectDB | ||
| return ProjectDB(scripts) | ||
| else: | ||
| raise LookupError('not supported dbtype: %s', dbtype) | ||
| raise LookupError(f'not supported dbtype: {dbtype}') | ||
| elif engine == 'elasticsearch' or engine == 'es': | ||
| return _connect_elasticsearch(parsed, dbtype) | ||
|
|
||
| elif engine == 'couchdb': | ||
| return _connect_couchdb(parsed, dbtype, url) | ||
|
|
||
| else: | ||
| raise Exception('unknown engine: %s' % engine) | ||
| raise Exception(f'unknown engine: {engine}') | ||
|
|
||
|
|
||
| def _connect_mysql(parsed,dbtype): | ||
| parames = {} | ||
| def _connect_mysql(parsed, dbtype): | ||
| params = dict() | ||
| if parsed.username: | ||
| parames['user'] = parsed.username | ||
| params['user'] = parsed.username | ||
| if parsed.password: | ||
| parames['passwd'] = parsed.password | ||
| params['passwd'] = parsed.password | ||
| if parsed.hostname: | ||
| parames['host'] = parsed.hostname | ||
| params['host'] = parsed.hostname | ||
| if parsed.port: | ||
| parames['port'] = parsed.port | ||
| params['port'] = parsed.port | ||
| if parsed.path.strip('/'): | ||
| parames['database'] = parsed.path.strip('/') | ||
| params['database'] = parsed.path.strip('/') | ||
|
|
||
| if dbtype == 'taskdb': | ||
| from .mysql.taskdb import TaskDB | ||
| return TaskDB(**parames) | ||
| return TaskDB(**params) | ||
| elif dbtype == 'projectdb': | ||
| from .mysql.projectdb import ProjectDB | ||
| return ProjectDB(**parames) | ||
| return ProjectDB(**params) | ||
| elif dbtype == 'resultdb': | ||
| from .mysql.resultdb import ResultDB | ||
| return ResultDB(**parames) | ||
| return ResultDB(**params) | ||
| else: | ||
| raise LookupError | ||
|
|
||
|
|
||
| def _connect_sqlite(parsed,dbtype): | ||
| def _connect_sqlite(parsed, dbtype): | ||
| if parsed.path.startswith('//'): | ||
| path = '/' + parsed.path.strip('/') | ||
| elif parsed.path.startswith('/'): | ||
|
|
@@ -148,7 +149,7 @@ def _connect_sqlite(parsed,dbtype): | |
| raise LookupError | ||
|
|
||
|
|
||
| def _connect_mongodb(parsed,dbtype,url): | ||
| def _connect_mongodb(parsed, dbtype, url): | ||
| url = url.replace(parsed.scheme, 'mongodb') | ||
| parames = {} | ||
| if parsed.path.strip('/'): | ||
|
|
@@ -167,7 +168,7 @@ def _connect_mongodb(parsed,dbtype,url): | |
| raise LookupError | ||
|
|
||
|
|
||
| def _connect_sqlalchemy(parsed, dbtype,url, other_scheme): | ||
| def _connect_sqlalchemy(parsed, dbtype, url, other_scheme): | ||
| if not other_scheme: | ||
| raise Exception('wrong scheme format: %s' % parsed.scheme) | ||
| url = url.replace(parsed.scheme, other_scheme) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,15 @@ | ||
| #!/usr/bin/env python | ||
| # -*- encoding: utf-8 -*- | ||
| # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: | ||
| # Author: Binux<[email protected]> | ||
| # http://binux.me | ||
| # Created on 2014-02-09 11:28:52 | ||
|
|
||
| import re | ||
| from typing import Dict | ||
|
|
||
| # NOTE: When get/get_all/check_update from database with default fields, | ||
| # all following fields should be included in output dict. | ||
|
|
||
| { | ||
| 'project': { | ||
| 'name': str, | ||
|
|
@@ -34,10 +35,10 @@ class ProjectDB(object): | |
| 'RUNNING', | ||
| ] | ||
|
|
||
| def insert(self, name, obj={}): | ||
| def insert(self, name, obj: Dict = None): | ||
| raise NotImplementedError | ||
|
|
||
| def update(self, name, obj={}, **kwargs): | ||
| def update(self, name, obj: Dict = None, **kwargs): | ||
| raise NotImplementedError | ||
|
|
||
| def get_all(self, fields=None): | ||
|
|
@@ -54,9 +55,9 @@ def check_update(self, timestamp, fields=None): | |
|
|
||
| def split_group(self, group, lower=True): | ||
| if lower: | ||
| return re.split("\W+", (group or '').lower()) | ||
| return re.split(r"\W+", (group or '').lower()) | ||
| else: | ||
| return re.split("\W+", group or '') | ||
| return re.split(r"\W+", group or '') | ||
|
|
||
| def verify_project_name(self, name): | ||
| if len(name) > 64: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| #!/usr/bin/env python | ||
| # -*- encoding: utf-8 -*- | ||
| # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: | ||
| # Author: Binux<[email protected]> | ||
| # http://binux.me | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| #!/usr/bin/env python | ||
| # -*- encoding: utf-8 -*- | ||
| # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: | ||
| # Author: Binux<[email protected]> | ||
| # http://binux.me | ||
|
|
@@ -76,10 +75,14 @@ def status_count(self, project): | |
| ''' | ||
| raise NotImplementedError | ||
|
|
||
| def insert(self, project, taskid, obj={}): | ||
| def insert(self, project, taskid, obj: dict = None): | ||
| if obj is None: | ||
| obj = dict() | ||
| raise NotImplementedError | ||
|
|
||
| def update(self, project, taskid, obj={}, **kwargs): | ||
| def update(self, project, taskid, obj: dict = None, **kwargs): | ||
| if obj is None: | ||
| obj = dict() | ||
| raise NotImplementedError | ||
|
|
||
| def drop(self, project): | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't your package in base docker image, you could create another Dockerfile that base on this image while install your additional dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for that, I remove it.