Changeset 1213:56ae1354581a

Show
Ignore:
Timestamp:
07/25/08 22:11:16 (4 months ago)
Author:
Ali Afshar <aafshar@…>
Message:

Python browser: fixed decorators that are calls to functions. Fixes lp:237851

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pida-plugins/python/ropebrowser.py

    r1212 r1213  
    8181 
    8282    type_name = 'f' 
    83     icon_name = 'source-function' 
     83    icon_name = 'source-method' 
    8484    type_color = '#900000' 
    8585    position = 2 
     
    8787    def get_pre_markup(self): 
    8888        """Draw decorators""" 
    89         decs = ', '.join(['@' + d.id for d in 
    90             self.item.object.decorators]) 
     89        decs = [] 
     90        for dec in self.item.object.decorators: 
     91            if hasattr(dec, 'id'): 
     92                decs.append('@' + dec.id) 
     93            elif hasattr(dec, 'func'): 
     94                decs.append('@' + dec.func.id + '()') 
     95        decs = ', '.join(decs) 
    9196        if decs: 
    92             print self.item.object.decorators 
    9397            decs = decs + '\n' 
    9498        return markup_fixed(markup_italic(decs)) 
     
    199203                return StaticMethodOptions(item) 
    200204            else: 
    201                 print item.object.get_kind(), item.name 
    202205                return FunctionOptions(item) 
    203206        else: 
     
    210213        return EvaluatedOptions(item) 
    211214    else: 
    212         print 'boo', item, item.node, item.name, item.object 
     215        print 'Unknown Node', item, item.node, item.name, item.object 
    213216 
    214217