Skip to content

Commit

Permalink
Refactor get_actions methods to simplify return statements and remove…
Browse files Browse the repository at this point in the history
… commented-out code
  • Loading branch information
mjanez committed Oct 23, 2024
1 parent dae2d83 commit 617db41
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions ckanext/schemingdcat/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ def get_signal_subscriptions(self):

#IActions
def get_actions(self):
action_functions = _get_logic_functions('ckanext.schemingdcat.logic.action')

return action_functions
return _get_logic_functions('ckanext.schemingdcat.logic.action')

class SchemingDCATDatasetsPlugin(SchemingDatasetsPlugin):
p.implements(p.IConfigurer)
Expand Down Expand Up @@ -236,24 +234,9 @@ def about_template(self):


class SchemingDCATOpenDataStatisticsPlugin(p.SingletonPlugin):
#p.implements(p.IConfigurer)
p.implements(p.IActions)
p.implements(p.IConfigurable)

# # IConfigurer
# def update_config(self, config_):
# sdct_config.schemingdcat_open_data_statistics_themes = p.toolkit.asbool(
# config_.get(
# "ckanext.schemingdcat.open_data_statistics_themes", sdct_config.schemingdcat_open_data_statistics_themes
# )
# )

# sdct_config.schemingdcat_open_data_statistics = p.toolkit.asbool(
# config_.get(
# "ckanext.schemingdcat.open_data_statistics", sdct_config.schemingdcat_open_data_statistics
# )
# )

#IConfigurable
def configure(self, config):
args = sys.argv
Expand All @@ -266,9 +249,7 @@ def configure(self, config):

#IActions
def get_actions(self):
action_functions = _get_logic_functions('ckanext.schemingdcat.statistics.logic.action')

return action_functions
return _get_logic_functions('ckanext.schemingdcat.statistics.logic.action')

def _get_logic_functions(module_root, logic_functions=None, decorator=None):
"""
Expand Down

0 comments on commit 617db41

Please sign in to comment.