Skip to content
This repository has been archived by the owner on Aug 1, 2019. It is now read-only.

Commit

Permalink
Javadoc short desc fixed
Browse files Browse the repository at this point in the history
- no longer cutting at the "first dot" if it is
  in e.g. a number like "version 3.9.4"
- using regex match instead of "string search"
  • Loading branch information
IzzySoft committed Apr 12, 2016
1 parent 57c731c commit 1c73775
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
2 changes: 2 additions & 0 deletions doc/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ v3.9.4
mandatory objects for code objects only (e.g. @author is not always useful
for tables). mandatory_code_tags inherits mandatory_tags automatically,
so mandatory_tags keep being applied to all objects.
* Javadoc short desc fixed (no longer cutting at the "first dot" if it is
in e.g. a number like "version 3.9.4")

v3.9.3 (30.03.2016)
-------------------
Expand Down
18 changes: 2 additions & 16 deletions lib/hypercore/javadoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,22 +431,8 @@ def getShortDesc(self):
"""
if len(self.desc) < 1:
return ''
dot = []
if self.desc[0].find('?')>0:
dot.append( self.desc[0].find('?') )
if self.desc[0].find('!')>0:
dot.append( self.desc[0].find('!') )
if self.desc[0].find('.')>0:
dot.append( self.desc[0].find('.') )
if self.desc[0].find(';')>0:
dot.append( self.desc[0].find(';') )
if self.desc[0].find('\n')>0:
dot.append( self.desc[0].find('\n') )
if len(dot)>0:
cut = min(dot)
return self.desc[0][0:cut]
else:
return self.desc[0]
shorty = re.match(r"""(.+?([\.\!\?;]\s|\n)|.+)""",self.desc[0])
return shorty.group(1).strip() or self.desc[0]


class JavaDocParam:
Expand Down

0 comments on commit 1c73775

Please sign in to comment.