Skip to content

Instantly share code, notes, and snippets.

View amercader's full-sized avatar
🦃

Adrià Mercader amercader

🦃
View GitHub Profile
@amercader
amercader / gist:510531cecec298d29b99a3815211caa5
Created May 29, 2024 19:57
Tp-Link UB500 Bluetooth dongle on Ubuntu 20.04

The dongle is recognized but the bluetooth UI does not respond

sudo dmesg | grep -i bluetooth

[  371.792424] Bluetooth: hci0: RTL: loading rtl_bt/rtl8761bu_fw.bin
[  371.792455] bluetooth hci0: Direct firmware load for rtl_bt/rtl8761bu_fw.bin failed with error -2
[  371.792459] Bluetooth: hci0: RTL: firmware file rtl_bt/rtl8761bu_fw.bin not found

diff --git a/ckan/lib/search/query.py b/ckan/lib/search/query.py
index c2646f868..205511fac 100644
--- a/ckan/lib/search/query.py
+++ b/ckan/lib/search/query.py
@@ -23,7 +23,7 @@ _open_licenses = None
VALID_SOLR_PARAMETERS = set([
'q', 'fl', 'fq', 'rows', 'sort', 'start', 'wt', 'qf', 'bf', 'boost',
'facet', 'facet.mincount', 'facet.limit', 'facet.field',
- 'extras', 'fq_list', 'tie', 'defType', 'mm', 'df'
+ 'extras', 'fq_list', 'tie', 'defType', 'mm', 'df', 'hl', 'hl.fl',
diff --git a/ckan/plugins/blanket.py b/ckan/plugins/blanket.py
index 8be03eb19..f1c3fa52d 100644
--- a/ckan/plugins/blanket.py
+++ b/ckan/plugins/blanket.py
@@ -1,83 +1,87 @@
# -*- coding: utf-8 -*-
-"""Quick implementations for simplest interfaces.
-
-Decorate plugin with ``@tk.blanket.<GROUP>`` and it will automatically
@amercader
amercader / dataset.json
Created January 25, 2021 20:20
Sections in form with ckanext-scheming
{
"dataset_fields": [
{
"section": "Basic Metadata",
"field_name": "title",
"label": "Title",
"...": "..."
},
{
diff --git a/ckan/lib/signals.py b/ckan/lib/signals.py
index 681de8b92..22b4cc635 100644
--- a/ckan/lib/signals.py
+++ b/ckan/lib/signals.py
@@ -26,16 +26,16 @@ request processing happens.
request_finished = ckan.signal(u'request_finished')
"""This signal is sent right before the response is sent to the
client.
-
"""
#!/usr/bin/env python
'''
Helper script to export datasets metadata from a CKAN instance using the ckanapi library
Usage:
./export_ckan_metadata.py <CKAN URL> <API key>
For example:
@amercader
amercader / action.py
Last active June 14, 2019 09:35
Example plugin with some commonly used interfaces implemented
def collection_show(context, data_dict):
model = context['model']
user = context['user']
id = toolkit.get_or_bust(data_dict, id)
collection = Collection.get(id)
if not collection:
raise toolkit.ObjectNotFound()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
nosetests --reset-db --nologcapture --with-pylons=test-core-custom.ini ckan/tests/legacy -v
No handlers could be found for logger "ckan.lib.uploader"
ckan.tests.legacy.setup_test_search_index ... ok
Test the error response when a user tries to add a tag to a vocab ... ok
ckan.tests.legacy.functional.api.model.test_vocabulary.TestVocabulary.test_add_tag_invalid_name ... ok
ckan.tests.legacy.functional.api.model.test_vocabulary.TestVocabulary.test_add_tag_invalid_vocab_id ... ok
Test the error response when a user tries to create a tag without ... ok
ckan.tests.legacy.functional.api.model.test_vocabulary.TestVocabulary.test_add_tag_not_authorized ... ok
ckan.tests.legacy.functional.api.model.test_vocabulary.TestVocabulary.test_add_tag_not_logged_in ... ok
Test that a tag can be added to and then retrieved from a vocab. ... ok
diff --git a/.circleci-matrix.yml b/.circleci-matrix.yml
index 8e548dc..6141f1e 100644
--- a/.circleci-matrix.yml
+++ b/.circleci-matrix.yml
@@ -6,4 +6,4 @@ env:
command:
- mkdir -p $CIRCLE_TEST_REPORTS/nose
-- nosetests --ckan --reset-db --with-pylons=test-core.ini --nologcapture --with-coverage --cover-package=ckan --cover-package=ckanext --with-xunit --xunit-file=$CIRCLE_TEST_REPORTS/nose/junit.xml --segments=$SEGMENTS ckan ckanext
+- nosetests --ckan --reset-db --with-pylons=test-core.ini --nologcapture --with-coverage --cover-package=ckan --cover-package=ckanext --with-xunit --xunit-file=$CIRCLE_TEST_REPORTS/nose/junit.xml --segments=$SEGMENTS -v ckan ckanext