Changeset 2361

Show
Ignore:
Timestamp:
07/01/07 16:18:17 (1 year ago)
Author:
eblot
Message:

RevtreePlugin:

Add helper functions to the RevtreePlugin for enhancers

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • revtreeplugin/0.11/revtree/model.py

    r2111 r2361  
    242242 
    243243    def branch(self, branchname): 
    244         """Returns a tracked branch from its name (path)""" 
     244        """Returns a tracked branch from its name (path) 
     245            
     246           branchname should be a unicode string, and should not start with 
     247           a leading path separator (/) 
     248        """ 
    245249        if not self._branches.has_key(branchname): 
    246250            return None 
     
    274278        changeset = self._crepos.get_changeset(revision) 
    275279        return changeset.get_properties() 
     280         
     281    def get_node_properties(self, path, revision): 
     282        return self._crepos.get_node(path, revision).get_properties() 
    276283                                            
    277284    def find_node(self, path, rev): 
  • revtreeplugin/0.11/revtree/svgview.py

    r2280 r2361  
    136136        s *= 3.0; 
    137137        if s > 1: s = 1 
     138        (r,g,b) = hsv_to_rgb(h,s,v) 
     139        return SvgColor((int(r*0xff),int(g*0xff),int(b*0xff))) 
     140 
     141    def lighten(self): 
     142        (r,g,b) = (float(self._color[0])/0xff,  
     143                   float(self._color[1])/0xff,  
     144                   float(self._color[2])/0xff) 
     145        (h,s,v) = rgb_to_hsv(r,g,b) 
     146        v *= 1.5; 
     147        if v > 1: v = 1 
    138148        (r,g,b) = hsv_to_rgb(h,s,v) 
    139149        return SvgColor((int(r*0xff),int(g*0xff),int(b*0xff))) 
     
    578588    """Graphical group of consecutive changesets within a same branch""" 
    579589     
    580     def __init__(self, parent, firstChg, lastChg, color='#fffbdb'): 
     590    def __init__(self, parent, firstChg, lastChg,  
     591                 color='#fffbdb', opacity=50): 
    581592        self._parent = parent 
    582593        self._first = firstChg 
     
    584595        self._fillcolor = SvgColor(color) 
    585596        self._strokecolor = self._fillcolor.strongify() 
     597        self._opacity = opacity 
    586598     
    587599    def build(self): 
     
    603615        self._widget.attributes['rx'] = r  
    604616        self._widget.attributes['ry'] = r  
    605         self._widget.attributes['opacity'] = '0.5'  
     617        self._widget.attributes['opacity'] = str(self._opacity/100.0)  
    606618        self._extent = (w,h) 
    607619         
  • revtreeplugin/0.11/setup.py

    r2299 r2361  
    1616 
    1717PACKAGE = 'TracRevtreePlugin' 
    18 VERSION = '0.5.6
     18VERSION = '0.5.7
    1919 
    2020setup (