Changeset - dee0e7eb0370
[Not reviewed]
default
0 3 0
*** failed to import extension hggit: No module named hggit - 15 years ago 2010-08-26 22:09:55

removed decodes, thus it should be implemented on vcs side
fixed bug on annotation links in helpers
3 files changed with 9 insertions and 7 deletions:
0 comments (0 inline, 0 general)
pylons_app/controllers/summary.py
Show inline comments
 
@@ -115,27 +115,27 @@ class SummaryController(BaseController):
 
                    #aggregate[author_key_cleaner(cs.author)].update(dates_range)
 
                    aggregate[author_key_cleaner(cs.author)][k] = {}
 
                    aggregate[author_key_cleaner(cs.author)][k]["commits"] = 1
 
                    aggregate[author_key_cleaner(cs.author)][k]["added"] = len(cs.added)
 
                    aggregate[author_key_cleaner(cs.author)][k]["changed"] = len(cs.changed)
 
                    aggregate[author_key_cleaner(cs.author)][k]["removed"] = len(cs.removed)                 
 
        
 
        d = ''
 
        tmpl0 = u""""%s":%s"""
 
        tmpl1 = u"""{label:"%s",data:%s,schema:["commits"]},"""
 
        for author in aggregate:
 
            
 
            d += tmpl0 % (author.decode('utf8'),
 
            d += tmpl0 % (author,
 
                          tmpl1 \
 
                          % (author.decode('utf8'),
 
                          % (author,
 
                        [{"time":x,
 
                          "commits":aggregate[author][x]['commits'],
 
                          "added":aggregate[author][x]['added'],
 
                          "changed":aggregate[author][x]['changed'],
 
                          "removed":aggregate[author][x]['removed'],
 
                          } for x in aggregate[author]]))
 
        if d == '':
 
            d = '"%s":{label:"%s",data:[[0,1],]}' \
 
                % (author_key_cleaner(repo.contact),
 
                   author_key_cleaner(repo.contact))
 
        return d
 

	
pylons_app/lib/helpers.py
Show inline comments
 
@@ -211,55 +211,57 @@ class _FilesBreadCrumbs(object):
 
                                            revision=rev,
 
                                            f_path='/'.join(paths_l[:cnt]))))
 

	
 
        return literal(' / '.join(url_l))
 

	
 
files_breadcrumbs = _FilesBreadCrumbs()
 

	
 
def pygmentize(filenode, **kwargs):
 
    """
 
    pygmentize function using pygments
 
    @param filenode:
 
    """
 
    return literal(code_highlight(filenode.content, filenode.lexer, HtmlFormatter(**kwargs)))
 
    return literal(code_highlight(filenode.content, 
 
                                  filenode.lexer, HtmlFormatter(**kwargs)))
 

	
 
def pygmentize_annotation(filenode, **kwargs):
 
    """
 
    pygmentize function for annotation
 
    @param filenode:
 
    """
 
    
 
    color_dict = g.changeset_annotation_colors
 
    def gen_color():
 
        import random
 
        return [str(random.randrange(10, 235)) for _ in xrange(3)]
 
    def get_color_string(cs):
 
        if color_dict.has_key(cs):
 
            col = color_dict[cs]
 
        else:
 
            color_dict[cs] = gen_color()
 
            col = color_dict[cs]
 
        return "color: rgb(%s) ! important;" % (', '.join(col))
 
        
 
    def url_func(changeset):
 
        tooltip_html = "<div style='font-size:0.8em'><b>Author:</b> %s<br/><b>Date:</b> %s</b><br/><b>Message:</b> %s<br/></div>" 
 
        tooltip_html = "<div style='font-size:0.8em'><b>Author:</b>"+\
 
        " %s<br/><b>Date:</b> %s</b><br/><b>Message:</b> %s<br/></div>" 
 
        
 
        tooltip_html = tooltip_html % (changeset.author,
 
                                               changeset.date,
 
                                               tooltip(changeset.message))
 
        lnk_format = 'r%s:%s' % (changeset.revision,
 
                                 changeset.raw_id)
 
        uri = link_to(
 
                lnk_format,
 
                url('changeset_home', repo_name='test',
 
                url('changeset_home', repo_name=changeset.repository.name,
 
                    revision=changeset.raw_id),
 
                style=get_color_string(changeset.raw_id),
 
                class_='tooltip',
 
                tooltip_title=tooltip_html
 
              )
 
        
 
        uri += '\n'
 
        return uri   
 
    return literal(annotate_highlight(filenode, url_func, **kwargs))
 
      
 
def repo_name_slug(value):
 
    """
pylons_app/templates/changelog/changelog.html
Show inline comments
 
@@ -52,42 +52,42 @@
 
									%for tag in cs.tags:
 
										<span class="tagtag">${tag}</span>
 
									%endfor
 
								</span>					
 
							<div class="author">
 
								<div class="gravatar">
 
									<img alt="gravatar" src="${h.gravatar_url(h.email(cs.author),20)}"/>
 
								</div>
 
								<span>${h.person(cs.author)}</span><br/>
 
								<span><a href="mailto:${h.email_or_none(cs.author)}">${h.email_or_none(cs.author)}</a></span><br/>
 
							</div>
 
							<div class="message">
 
								${h.link_to(h.wrap_paragraphs(cs.message.decode('utf-8','replace')),
 
								${h.link_to(h.wrap_paragraphs(cs.message),
 
								h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}
 
							</div>
 
						</div>	
 
						<div class="right">
 
									<div class="changes">
 
										<span class="removed" title="${_('removed')}">${len(cs.removed)}</span>
 
										<span class="changed" title="${_('changed')}">${len(cs.changed)}</span>
 
										<span class="added" title="${_('added')}">${len(cs.added)}</span>
 
									</div>					
 
										%if len(cs.parents)>1:
 
										<div class="merge">
 
											${_('merge')}<img alt="merge" src="/images/icons/arrow_join.png"/>
 
										</div>
 
										%endif						
 
									%for p_cs in reversed(cs.parents):
 
										<div class="parent">${_('Parent')} ${p_cs.revision}: ${h.link_to(p_cs.raw_id,
 
											h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message.decode('utf-8','replace'))}
 
											h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)}
 
										</div>
 
									%endfor								
 
						</div>				
 
					</div>
 
					
 
				%endfor
 
				<div class="pagination-wh pagination-left">
 
					${c.pagination.pager('$link_previous ~2~ $link_next')}
 
				</div>			
 
				</div>
 
			</div>
 
			
0 comments (0 inline, 0 general)