Skip to content

Commit

Permalink
removed MATCH_ALLCHARS filter from list
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Koval committed Dec 27, 2016
1 parent 8bd0607 commit 60d0f55
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions aws_workflow/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import workflow
from workflow.background import run_in_background, is_running
from workflow import MATCH_ALL, MATCH_ALLCHARS

from .utils import json_serializer
from .utils import filter_facets
Expand Down Expand Up @@ -99,7 +100,7 @@ def filter_items(self, wf, instances, terms):
if len(terms) == 1 and terms[0].startswith('i-'):
return wf.filter(terms[0], instances, key=lambda i: unicode(i['InstanceId']), match_on=workflow.MATCH_STARTSWITH)
elif len(terms) > 0:
return wf.filter(' '.join(terms), instances, key=lambda i: i['facets'].get('name', u''))
return wf.filter(' '.join(terms), instances, match_on=MATCH_ALL ^ MATCH_ALLCHARS, key=lambda i: i['facets'].get('name', u''))
return instances

state_icons = {
Expand Down Expand Up @@ -157,7 +158,7 @@ def create_title(self, bucket):
return bucket['Name']

def filter_items(self, wf, items, terms):
return wf.filter(' '.join(terms), items, key=lambda b: unicode(b['Name']))
return wf.filter(' '.join(terms), items, match_on=MATCH_ALL ^ MATCH_ALLCHARS, key=lambda b: unicode(b['Name']))

def populate_menu_item(self, wf, bucket, title, uid, region_name, quicklookurl):
item = wf.add_item(
Expand All @@ -181,7 +182,7 @@ def create_title(self, db):
return db['facets']['name']

def filter_items(self, wf, items, terms):
return wf.filter(' '.join(terms), items, key=lambda b: unicode(b['facets']['name']))
return wf.filter(' '.join(terms), items, match_on=MATCH_ALL ^ MATCH_ALLCHARS, key=lambda b: unicode(b['facets']['name']))

def populate_menu_item(self, wf, db, title, uid, region_name, quicklookurl):
if db['type'] == 'instance':
Expand Down Expand Up @@ -225,7 +226,7 @@ def create_title(self, stack):
return stack['StackName']

def filter_items(self, wf, stacks, terms):
return wf.filter(' '.join(terms), stacks, key=lambda stack: unicode(stack['StackName']))
return wf.filter(' '.join(terms), stacks, match_on=MATCH_ALL ^ MATCH_ALLCHARS, key=lambda stack: unicode(stack['StackName']))

def populate_menu_item(self, wf, stack, title, uid, region_name, quicklookurl):
url = 'https://%s.console.aws.amazon.com/cloudformation/home?region=%s#/stack/detail?stackId=%s' % (region_name, region_name, stack['StackId'])
Expand Down Expand Up @@ -253,7 +254,7 @@ def create_title(self, queue):
return queue['QueueName']

def filter_items(self, wf, stacks, terms):
return wf.filter(' '.join(terms), stacks, key=lambda stack: unicode(stack['QueueUrl']))
return wf.filter(' '.join(terms), stacks, match_on=MATCH_ALL ^ MATCH_ALLCHARS, key=lambda stack: unicode(stack['QueueUrl']))

def populate_menu_item(self, wf, queue, title, uid, region_name, quicklookurl):
queue_url = queue['QueueUrl']
Expand Down Expand Up @@ -291,7 +292,7 @@ def create_title(self, item):
return item['ClusterIdentifier']

def filter_items(self, wf, items, terms):
return wf.filter(' '.join(terms), items, key=lambda item: unicode(item['ClusterIdentifier']))
return wf.filter(' '.join(terms), items, match_on=MATCH_ALL ^ MATCH_ALLCHARS, key=lambda item: unicode(item['ClusterIdentifier']))

def populate_menu_item(self, wf, cluster, title, uid, region_name, quicklookurl):
url = 'https://%s.console.aws.amazon.com/redshift/home?region=%s#cluster-details:cluster=%s' % (region_name, region_name, title)
Expand Down Expand Up @@ -341,7 +342,7 @@ def create_title(self, item):
return item['FunctionName']

def filter_items(self, wf, items, terms):
return wf.filter(' '.join(terms), items, key=lambda item: unicode(item['FunctionName']))
return wf.filter(' '.join(terms), items, match_on=MATCH_ALL ^ MATCH_ALLCHARS, key=lambda item: unicode(item['FunctionName']))

def populate_menu_item(self, wf, function, title, uid, region_name, quicklookurl):
url = 'https://%s.console.aws.amazon.com/lambda/home?region=%s#/functions/%s?tab=code' % (region_name, region_name, title)
Expand All @@ -366,7 +367,7 @@ def create_title(self, item):
return item['EnvironmentName']

def filter_items(self, wf, items, terms):
return wf.filter(' '.join(terms), items, key=lambda item: unicode(item['EnvironmentName']))
return wf.filter(' '.join(terms), items, match_on=MATCH_ALL ^ MATCH_ALLCHARS, key=lambda item: unicode(item['EnvironmentName']))

health_icons = {
'Green': u'🍏',
Expand Down

0 comments on commit 60d0f55

Please sign in to comment.