Permalink
Browse files

Added option one_line_comment_max_len.

  • Loading branch information...
danfis committed Apr 20, 2010
1 parent 6527aa4 commit d14bcbff0de32e3b250cbc7b8a4004716354b5f1
Showing with 12 additions and 0 deletions.
  1. +4 −0 pitweb.py
  2. +8 −0 project.py
View
@@ -17,6 +17,10 @@
# Default value is 15
commits_in_summary = 15
### Maximal length of one line comment (shown for example in log)
# Default value is 50
one_line_comment_max_len = 50
### Description of project - will be shown in summary
description = 'Some description of your project'
View
@@ -89,6 +89,7 @@ def _config(self):
self._owner = self._configParam(config, 'owner', None)
self._urls = self._configParam(config, 'urls', [])
self._homepage = self._configParam(config, 'homepage', None)
self._one_line_comment_max_len = self._configParam(config, 'one_line_comment_max_len', 50)
self._setSnapshots(config)
def _configParam(self, config, name, default):
@@ -605,7 +606,10 @@ def _fHeads(self, heads):
comm = h.commit()
line = self._esc(comm.commentFirstLine())
if len(line) > self._one_line_comment_max_len:
line = line[:self._one_line_comment_max_len] + '...'
line = line.replace('{', '{{').replace('}', '}}')
v = { 'a' : 'log',
'id' : comm.id }
commanchor = self.anchor(line, v = v, cls = 'comment')
@@ -679,6 +683,8 @@ def _fRemotes(self, remotes):
comm = r.commit()
line = self._esc(comm.commentFirstLine())
if len(line) > self._one_line_comment_max_len:
line = line[:self._one_line_comment_max_len] + '...'
line = line.replace('{', '{{').replace('}', '}}')
v = { 'a' : 'log',
@@ -767,6 +773,8 @@ def _fLog(self, commits, id = 'HEAD', longcomment = False, showmsg = False, page
<td>'''
line = self._esc(commit.commentFirstLine())
if not showmsg and len(line) > self._one_line_comment_max_len:
line = line[:self._one_line_comment_max_len] + '...'
line = line.replace('{', '{{')
line = line.replace('}', '}}')

0 comments on commit d14bcbf

Please sign in to comment.