This file contains 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
# tldr: Retry the request until you got a non-error response. | |
# In my own experience, in less than 40 attempts you can get a non-error response. | |
# For the customer API (Python): | |
response = api_call(...)['response'] | |
response_status = response.get('status') | |
attempts = 0 | |
while response_status == 429 and attempts < max_attempts: | |
response = api_call(...)['response'] |
This file contains 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
def save_existing_objects(self, commit=True): | |
self.changed_objects = [] | |
self.deleted_objects = [] | |
if not self.initial_forms: | |
return [] | |
saved_instances = [] | |
try: | |
forms_to_delete = self.deleted_forms | |
except AttributeError: |
This file contains 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
apacheco@docker:~ $ git clone https://github.com/superdesk/superdesk.git | |
Cloning into 'superdesk'... | |
remote: Counting objects: 80670, done. | |
remote: Compressing objects: 100% (97/97), done. | |
remote: Total 80670 (delta 50), reused 0 (delta 0), pack-reused 80573 | |
Receiving objects: 100% (80670/80670), 68.06 MiB | 3.30 MiB/s, done. | |
Resolving deltas: 100% (60841/60841), done. | |
Checking connectivity... done. | |
apacheco@docker:~ $ cd superdesk | |
apacheco@docker:~/superdesk (master) $ git clone https://github.com/superdesk/superdesk-content-api.git |
This file contains 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
# -*- coding: utf-8 -*- | |
import re | |
import operator | |
import cssutils | |
import logging | |
from datetime import date, datetime, timedelta | |
from scrapy.spiders import CrawlSpider, Rule | |
from scrapy.linkextractors import LinkExtractor | |
from scrapy.http import Request |
This file contains 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
File '/usr/local/ckan/pyenv27_ckan2/lib/python2.7/site-packages/sqlalchemy/engine/default.py', line 331 in do_execute | |
cursor.execute(statement, parameters) | |
OperationalError: (OperationalError) server closed the connection unexpectedly | |
This probably means the server terminated abnormally | |
before or while processing the request. | |
'SELECT system_info.id AS system_info_id, system_info.key AS system_info_key, system_info.value AS system_info_value, system_info.revision_id AS system_info_revision_id \nFROM system_info \nWHERE system_info.key = %(key_1)s \n LIMIT %(param_1)s' {'key_1': 'ckan.config_update', 'param_1': 1} |
This file contains 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
(ckan)anibal@ThinkCentre-M71z:~/venv/ckan/src/ckan$ paster serve development.ini | |
2014-03-28 14:48:48,866 WARNI [ckan.plugins.core] Plugin 'googleanalytics' is using deprecated interface IGenshiStreamFilter | |
/home/anibal/venv/ckan/local/lib/python2.7/site-packages/openid/store/sqlstore.py:437: RuntimeWarning: tp_compare didn't return -1 or -2 for exception | |
import psycopg as exceptions | |
2014-03-28 14:48:49,973 WARNI [ckan.lib.uploader] Please use config option ckan.storage_path instaed of | |
ofs.storage_path | |
Starting server in PID 3213. | |
serving on 0.0.0.0:5000 view at http://127.0.0.1:5000 | |
2014-03-28 14:49:00,363 INFO [ckan.lib.base] / render time 1.774 seconds | |
2014-03-28 14:49:00,745 INFO [ckan.lib.base] /api/i18n/es render time 0.005 seconds |
This file contains 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
diff --git a/ckanext/reclinepreview/theme/public/resource.config b/ckanext/reclinepreview/theme/public/resource.config | |
index 9759082..9c3fa4b 100644 | |
--- a/ckanext/reclinepreview/theme/public/resource.config | |
+++ b/ckanext/reclinepreview/theme/public/resource.config | |
@@ -1,3 +1,7 @@ | |
+[main] | |
+ | |
+force_top = vendor/jquery/1.7.1/jquery.js | |
+ | |
[IE conditional] |
This file contains 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
Error - <type 'exceptions.AttributeError'>: 'module' object has no attribute 'ckanext-reclinepreview/main' | |
URL: http://localhost/dataset/30fd207a-08cc-4241-87ae-70b27035a4b7/resource/ffcfa7ef-555b-42c1-8e9b-465f9f39bcc7/preview | |
File '/home/ckan/venv/ckan2/local/lib/python2.7/site-packages/weberror/errormiddleware.py', line 162 in __call__ | |
app_iter = self.application(environ, sr_checker) | |
File '/home/ckan/venv/ckan2/local/lib/python2.7/site-packages/webob/dec.py', line 147 in __call__ | |
resp = self.call_func(req, *args, **self.kwargs) | |
File '/home/ckan/venv/ckan2/local/lib/python2.7/site-packages/webob/dec.py', line 208 in call_func | |
return self.func(req, *args, **kwargs) | |
File '/home/ckan/venv/ckan2/local/lib/python2.7/site-packages/fanstatic/publisher.py', line 234 in __call__ | |
return request.get_response(self.app) |
This file contains 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
(pyenv_ckan2)[ckan@ckan-desa ckan]$ paster dataset list -c development_appstore.ini | |
Datasets: | |
Traceback (most recent call last): | |
File "/usr/local/ckan/pyenv_ckan2/bin/paster", line 8, in <module> | |
load_entry_point('PasteScript==1.7.5', 'console_scripts', 'paster')() | |
File "/usr/local/ckan/pyenv_ckan2/lib/python2.6/site-packages/paste/script/command.py", line 104, in run | |
invoke(command, command_name, options, args[1:]) | |
File "/usr/local/ckan/pyenv_ckan2/lib/python2.6/site-packages/paste/script/command.py", line 143, in invoke | |
exit_code = runner.run(args) | |
File "/usr/local/ckan/pyenv_ckan2/lib/python2.6/site-packages/paste/script/command.py", line 238, in run |
This file contains 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
Error - <type 'exceptions.TypeError'>: string indices must be integers | |
URL: <<removed from this traceback>> | |
File '/usr/local/ckan/pyenv21/lib/python2.6/site-packages/weberror/errormiddleware.py', line 162 in __call__ | |
app_iter = self.application(environ, sr_checker) | |
File '/usr/local/ckan/pyenv21/lib/python2.6/site-packages/webob/dec.py', line 147 in __call__ | |
resp = self.call_func(req, *args, **self.kwargs) | |
File '/usr/local/ckan/pyenv21/lib/python2.6/site-packages/webob/dec.py', line 208 in call_func | |
return self.func(req, *args, **kwargs) | |
File '/usr/local/ckan/pyenv21/lib/python2.6/site-packages/fanstatic/publisher.py', line 234 in __call__ | |
return request.get_response(self.app) |
NewerOlder