Skip to content

Commit b06fcc6

Browse files
committed
pycodestyle doc lying about tox.ini sections.
1 parent 94a5018 commit b06fcc6

File tree

4 files changed

+116
-34
lines changed

4 files changed

+116
-34
lines changed

tools/blacklisted.txt

+66
Original file line numberDiff line numberDiff line change
@@ -339,3 +339,69 @@ fonfon/ImportError-demo
339339
jingxianwen/cloud-regime-error-metric
340340
iceterminal/saveErrorLog
341341
belzner/idle-errors-uap
342+
dimalik/prediction_error
343+
alpha-beta-soup/errorgeopy
344+
SoftwareEngineering2016Group2/Errand
345+
spacemanspiff2007/GetOpenhabErrors
346+
samueldg/errbot-hipchat-docker
347+
Cis112233/Sentence-err
348+
marcomang/To_Err
349+
pipi1226/python-imgFindErr
350+
rdhananjaya/co318_err_correction
351+
WASPSS/line_err_estimator
352+
hover2pi/errors
353+
haxsaw/errator
354+
Simplistix/errorhandler
355+
etheleon/errorTrap
356+
Cobord/ErrorCorrectingCodes
357+
coroner4817/ErrorTextClassification
358+
nausheenfatma/Evaluation-Metrics-for-Graded-Relevance-Judgments-NDCG-and-ERR
359+
piohhmy/error-rat
360+
maggiewang1117/scrapy_errata
361+
AtefBN/esdoc-errata
362+
pavelfilippi/trial-error
363+
PlasmaSheep/sphinx-error
364+
arunavsk/Profanity-Error
365+
aafrey/errbot-dockerfile
366+
dfabulich/disable-errorprone
367+
attakei/errbot-crrontab
368+
FiannaOBrien/grammatical-errors
369+
bdero/errbot-test
370+
Judice/msq_error
371+
sebs616/Error-medio
372+
uskysd/openpyxl-errorbar
373+
Kaniabi/docker-errbot
374+
e621Mobile/Error-Reporter
375+
FilipVdBergh/Erres_project
376+
egrepo7/errorfilled_loginreg
377+
webpigeon/docker-errbot
378+
andrewbaxter/scrapy-errbackdupefilter
379+
JenniferRondineau/PipelineERRBS
380+
lllucius/spacewalk-errata-loader
381+
jhonjairoroa87/celery-detailed-error-handling
382+
ctoth/jumpToError
383+
ec06cumt/log_error_sendmail
384+
sot/attitude_error_mon
385+
minorg/viroid_error_rate
386+
mgrace-greenphire/error-log-parser
387+
wangyuxi1990/cloud-regime-error-metric
388+
jwanglof/flask-errorhandler-sendgrid
389+
shun-y/defectingErrorTelop
390+
krapivchenkon/appengine-route-svc-error
391+
cdtx/django_error_handlers
392+
AtefBN/errata-esdoc-ws
393+
fmarchenko/django-issues-errors
394+
hambuergaer/satellite6_errata_install
395+
LandRegistry/lc-error-reporting
396+
LandRegistry/lc-error-reporting
397+
shiift/error_correcting_parser
398+
riyapal/Characterising-Parser-Errors
399+
mihaibivol/isbnlib-flask-error-demo
400+
Rajeev69/match_error_check
401+
vasilty/percent_image_error_django
402+
christian-rauch/lcm_state_error_viz
403+
osu-cass/sdg-python-error-logging
404+
yusanenko-vadim/django-1.4-error-monitor
405+
NinjaWolf64/Python-3.4.3-Errors
406+
olgaramz/Automatic-detection-of-errors-in-comparative-constructions
407+
kevindeasis/Simulator-for-Error-Correction-Detection-Encoding-Hamming-s-

tools/plugin-gen.py

+45-32
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@
2323
log.fatal("No token found, cannot access the GitHub API")
2424
except ValueError:
2525
log.fatal("Token file cannot be properly read, should be of the form username:token")
26-
finally:
27-
sys.exit(-1)
26+
except:
27+
log.exception("auth execption:")
28+
# sys.exit(-1)
2829

2930
user_cache = {}
3031

