Skip to content

Commit

Permalink
Implemented IClick
Browse files Browse the repository at this point in the history
  • Loading branch information
erik-civity committed Oct 9, 2024
1 parent 072fd01 commit 8fa08bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions ckanext/civity/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def init():
{'model': model, 'ignore_auth': True, 'user': site_user['name']},
pkg_dict
)
click.secho("Updated package: %s" % pkg_id, fg="green", bold=True)
except Exception as e:
error_shout(e)
error_shout(u"Package '{}' was not found".format(pkg_id))
6 changes: 6 additions & 0 deletions ckanext/civity/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import ckanext.civity.logic.action.get as action_get
from ckanext.civity.uploader import CivityResourceUpload
from ckan.lib.plugins import DefaultTranslation
import ckanext.civity.cli as cli


class CivityPlugin(plugins.SingletonPlugin, DefaultTranslation):
Expand All @@ -18,6 +19,7 @@ class CivityPlugin(plugins.SingletonPlugin, DefaultTranslation):
plugins.implements(plugins.IPackageController, inherit=True)
plugins.implements(plugins.ITemplateHelpers)
plugins.implements(plugins.IActions)
plugins.implements(plugins.IClick)


users_assign_all_groups = toolkit.config.get('civity.users_assign_all_groups', False)
Expand Down Expand Up @@ -118,3 +120,7 @@ def get_actions(self):

def get_resource_uploader(self, data_dict):
return CivityResourceUpload(data_dict)

# IClick
def get_commands(self):
return [cli.civity]

0 comments on commit 8fa08bd

Please sign in to comment.