Skip to content

Commit

Permalink
Adapting the code to the las version of pyplete
Browse files Browse the repository at this point in the history
  • Loading branch information
goinnn committed Sep 2, 2012
1 parent ed2216e commit de7453f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions kate_plugins/autopate.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,23 @@ def __init__(self, model, resultList=None):
}

@classmethod
def createItemAutoComplete(cls, text, icon='unknown', args=None, description=None):
def createItemAutoComplete(cls, text, category='unknown', args=None, description=None):
icon_converter = {'package': 'code-block',
'module': 'code-context',
'unknown': 'unknown',
'constant': 'code-variable',
'class': 'code-class',
'function': 'code-function'}
'function': 'code-function',
'pointer': 'unknown'}
max_description = 50
if description and len(description) > max_description:
description = description.strip()
description = '%s...' % description[:max_description]
return {'text': text,
'icon': icon_converter[icon],
'icon': icon_converter[category],
'category': category,
'args': args or '',
'type': icon,
'type': category,
'description': description or ''}

def completionInvoked(self, view, word, invocationType):
Expand Down Expand Up @@ -184,4 +186,4 @@ def getChildrenInJSON(self, keys, json):
if keys_split and keys_split[0] in json:
keys = self.SEPARATOR.join(keys_split[1:])
return self.getChildrenInJSON(keys, json[keys_split[0]].get('children', None))
return None
return None

0 comments on commit de7453f

Please sign in to comment.