Skip to content

Instantly share code, notes, and snippets.

View anibalpacheco's full-sized avatar

Aníbal Pacheco anibalpacheco

View GitHub Profile
$ paster db init
Traceback (most recent call last):
File "/home/anibal/venv/ckan2/bin/paster", line 9, in <module>
load_entry_point('PasteScript==1.7.5', 'console_scripts', 'paster')()
File "/home/anibal/venv/ckan2/local/lib/python2.7/site-packages/paste/script/command.py", line 104, in run
invoke(command, command_name, options, args[1:])
File "/home/anibal/venv/ckan2/local/lib/python2.7/site-packages/paste/script/command.py", line 143, in invoke
exit_code = runner.run(args)
File "/home/anibal/venv/ckan2/local/lib/python2.7/site-packages/paste/script/command.py", line 238, in run
result = self.command()
@anibalpacheco
anibalpacheco / gist:6083563
Created July 25, 2013 20:41
TypeError: string indices must be integers
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)
@anibalpacheco
anibalpacheco / gist:6765154
Created September 30, 2013 15:07
sqlalchemy.exc.ProgrammingError: (ProgrammingError) column package.creator_user_id does not exist
(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
@anibalpacheco
anibalpacheco / gist:7586227
Created November 21, 2013 17:48
AttributeError: 'module' object has no attribute 'ckanext-reclinepreview/main'
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)
@anibalpacheco
anibalpacheco / gist:7586810
Created November 21, 2013 18:24
Put jquery at the top in reclinepreview resource.config
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]
@anibalpacheco
anibalpacheco / gist:9838846
Created March 28, 2014 17:54
DetachedInstanceError
(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
@anibalpacheco
anibalpacheco / gist:4a9a23dfb2f5ecbfa4f1
Created August 21, 2014 21:13
CKAN OperationalError
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}
@anibalpacheco
anibalpacheco / compartido.py
Last active June 6, 2020 06:31
la diaria frontpage title spider
# -*- 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
@anibalpacheco
anibalpacheco / gist:d62eedd96409e4c84551ca92e3332c7d
Created September 6, 2016 20:57
Superdesk server docker installation script never finish
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
@anibalpacheco
anibalpacheco / save.py
Created May 19, 2021 04:33
invalid choice error when deleting a TabbedInline in Django 1.5
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: