polyswarmclient.filters.bountyfilter

Module Contents

polyswarmclient.filters.bountyfilter.logger[source]
polyswarmclient.filters.bountyfilter.split_filter(ctx, param, value)[source]
Split some accept or exlcude arg from `key:value` to a tuple
Parameters
  • ctx

  • param

  • value – list of exclude or accept values

Returns

list[tuple] list of exclude|accept values as tuple key, value

class polyswarmclient.filters.bountyfilter.BountyFilter(accept, reject)[source]

Bases: polyswarmclient.filters.filter.MetadataFilter

Takes two objects list[Filter], accept and reject These dicts are used to filter metadata json blobs. Each filter runs against given metadata, and is used to determine if this participant will respond to a bounty

is_allowed(self, metadata)[source]

Check metadata against the accept and exclude filters, returning True if it passes all checks

Parameters

metadata (dict) – metadata dict to test

Returns

True if meets the conditions and passes the filter

Return type

(bool)