diff --git a/ckan/lib/helpers.py b/ckan/lib/helpers.py index ed6d6a5b943..ae99ae1234c 100644 --- a/ckan/lib/helpers.py +++ b/ckan/lib/helpers.py @@ -1891,7 +1891,7 @@ def groups_available(am_member=False): member of, otherwise return all groups that the user is authorized to edit (for example, sysadmin users are authorized to edit all groups) (optional, default: False) - :type am-member: boolean + :type am-member: bool ''' context = {} diff --git a/ckan/lib/redis.py b/ckan/lib/redis.py index 0e1c5f80d9b..3a542618690 100644 --- a/ckan/lib/redis.py +++ b/ckan/lib/redis.py @@ -52,7 +52,7 @@ def is_redis_available(): Check whether Redis is available. :returns: The availability of Redis. - :rtype: boolean + :rtype: bool .. seealso:: :py:func:`connect_to_redis` ''' diff --git a/ckan/logic/action/delete.py b/ckan/logic/action/delete.py index 52fbdf2d209..fc9edd2a761 100644 --- a/ckan/logic/action/delete.py +++ b/ckan/logic/action/delete.py @@ -357,7 +357,7 @@ def _group_or_org_delete(context, data_dict, is_org=False): if not authz.check_config_permission('ckan.auth.create_unowned_dataset'): raise ValidationError(_('Organization cannot be deleted while it ' 'still has datasets')) - + pkg_table = model.package_table # using Core SQLA instead of the ORM should be faster model.Session.execute( @@ -428,7 +428,7 @@ def _group_or_org_purge(context, data_dict, is_org=False): :param is_org: you should pass is_org=True if purging an organization, otherwise False (optional, default: False) - :type is_org: boolean + :type is_org: bool ''' model = context['model'] diff --git a/ckan/logic/action/get.py b/ckan/logic/action/get.py index 07ae2868456..d68d3b310d2 100644 --- a/ckan/logic/action/get.py +++ b/ckan/logic/action/get.py @@ -97,7 +97,7 @@ def _package_list_with_resources(context, package_revision_list): def site_read(context, data_dict=None): '''Return ``True``. - :rtype: boolean + :rtype: bool ''' _check_access('site_read', context, data_dict) return True @@ -453,22 +453,22 @@ def group_list(context, data_dict): property for each group is deprecated, but there is a count of the packages in the `package_count` property. (optional, default: ``False``) - :type all_fields: boolean + :type all_fields: bool :param include_dataset_count: if all_fields, include the full package_count (optional, default: ``True``) - :type include_dataset_count: boolean + :type include_dataset_count: bool :param include_extras: if all_fields, include the group extra fields (optional, default: ``False``) - :type include_extras: boolean + :type include_extras: bool :param include_tags: if all_fields, include the group tags (optional, default: ``False``) - :type include_tags: boolean + :type include_tags: bool :param include_groups: if all_fields, include the groups the groups are in (optional, default: ``False``). - :type include_groups: boolean + :type include_groups: bool :param include_users: if all_fields, include the group users (optional, default: ``False``). - :type include_users: boolean + :type include_users: bool :rtype: list of strings ''' @@ -503,23 +503,23 @@ def organization_list(context, data_dict): property for each group is deprecated, but there is a count of the packages in the `package_count` property. (optional, default: ``False``) - :type all_fields: boolean + :type all_fields: bool :param include_dataset_count: if all_fields, include the full package_count (optional, default: ``True``) - :type include_dataset_count: boolean + :type include_dataset_count: bool :param include_extras: if all_fields, include the organization extra fields (optional, default: ``False``) - :type include_extras: boolean + :type include_extras: bool :param include_tags: if all_fields, include the organization tags (optional, default: ``False``) - :type include_tags: boolean + :type include_tags: bool :param include_groups: if all_fields, include the organizations the organizations are in (optional, default: ``False``) - :type all_fields: boolean + :type all_fields: bool :param include_users: if all_fields, include the organization users (optional, default: ``False``). - :type include_users: boolean + :type include_users: bool :rtype: list of strings @@ -535,13 +535,13 @@ def group_list_authz(context, data_dict): :param available_only: remove the existing groups in the package (optional, default: ``False``) - :type available_only: boolean + :type available_only: bool :param am_member: if ``True`` return only the groups the logged-in user is a member of, otherwise return all groups that the user is authorized to edit (for example, sysadmin users are authorized to edit all groups) (optional, default: ``False``) - :type am-member: boolean + :type am-member: bool :returns: list of dictized groups that the user is authorized to edit :rtype: list of dicts @@ -630,7 +630,7 @@ def organization_list_for_user(context, data_dict): :type permission: string :param include_dataset_count: include the package_count in each org (optional, default: ``False``) - :type include_dataset_count: boolean + :type include_dataset_count: bool :returns: list of organizations that the user has the given permission for :rtype: list of dicts @@ -786,7 +786,7 @@ def tag_list(context, data_dict): :type vocabulary_id: string :param all_fields: return full tag dictionaries instead of just names (optional, default: ``False``) - :type all_fields: boolean + :type all_fields: bool :rtype: list of dictionaries @@ -828,7 +828,7 @@ def user_list(context, data_dict): :type order_by: string :param all_fields: return full user dictionaries instead of just names. (optional, default: ``True``) - :type all_fields: boolean + :type all_fields: bool :rtype: list of user dictionaries. User properties include: ``number_of_edits`` which counts the revisions by the user and @@ -1286,25 +1286,25 @@ def group_show(context, data_dict): :type id: string :param include_datasets: include a truncated list of the group's datasets (optional, default: ``False``) - :type include_datasets: boolean + :type include_datasets: bool :param include_dataset_count: include the full package_count (optional, default: ``True``) - :type include_dataset_count: boolean + :type include_dataset_count: bool :param include_extras: include the group's extra fields (optional, default: ``True``) - :type id: boolean + :type id: bool :param include_users: include the group's users (optional, default: ``True``) - :type id: boolean + :type id: bool :param include_groups: include the group's sub groups (optional, default: ``True``) - :type id: boolean + :type id: bool :param include_tags: include the group's tags (optional, default: ``True``) - :type id: boolean + :type id: bool :param include_followers: include the group's number of followers (optional, default: ``True``) - :type id: boolean + :type id: bool :rtype: dictionary @@ -1321,25 +1321,25 @@ def organization_show(context, data_dict): :type id: string :param include_datasets: include a truncated list of the org's datasets (optional, default: ``False``) - :type include_datasets: boolean + :type include_datasets: bool :param include_dataset_count: include the full package_count (optional, default: ``True``) - :type include_dataset_count: boolean + :type include_dataset_count: bool :param include_extras: include the organization's extra fields (optional, default: ``True``) - :type id: boolean + :type id: bool :param include_users: include the organization's users (optional, default: ``True``) - :type id: boolean + :type id: bool :param include_groups: include the organization's sub groups (optional, default: ``True``) - :type id: boolean + :type id: bool :param include_tags: include the organization's tags (optional, default: ``True``) - :type id: boolean + :type id: bool :param include_followers: include the organization's number of followers (optional, default: ``True``) - :type id: boolean + :type id: bool :rtype: dictionary @@ -1436,13 +1436,13 @@ def user_show(context, data_dict): If it is the same user or a sysadmin requesting, it includes datasets that are draft or private. (optional, default:``False``, limit:50) - :type include_datasets: boolean + :type include_datasets: bool :param include_num_followers: Include the number of followers the user has (optional, default:``False``) - :type include_num_followers: boolean + :type include_num_followers: bool :param include_password_hash: Include the stored password hash (sysadmin only, optional, default:``False``) - :type include_password_hash: boolean + :type include_password_hash: bool :returns: the details of the user. Includes email_hash, number_of_edits and number_created_packages (which excludes draft or private datasets @@ -2435,7 +2435,7 @@ def get_site_user(context, data_dict): is responsible for commiting transaction after get_site_user is called. Leaving open connections can cause cli commands to hang! (optional, default: ``False``) - :type defer_commit: boolean + :type defer_commit: bool ''' _check_access('get_site_user', context, data_dict) model = context['model'] @@ -3035,7 +3035,7 @@ def am_following_user(context, data_dict): :param id: the id or name of the user :type id: string - :rtype: boolean + :rtype: bool ''' return _am_following( @@ -3050,7 +3050,7 @@ def am_following_dataset(context, data_dict): :param id: the id or name of the dataset :type id: string - :rtype: boolean + :rtype: bool ''' return _am_following( @@ -3065,7 +3065,7 @@ def am_following_group(context, data_dict): :param id: the id or name of the group :type id: string - :rtype: boolean + :rtype: bool ''' return _am_following( diff --git a/ckan/model/group.py b/ckan/model/group.py index 39420742e2e..00b77d33323 100644 --- a/ckan/model/group.py +++ b/ckan/model/group.py @@ -263,14 +263,14 @@ def packages(self, with_private=False, limit=None, Returns all packages in this group with VDM revision state ACTIVE :param with_private: if True, include the group's private packages - :type with_private: boolean + :type with_private: bool :param limit: the maximum number of packages to return :type limit: int :param return_query: if True, return the SQLAlchemy query object instead of the list of Packages resulting from the query - :type return_query: boolean + :type return_query: bool :returns: a list of this group's packages :rtype: list of ckan.model.package.Package objects diff --git a/ckan/plugins/interfaces.py b/ckan/plugins/interfaces.py index 2592f6e1797..5ff9e01e889 100644 --- a/ckan/plugins/interfaces.py +++ b/ckan/plugins/interfaces.py @@ -1105,7 +1105,7 @@ def is_fallback(self): If no IDatasetForm plugin's ``is_fallback()`` method returns ``True``, CKAN will use ``DefaultDatasetForm`` as the fallback. - :rtype: boolean + :rtype: bool ''' diff --git a/ckanext/example_theme_docs/custom_config_setting/plugin.py b/ckanext/example_theme_docs/custom_config_setting/plugin.py index c89f4e6296f..84779692844 100644 --- a/ckanext/example_theme_docs/custom_config_setting/plugin.py +++ b/ckanext/example_theme_docs/custom_config_setting/plugin.py @@ -16,7 +16,7 @@ def show_most_popular_groups(): Returns ``False`` by default, if the setting is not in the config file. - :rtype: boolean + :rtype: bool ''' value = config.get('ckan.example_theme.show_most_popular_groups', False)