@@ -94,6 +95,8 @@ def rate_limit(resp):
9495
ts = datetime.fromtimestamp(reset)
9596
delay = (ts - datetime.now()).total_seconds()
9697
log.info("Hit rate limit. Have to wait for %d seconds", delay)
98+
if delay < 0: # time drift
99+
delay = 2
97100
time.sleep(delay)
98101

99102

@@ -114,40 +117,46 @@ def check_repo(repo):
114117
avatar_url = get_avatar_url(repo)
115118

116119
for plug in plug_items:
117-
plugfile_resp = requests.get('https://raw.githubusercontent.com/%s/master/%s' % (repo, plug["path"]))
120+
plugfile_resp = requests.get('https://raw.githubusercontent.com/%s/master/%s' % (repo, plug['path']))
118121
log.debug('Found a plugin:')
119122
log.debug('Repo: %s', repo)
120123
log.debug('File: %s', plug['path'])
121124
parser = configparser.ConfigParser()
122-
parser.read_string(plugfile_resp.text)
123-
name = parser['Core']['Name']
124-
log.debug('Name: %s', name)
125-
126-
if 'Documentation' in parser:
127-
doc = parser['Documentation']['Description']
128-
log.debug('Documentation: %s', doc)
129-
else:
130-
doc = ''
131-
132-
if 'Python' in parser:
133-
python = parser['Python']['Version']
134-
log.debug('Python Version: %s', python)
135-
else:
136-
python = '2'
137-
138-
plugin = {
139-
'path': plug['path'],
140-
'repo': 'https://github.com/{0}'.format(repo),
141-
'documentation': doc,
142-
'name': name,
143-
'python': python,
144-
'avatar_url': avatar_url,
145-
}
146-
147-
repo_entry = plugins.get(repo, {})
148-
repo_entry[name] = plugin
149-
plugins[repo] = repo_entry
150-
log.debug('Catalog added plugin %s.', plugin['name'])
125+
try:
126+
parser.read_string(plugfile_resp.text)
127+
128+
name = parser['Core']['Name']
129+
log.debug('Name: %s', name)
130+
131+
if 'Documentation' in parser and 'Description' in parser['Documentation']:
132+
doc = parser['Documentation']['Description']
133+
log.debug('Documentation: %s', doc)
134+
else:
135+
doc = ''
136+
137+
if 'Python' in parser:
138+
python = parser['Python']['Version']
139+
log.debug('Python Version: %s', python)
140+
else:
141+
python = '2'
142+
143+
plugin = {
144+
'path': plug['path'],
145+
'repo': 'https://github.com/{0}'.format(repo),
146+
'documentation': doc,
147+
'name': name,
148+
'python': python,
149+
'avatar_url': avatar_url,
150+
}
151+
152+
repo_entry = plugins.get(repo, {})
153+
repo_entry[name] = plugin
154+
plugins[repo] = repo_entry
155+
log.debug('Catalog added plugin %s.', plugin['name'])
156+
except:
157+
log.error('Invalid syntax in %s, skipping... ' % plug['path'])
158+
continue
159+
151160
rate_limit(plugfile_resp)
152161

153162
save_plugins()
@@ -165,6 +174,10 @@ def find_plugins():
165174
log.debug("Repo reqs before ratelimit %s/%s" % (
166175
repo_resp.headers['X-RateLimit-Remaining'],
167176
repo_resp.headers['X-RateLimit-Limit']))
177+
if 'message' in repo_json and repo_json['message'].startswith('API rate limit exceeded for'):
178+
log.error('API rate limit hit anyway ... wait for 30s')
179+
time.sleep(30)
180+
continue
168181
items = repo_json['items']
169182

170183
for i, item in enumerate(items):

tools/user_cache

+1-1
Large diffs are not rendered by default.

tox.ini

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ deps =
1010

1111
commands = py.test
1212

13+
[pep8]
14+
max-line-length = 120
15+
exclude = errbot/config-template.py
16+
1317
[testenv:codestyle]
1418
deps = pycodestyle
15-
max-line-length = 120
1619
commands = pycodestyle errbot tests
1720

1821
[testenv:pypi-lint]

0 commit comments

Comments
 (0)